Skip to content

Commit

Permalink
Skip test_secure_upgrade.py if current image is not secured. (#9747)
Browse files Browse the repository at this point in the history
What I did:
Skip the test tests/platform_tests/test_secure_upgrade.py if the current install image is not secured image.

ADO: 24319390

How I verify:
Manually Run the test case on image having this change : sonic-net/sonic-buildimage#16191What I did:
Skip the test tests/platform_tests/test_secure_upgrade.py if the current install image is not secured image.

ADO: 24319390

How I verify:
Manually Run the test case on image having this change : sonic-net/sonic-buildimage#16191
  • Loading branch information
abdosi authored and mssonicbld committed Sep 15, 2023
1 parent 5ad945a commit d6d03c8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/platform_tests/test_secure_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def keep_same_version_installed(duthost):
pytest_assert(len(results) > 0, "Current image is empty!")
current_version = results[0]
yield
duthost.shell("sudo sonic-installer set-default {}", format(current_version))
duthost.shell("sudo sonic-installer set-default {}".format(current_version))


@pytest.fixture(scope='session')
Expand All @@ -55,6 +55,11 @@ def test_non_secure_boot_upgrade_failure(duthost, non_secure_image_path, tbinfo)
"""
@summary: This test case validates non successful upgrade of a given non secure image
"""
secure_boot_image = duthost.command("sonic-cfggen -y /etc/sonic/sonic_version.yml -v secure_boot_image")['stdout']

if secure_boot_image != 'yes':
pytest.skip("Current Image is not secured so skipping")

# install non secure image
logger.info("install non secure image - expect fail, image path = {}".format(non_secure_image_path))
result = "image install failure" # because we expect fail
Expand Down

0 comments on commit d6d03c8

Please sign in to comment.