-
Notifications
You must be signed in to change notification settings - Fork 1k
[upgrade_path]Bug fix in test_upgrade_path #2230
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,9 +11,13 @@ | |
|
|
||
| from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # lgtm[py/unused-import] | ||
| from tests.common.fixtures.ptfhost_utils import change_mac_addresses # lgtm[py/unused-import] | ||
| from tests.common.fixtures.ptfhost_utils import remove_ip_addresses # lgtm[py/unused-import] | ||
| from tests.common.fixtures.ptfhost_utils import copy_arp_responder_py # lgtm[py/unused-import] | ||
|
|
||
| pytestmark = [ | ||
| pytest.mark.topology('any') | ||
| pytest.mark.topology('any'), | ||
| pytest.mark.sanity_check(skip_sanity=True), | ||
| pytest.mark.disable_loganalyzer | ||
| ] | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
@@ -49,9 +53,6 @@ def cleanup(localhost, ptfhost, duthost, upgrade_path_lists): | |
|
|
||
| def prepare_ptf(ptfhost, duthost): | ||
| logger.info("Preparing ptfhost") | ||
| ptfhost.script("./scripts/remove_ip.sh") | ||
| ptfhost.copy(src="../ansible/roles/test/files/helpers/arp_responder.py", | ||
| dest="/opt") | ||
|
|
||
| # Prapare vlan conf file | ||
| mg_facts = duthost.minigraph_facts(host=duthost.hostname)['ansible_facts'] | ||
|
|
@@ -80,7 +81,7 @@ def prepare_ptf(ptfhost, duthost): | |
|
|
||
|
|
||
| @pytest.fixture(scope="module") | ||
| def ptf_params(duthost, nbrhosts): | ||
| def ptf_params(duthost, nbrhosts, creds): | ||
|
|
||
| mg_facts = duthost.minigraph_facts(host=duthost.hostname)['ansible_facts'] | ||
| lo_v6_prefix = "" | ||
|
|
@@ -96,14 +97,10 @@ def ptf_params(duthost, nbrhosts): | |
| #TODO:Update to vm_hosts.append(value['host'].host.mgmt_ip) | ||
| vm_hosts.append(value['host'].host.options['inventory_manager'].get_host(value['host'].hostname).vars['ansible_host']) | ||
|
|
||
| hostVars = duthost.host.options['variable_manager']._hostvars[duthost.hostname] | ||
| inventory = hostVars['inventory_file'].split('/')[-1] | ||
| secrets = duthost.host.options['variable_manager']._hostvars[duthost.hostname]['secret_group_vars'] | ||
|
|
||
| ptf_params = { | ||
| "verbose": False, | ||
| "dut_username": secrets[inventory]['sonicadmin_user'], | ||
| "dut_password": secrets[inventory]['sonicadmin_password'], | ||
| "dut_username": creds.get('sonicadmin_user'), | ||
| "dut_password": creds.get('sonicadmin_password'), | ||
| "dut_hostname": duthost.host.options['inventory_manager'].get_host(duthost.hostname).vars['ansible_host'], | ||
| "reboot_limit_in_seconds": 30, | ||
| "reboot_type": "warm-reboot", | ||
|
|
@@ -161,6 +158,6 @@ def test_upgrade_path(localhost, duthost, ptfhost, upgrade_path_lists, ptf_param | |
| platform_dir="ptftests", | ||
| params=test_params, | ||
| platform="remote", | ||
| qlen=1000, | ||
| qlen=10000, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure about that. We need to run test_advanced_reboot and check the ptf log. There will be a debug log in ptf log |
||
| log_file=log_file) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Minor concern in moving
check_sonic_version_after_reboottowards the end is that even if upgrade fails now the health checks will be performed.Earlier if the upgrade failure was seen
thread.interrupt_main()was called and it would crash the main thread, skipping all the checks which are unnecessary if the upgrade itself has failed.May be adding
check_sonic_version_after_rebootright afterself.wait_until_reboot()and before health_checks will be better?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.
It's a good suggestion. But I don't think checking sonic version right after
wait_until_rebootis reliable. Thewait_until_rebootonly confirms the DUT is down, but we are not sure if it's up. So I place the check just at the very end of the test.