]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Tests: Verify user creation fails when UID exceeds maximum allowed value (2^32 - 1)
authoraborah-sudo <aborah@redhat.com>
Wed, 8 Apr 2026 11:37:22 +0000 (17:07 +0530)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Fri, 10 Apr 2026 08:55:43 +0000 (10:55 +0200)
This is the transformation to Python of the test located in
`tests/usertools/01/26_useradd_UID_-1.test`
which checks that `useradd` can not add a new user with specific uid

tests/system/tests/test_useradd.py

index 2b9288d07ea7b8e3326ac57a0ae17c57902e10fc..9754c330d6b2b8df00fb80c4a98d357d681e3758 100644 (file)
@@ -421,6 +421,7 @@ def test_useradd__valid_group_as_primary(shadow: Shadow, group_name: str, group_
     "uid_value, expected_error",
     [
         pytest.param(-1, "useradd: invalid user ID '-1'", id="negative_uid"),
+        pytest.param(4294967295, "useradd: invalid user ID '4294967295'", id="exceeds_maximum_uid"),
         pytest.param(4294967296, "useradd: invalid user ID '4294967296'", id="out_of_range_uid"),
     ],
 )