Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ansible/roles/test/files/ptftests/fdb_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def setUp(self):
#--------------------------------------------------------------------------

def runTest(self):
max_time = 200 # seconds
max_time = 300 # seconds
i = 0
start_time = time.time()
while i < 0xffff - 128 and time.time() - start_time < max_time:
Expand Down
12 changes: 10 additions & 2 deletions ansible/roles/test/tasks/fdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@
poll: 0

- name: Reload config
command: config reload -y
become: yes
include: "roles/test/tasks/common_tasks/reload_config.yml"
vars:
config_source: "config_db"

- name: Get PID of the PTF script
command: "pgrep -f '/usr/bin/python /usr/bin/ptf'"
Expand Down Expand Up @@ -153,7 +154,14 @@
command: sonic-clear fdb all
when: sdk_fdb_count.stdout == show_mac_output.stdout

- fail: msg="No FDB is learned, something wrong with the switch"
when: sdk_fdb_count.stdout | int == 0 or show_mac_output.stdout | int == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just thinking, after fdb clear, the count would be 0 until it learns next right? I don't see a sleep in between. This I believe can break the test intermittently.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, config reloading would clear FDB. And then new FDB entries would be learned if the PTF script is still running. Currently the PTF script runs 300 seconds. After the PTF script is started, the config reload command is executed immediately. There is no need to sleep in between. If config reloading takes more than 300s to complete, the test will fail because of 0 FDB learned. In this case, the config reloading takes too long and is a problem that need to be fixed.


- fail: msg="In consistent number MAC entries between SDK and DB"
when: sdk_fdb_count.stdout != show_mac_output.stdout

when: sonic_asic_type == 'mellanox'

always:
- name: clear FDB table
command: sonic-clear fdb all