Skip to content

Commit a02991c

Browse files
authored
Skip test_passwd_hardening in tests_mark_conditions.yaml (#6429)
What is the motivation for this PR? test_passw_hardening is unable to run on master image because sonic-net/sonic-buildimage#12138 hasn't been merged. But after running it on 202205 image which supports passw-harden(enabled in this PR sonic-net/sonic-buildimage#12025), found an issue and raised here #6428. I think that it's better to skip test case in tests_mark_conditions.yaml instead of in test script. How did you do it? Move skip condition to tests_mark_conditions.yaml Add an issue in skip condition. After it's been fixed, we can run this script. How did you verify/test it? Run passw_hardening/test_passw_hardening.py Signed-off-by: Zhaohui Sun <[email protected]>
1 parent c41f842 commit a02991c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

tests/common/plugins/conditional_mark/tests_mark_conditions.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,16 @@ ntp/test_ntp.py::test_ntp_long_jump_disabled:
417417
strict: True
418418
reason: "Known NTP bug"
419419

420+
#######################################
421+
##### passw_hardening #####
422+
#######################################
423+
passw_hardening/test_passw_hardening.py:
424+
skip:
425+
reason: "Password-hardening supported just in master version"
426+
conditions:
427+
- "release not in ['master']"
428+
- https://github.com/sonic-net/sonic-mgmt/issues/6428
429+
420430
#######################################
421431
##### pc #####
422432
#######################################

tests/passw_hardening/conftest.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ def set_default_passw_hardening_policies(duthosts, enum_rand_one_per_hwsku_hostn
1717

1818
test_passw_hardening.config_and_review_policies(duthost, passw_hardening_ob_dis, test_passw_hardening.PAM_PASSWORD_CONF_DEFAULT_EXPECTED)
1919

20-
@pytest.fixture(scope="module", autouse=True)
21-
def passw_version_required(duthosts, enum_rand_one_per_hwsku_hostname):
22-
duthost = duthosts[enum_rand_one_per_hwsku_hostname]
23-
if not "master" in duthost.os_version:
24-
pytest.skip("Password-hardening supported just in master version")
25-
2620
@pytest.fixture(scope="function")
2721
def clean_passw_policies(duthosts, enum_rand_one_per_hwsku_hostname):
2822
yield

0 commit comments

Comments
 (0)