diff options
author | Majiir Paktu <majiir@nabaal.net> | 2023-10-09 22:54:22 -0400 |
---|---|---|
committer | Majiir Paktu <majiir@nabaal.net> | 2023-10-10 21:11:35 -0400 |
commit | 43f7cb4a95436d58a0fe40ff501d42085d676691 (patch) | |
tree | 41bed353d31be6df4107e6c16047b6da9770cc1a /nixos/tests/pam | |
parent | 077cdcc7e9a9ed406860e97ce3590fba15aed18b (diff) |
nixos/pam: add order comment to each rule line
Diffstat (limited to 'nixos/tests/pam')
-rw-r--r-- | nixos/tests/pam/test_chfn.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/tests/pam/test_chfn.py b/nixos/tests/pam/test_chfn.py index 4fd33447a5433..3cfbb3908e9d2 100644 --- a/nixos/tests/pam/test_chfn.py +++ b/nixos/tests/pam/test_chfn.py @@ -15,9 +15,10 @@ expected_lines = { } actual_lines = set(machine.succeed("cat /etc/pam.d/chfn").splitlines()) -missing_lines = expected_lines - actual_lines -extra_lines = actual_lines - expected_lines -non_functional_lines = set([line for line in extra_lines if (line == "" or line.startswith("#"))]) +stripped_lines = set([line.split("#")[0].rstrip() for line in actual_lines]) +missing_lines = expected_lines - stripped_lines +extra_lines = stripped_lines - expected_lines +non_functional_lines = set([line for line in extra_lines if line == ""]) unexpected_functional_lines = extra_lines - non_functional_lines with subtest("All expected lines are in the file"): |