Skip to content
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

Add new test case for container based warm restart #6054

Merged
merged 6 commits into from
Aug 25, 2022

Conversation

Junchao-Mellanox
Copy link
Contributor

Description of PR

Summary:
Add new test case for container based warm restart

Type of change

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

Back port request

  • 201911
  • 202012

Approach

What is the motivation for this PR?

Add new test case for container based warm restart

How did you do it?

Added a new test case test_advanced_reboot::test_service_warm_restart.

  1. This test tries to run warm restart for each service in FEATURE table.
  2. If a URL is provided by CLI option "--new_docker_image", the test case will try download new docker image from the URL and do in service warm upgrade.
  3. The new test case reused the advanced-reboot infrastructure in sonic-mgmt and added some special logic for container based warm restart

How did you verify/test it?

Run the test case

Any platform specific information?

N/A

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

t0

Documentation

Change-Id: Ic30e2a2d6d567ea1ee2869e0c07e394f1524c326
Change-Id: I7721bcf1e72bd95f866226860b80b17c33380063
Change-Id: I34383bdf4ce7b658c71a9488ab077e787f6cccd0
stepanblyschak
stepanblyschak previously approved these changes Jul 27, 2022
@lgtm-com
Copy link

lgtm-com bot commented Jul 27, 2022

This pull request introduces 4 alerts when merging 4c8f3b0 into c7d1948 - view on LGTM.com

new alerts:

  • 4 for Unused import

Change-Id: Iad3b9ff11c86f48e5cf8c7c5a182e0356586aab2
@Junchao-Mellanox
Copy link
Contributor Author

/easycla

@liat-grozovik
Copy link
Collaborator

@stepanblyschak , @yxieca please help to review

@liat-grozovik
Copy link
Collaborator

@yxieca could you please help to review or assing someone?
@roysr-nv please review

@vaibhavhd
Copy link
Contributor

Ack. I am reviewing this PR now.

@@ -658,7 +727,13 @@ def tearDown(self):
self.__runScript([self.postRebootCheckScript], self.duthost)

if not self.stayInTargetImage:
self.__restorePrevImage()
logger.info('Restoring previous image')
Copy link
Contributor

Choose a reason for hiding this comment

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

stay_in_target_image arg is by default set to true. I think it would be better to always revert the device back to pretest state. Otherwise it can impact subsequent testcases that might run in long running regression tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stay_in_target_image is a flag specified by user. I agree with you that the default value should be false, however, I am not sure if we should change the default behavior here. Because the test case is already running on regression system, vendors may not expect to have the default behavior changed.

self.dut_connection.execCommand('docker exec -i bgp pkill -9 zebra')
self.dut_connection.execCommand('docker exec -i bgp pkill -9 bgpd')
elif service_name == 'teamd':
self.dut_connection.execCommand('docker exec -i teamd pkill -USR1 teamd > /dev/null')
Copy link
Contributor

Choose a reason for hiding this comment

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

What about syncd warm restart? In which case, there needs to be syncd preshutdown?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I know, syncd warm restart is not supported.

Copy link
Contributor

@vaibhavhd vaibhavhd left a comment

Choose a reason for hiding this comment

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

Minor comments added.

Change-Id: I7b2ef8f6cd249b7c870fc5d9fc5fbe80bbb41e01
@lgtm-com
Copy link

lgtm-com bot commented Aug 15, 2022

This pull request introduces 1 alert when merging 99a87c3 into 2e40f50 - view on LGTM.com

new alerts:

  • 1 for Unused import

@Junchao-Mellanox
Copy link
Contributor Author

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Contributor Author

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Contributor Author

/azpw run Azure.sonic-mgmt

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Azure.sonic-mgmt

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Junchao-Mellanox
Copy link
Contributor Author

Hi @vaibhavhd, could you please review and sign-off?

@liat-grozovik
Copy link
Collaborator

@vaibhavhd any further open issues or can you approve?

@vaibhavhd vaibhavhd merged commit 9b5a439 into sonic-net:master Aug 25, 2022
allen-xf pushed a commit to allen-xf/sonic-mgmt that referenced this pull request Oct 28, 2022
Added a new test case test_advanced_reboot::test_service_warm_restart.

This test tries to run warm restart for each service in FEATURE table.
If a URL is provided by CLI option "--new_docker_image", the test case will try download new docker image from the URL and do in service warm upgrade.

The new test case reused the advanced-reboot infrastructure in sonic-mgmt and added some special logic for container based warm restart
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.

5 participants