Skip to content

Commit f504f8f

Browse files
abdosiAharonMalkin
authored andcommitted
Skip test_secure_upgrade.py if current image is not secured. (sonic-net#9747)
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
1 parent 14e0ec1 commit f504f8f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/platform_tests/test_secure_upgrade.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def keep_same_version_installed(duthost):
3838
pytest_assert(len(results) > 0, "Current image is empty!")
3939
current_version = results[0]
4040
yield
41-
duthost.shell("sudo sonic-installer set-default {}", format(current_version))
41+
duthost.shell("sudo sonic-installer set-default {}".format(current_version))
4242

4343

4444
@pytest.fixture(scope='session')
@@ -55,6 +55,11 @@ def test_non_secure_boot_upgrade_failure(duthost, non_secure_image_path, tbinfo)
5555
"""
5656
@summary: This test case validates non successful upgrade of a given non secure image
5757
"""
58+
secure_boot_image = duthost.command("sonic-cfggen -y /etc/sonic/sonic_version.yml -v secure_boot_image")['stdout']
59+
60+
if secure_boot_image != 'yes':
61+
pytest.skip("Current Image is not secured so skipping")
62+
5863
# install non secure image
5964
logger.info("install non secure image - expect fail, image path = {}".format(non_secure_image_path))
6065
result = "image install failure" # because we expect fail

0 commit comments

Comments
 (0)