]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
tests: basic group deletion
authorIker Pedrosa <ipedrosa@redhat.com>
Wed, 20 Nov 2024 09:41:10 +0000 (10:41 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 11 Jan 2025 02:21:07 +0000 (20:21 -0600)
This is the transformation to Python of the test located in
`tests/grouptools/groupdel/01_groupdel_delete_group/groupdel.test`,
which checks that `groupdel` is able to delete a group.

Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
tests/system/tests/test_groupdel.py [new file with mode: 0644]

diff --git a/tests/system/tests/test_groupdel.py b/tests/system/tests/test_groupdel.py
new file mode 100644 (file)
index 0000000..90684ac
--- /dev/null
@@ -0,0 +1,30 @@
+"""
+Test groupdel
+"""
+
+from __future__ import annotations
+
+import pytest
+
+from framework.roles.shadow import Shadow
+from framework.topology import KnownTopology
+
+
+@pytest.mark.topology(KnownTopology.Shadow)
+def test_groupdel__delete_group(shadow: Shadow):
+    """
+    :title: Basic group deletion
+    :setup:
+        1. Create group
+        2. Delete group
+    :steps:
+        1. Group doesn't exist
+    :expectedresults:
+        1. Group is not found
+    :customerscenario: False
+    """
+    shadow.groupadd("tgroup")
+    shadow.groupdel("tgroup")
+
+    result = shadow.tools.getent.group("tgroup")
+    assert result is None, "Group should not be found"