Skip to content

[advance-reboot] Restore fast-reboot script inside DUT after negative test#4198

Merged
vaibhavhd merged 1 commit intosonic-net:masterfrom
vaibhavhd:adv-reboot-fix
Sep 9, 2021
Merged

[advance-reboot] Restore fast-reboot script inside DUT after negative test#4198
vaibhavhd merged 1 commit intosonic-net:masterfrom
vaibhavhd:adv-reboot-fix

Conversation

@vaibhavhd
Copy link
Copy Markdown
Contributor

Description of PR

Summary: Fix the restoration logic for fastboot and warmboot scripts after the negative cases modify them. Negative testcases are test_cancelled_fast_reboot and test_cancelled_warm_reboot.

Fixes # (issue)

Type of change

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

Back port request

  • 201911

Approach

What is the motivation for this PR?

Warmboot SAD cases are failing in the nightly regression testing but not locally. This is caused by tests that precede the sad cases - test_cancelled_warm_reboot has incorrect restoration of reboot scripts inside DUT after negative cases modify the scripts.

The error in SAD cases:

Traceback (most recent call last):\n  File "ptftests/advanced-reboot.py", line 1193, in runTest\n
self.handle_post_reboot_test_reports()\n
File "ptftests/advanced-reboot.py", line 1143, in handle_post_reboot_test_reports\n
self.assertTrue(is_good, errors)\nAssertionError: 
Something went wrong. Please check output below:
FAILED:dut:DUT hasn't shutdown in 300 seconds\n`

How did you do it?

Since the variable inside the inner function is not visible to the outer function, use function attribute for the shared variables. With this approach, the outer function can access the variable using inner function's name.

How did you verify/test it?

Executed a negative test (test_cancelled_warm_reboot), and script was modified during the test, and restored successfully after the test.

Any platform specific information?

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

Documentation

@vaibhavhd vaibhavhd requested a review from a team September 8, 2021 01:15
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Sep 8, 2021

This pull request fixes 1 alert when merging ad992c2 into 768b672 - view on LGTM.com

fixed alerts:

  • 1 for Unused local variable

Comment thread tests/platform_tests/verify_dut_health.py
@vaibhavhd
Copy link
Copy Markdown
Contributor Author

/Azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@vaibhavhd vaibhavhd merged commit 1f8cae2 into sonic-net:master Sep 9, 2021
@vaibhavhd vaibhavhd deleted the adv-reboot-fix branch September 9, 2021 01:47
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…negative test (sonic-net#4198)

Fix the restoration logic for fastboot and warmboot scripts after the negative cases modify them.
Warmboot SAD cases are failing in the nightly regression testing but not locally. This is caused by tests that precede the sad cases - test_cancelled_warm_reboot has incorrect restoration of reboot scripts inside DUT after negative cases modify the scripts.
Since the variable inside the inner function is not visible to the outer function, use function attribute for the shared variables. With this approach, the outer function can access the variable using inner function's name.
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…lly (#25384)

#### Why I did it
src/sonic-swss
```
* 1339028c - (HEAD -> 202511, origin/202511) [vnet/vxlan]: Handle SAI failures without crashing swss (sonic-net#4188) (28 hours ago) [mssonicbld]
* 8799eac7 - [DASH] Validate ca to pa SAI attributes (sonic-net#4202) (32 hours ago) [mssonicbld]
* 5db5395e - [tests]: Update SRv6 test cases to use static SID configuration CLI (sonic-net#4198) (34 hours ago) [Carmine Scarpitta]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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