diff --git a/tests/integration_tests/modules/test_users_groups.py b/tests/integration_tests/modules/test_users_groups.py index 1ceb2587c99..7edb5956048 100644 --- a/tests/integration_tests/modules/test_users_groups.py +++ b/tests/integration_tests/modules/test_users_groups.py @@ -119,6 +119,10 @@ def test_users_groups(self, regex, getent_args, class_client): ) ) + @pytest.mark.skipif( + not IS_UBUNTU, + reason="Warning expectations are Ubuntu-specific", + ) def test_initial_warnings(self, class_client): """Check for initial warnings.""" warnings = ( @@ -138,6 +142,10 @@ def test_user_root_in_secret(self, class_client): groups = groups_str.split() assert "secret" in groups + @pytest.mark.skipif( + not IS_UBUNTU, + reason="Password unlock warning behavior differs across distros", + ) def test_nopassword_unlock_warnings(self, class_client): """Verify warnings for empty passwords for new and existing users.""" # Fake admin clearing and unlocking and empty unlocked password foobar @@ -165,8 +173,8 @@ def test_nopassword_unlock_warnings(self, class_client): @pytest.mark.user_data(USER_DATA) @pytest.mark.skipif( - CURRENT_RELEASE < JAMMY, - reason="Requires version of sudo not available in older releases", + IS_UBUNTU and CURRENT_RELEASE < JAMMY, + reason="Requires version of sudo not available in older Ubuntu releases", ) def test_sudoers_includedir(client: IntegrationInstance): """Ensure we don't add additional #includedir to sudoers.