Skip to content

Fix the false alarm of checking reboot result#2096

Merged
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:fix-reboot
Aug 14, 2020
Merged

Fix the false alarm of checking reboot result#2096
wangxin merged 1 commit intosonic-net:masterfrom
wangxin:fix-reboot

Conversation

@wangxin
Copy link
Collaborator

@wangxin wangxin commented Aug 13, 2020

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

After PR "#2063 Fix the issue of no 'failed' field in failed ansible module result "
is merged, the ansible module result will no longer have the 'failed' field filtered out. We now can count on the 'is_failed'
property of ansible module result to tell if it is failed or not. However, just assert that the result is failed if the 'failed' field
is in the result dict is not safe now. It's because the 'failed' field may have value 'false'. The reboot function in reboot.py
may raise false alarm "DUT was not shutdown".

How did you do it?

The fix:

  • Explicitly check the 'is_failed' property of localhost.wait_for result to determine whether the DUT is down or up as expected.

How did you verify/test it?

Test run a simple script calling the reboot function defined in tests/common/reboot.py.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

After PR "#2063 Fix the issue of no 'failed' field in failed ansible module result "
is merged, the ansible module result will no longer have the 'failed' field filtered out. We now can count on the 'is_failed'
property of ansible module result to tell if it is failed or not. However, just assert that the result is failed if the 'failed' field
is in the result dict is not safe now. It's because the 'failed' field may have value 'false'. The reboot function in reboot.py
may raise false alarm "DUT was not shutdown".

The fix:
* Explicitly check the 'is_failed' property of localhost.wait_for result to determine whether the DUT is down or up as expected.

Signed-off-by: Xin Wang <[email protected]>
@wangxin wangxin requested a review from a team August 13, 2020 09:33
@wangxin wangxin merged commit 669fd5a into sonic-net:master Aug 14, 2020
@wangxin wangxin deleted the fix-reboot branch September 24, 2020 02:34
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
a6d35de Handling Invalid CRM configuration gracefully (sonic-net#2109)
d6559e6 [Mellanox] '_8lane' not added to Mellanox 5xxx models with 800G (sonic-net#2090)
45551b2 [vnetorch] Advertise vnet tunnel routes (sonic-net#2058)
ed58d2f Add initial value for weight in overlay nexthops (sonic-net#2096)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants