-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sanity check]: Add mux simulator sanity check #2862
[sanity check]: Add mux simulator sanity check #2862
Conversation
This pull request introduces 1 alert when merging fca2ac3d0b0a0fc2d63cefff9e7e366cdca61a9c into 2f0b561 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging e63cdaf852a5505baa3e3db3d23f7b8832b64c15 into 15793fb - view on LGTM.com new alerts:
|
Signed-off-by: Lawrence Lee <[email protected]>
* Make compatible with other topologies Signed-off-by: Lawrence Lee <[email protected]>
3d3c643
to
5729745
Compare
This pull request introduces 1 alert when merging 5729745 into e893f73 - view on LGTM.com new alerts:
|
return results | ||
|
||
try: | ||
pytest_assert(ptf_arp_tgt_ip in lower_tor_arp_table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ptf_arp_tgt_ip in lower_tor_arp_table
--> ptf_arp_tgt_ip not in lower_tor_arp_table
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #2862 (comment)
pytest_assert(ptf_arp_tgt_ip in lower_tor_arp_table) | ||
except AssertionError: | ||
results['failed'] = True | ||
results['failed_reason'] = 'Packet from PTF not received on standby lower ToR' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Packet from PTF not received on standby lower ToR'
--> 'Packet from PTF received on standby lower ToR'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are actually expecting the packet from PTF to reach both ToRs here, since upstream traffic from the server is broadcast to both ToRs. I'll fix my comments to be accurate, sorry for the confusion!
results['failed_reason'] = 'Unable to switch active link to upper ToR' | ||
return results | ||
|
||
# Ping from both ToRs, expect both messages to reach PTF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Ping from both ToRs, expect both messages to reach PTF
-> # Ping from both ToRs, expect only message from upper_tor to reach PTF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack, thanks!
upper_tor_arp_table = upper_tor_host.switch_arptable()['ansible_facts']['arptable']['v4'] | ||
lower_tor_arp_table = lower_tor_host.switch_arptable()['ansible_facts']['arptable']['v4'] | ||
try: | ||
pytest_assert(ptf_arp_tgt_ip in upper_tor_arp_table) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ptf_arp_tgt_ip in upper_tor_arp_table
--> ptf_arp_tgt_ip not in upper_tor_arp_table
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment #2862 (comment)
pytest_assert(ptf_arp_tgt_ip in upper_tor_arp_table) | ||
except AssertionError: | ||
results['failed'] = True | ||
results['failed_reason'] = 'Packet from PTF not received on standby upper ToR' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Packet from PTF not received on standby upper ToR'
-> 'Packet from PTF received on standby upper ToR'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #2862 (comment)
results['failed_reason'] = 'Packet from PTF not received on active lower ToR' | ||
return results | ||
|
||
logger.info(json.dumps(results, indent=4, sort_keys=True)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest not to dump the check result here. All the check results will be dumped at INFO level after all checks are done. It would be better just to log an INFO message indicating mux simulator sanity check is done.
Signed-off-by: Lawrence Lee <[email protected]>
This pull request introduces 1 alert when merging bea9715 into a1a713e - view on LGTM.com new alerts:
|
Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Lawrence Lee <[email protected]>
This pull request introduces 1 alert when merging 0b6d219 into 7e92609 - view on LGTM.com new alerts:
|
Signed-off-by: Lawrence Lee <[email protected]>
results['failed_reason'] = 'Unable to switch active link to upper ToR' | ||
return results | ||
|
||
# Ping from both ToRs, expect only message from upper ToR to reach PTF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to clear ARP on DUT before start ping?
* Avoid errors when using fixtures in other fixtures that are module scoped (e.g. sanity_check) Signed-off-by: Lawrence Lee <[email protected]>
* Only run check items that are actually defined in checks.py Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Lawrence Lee <[email protected]>
Signed-off-by: Lawrence Lee [email protected]
Description of PR
Summary:
Closes #2753
Type of change
Approach
What is the motivation for this PR?
Ensure that the mux cable simulator is fully functional prior to each test run
How did you do it?
ping
command automatically sends ARP requests when it cannot find the target address, and check for the receipt of these ARP requests on the PTF. The ping command itself is expected to fail.Note that due to the new sanity check structure,
check_simulator_read_side
had to be renamed toget_simulator_read_side
to prevent pytest from looking for a non-existent fixture namedcheck_simulator_read_side
(this is only necessary becausechecks.py
iemports this method).How did you verify/test it?
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation