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

[action] [PR:9747] Skip test_secure_upgrade.py if current image is not secured. #10003

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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