From: Serge Hallyn Date: Thu, 22 May 2025 11:27:11 +0000 (-0500) Subject: Revert "tests/: extend basic usermod test" X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=da2a061b52a1c5a4ef6b8ae2e72b159cc7786702;p=thirdparty%2Fshadow.git Revert "tests/: extend basic usermod test" This reverts commit 1791d8a638fbd4d9a4fc6dc6043c764c6f997f82. --- diff --git a/tests/system/tests/test_usermod.py b/tests/system/tests/test_usermod.py index f1ba8c689..2b42363e9 100644 --- a/tests/system/tests/test_usermod.py +++ b/tests/system/tests/test_usermod.py @@ -18,39 +18,26 @@ def test_usermod__rename_user(shadow: Shadow): 1. Create user 2. Rename user :steps: - 1. Check passwd entry - 2. Check shadow entry - 3. Check group entry - 4. Check gshadow entry - 5. Check home folder + 1. User exists with new name and GID is 1000 + 2. Group exists and GID is 1000 + 3. Home folder exists :expectedresults: - 1. passwd entry for the user exists and the attributes are correct - 2. shadow entry for the user exists and the attributes are correct - 3. group entry for the user exists and the attributes are correct - 4. gshadow entry for the user exists and the attributes are correct - 5. Home folder exists + 1. User is found and UID matches + 2. Group is found and GID matches + 3. Home folder is found :customerscenario: False """ shadow.useradd("tuser1") shadow.usermod("-l tuser2 tuser1") - result = shadow.tools.getent.passwd("tuser2") + result = shadow.tools.id("tuser2") assert result is not None, "User should be found" - assert result.name == "tuser2", "Incorrect username" - assert result.uid == 1000, "Incorrect UID" - - result = shadow.tools.getent.shadow("tuser2") - assert result is not None, "User should be found" - assert result.name == "tuser2", "Incorrect username" + assert result.user.name == "tuser2", "Incorrect username" + assert result.user.id == 1000, "Incorrect UID" result = shadow.tools.getent.group("tuser1") assert result is not None, "Group should be found" assert result.name == "tuser1", "Incorrect groupname" assert result.gid == 1000, "Incorrect GID" - if shadow.host.features["gshadow"]: - result = shadow.tools.getent.gshadow("tuser1") - assert result is not None, "User should be found" - assert result.name == "tuser1", "Incorrect username" - assert shadow.fs.exists("/home/tuser1"), "Home folder should be found"