dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0132-TESTS-Test-for-sss_user-groupmod-a.patch

b2d430
From 2eb23ddb5f03a71a329bf4874194455ff87e1806 Mon Sep 17 00:00:00 2001
b2d430
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
b2d430
Date: Wed, 7 Sep 2016 13:08:59 +0200
b2d430
Subject: [PATCH 132/135] TESTS: Test for sss_user/groupmod -a
b2d430
MIME-Version: 1.0
b2d430
Content-Type: text/plain; charset=UTF-8
b2d430
Content-Transfer-Encoding: 8bit
b2d430
b2d430
Regression tests for ticket #3178.
b2d430
b2d430
Resolves:
b2d430
https://fedorahosted.org/sssd/ticket/3178
b2d430
b2d430
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
b2d430
(cherry picked from commit 7fa4964d84f41bd80a6d971ffaeef87a7c2f19be)
b2d430
---
b2d430
 src/tests/intg/test_local_domain.py | 36 ++++++++++++++++++++++++++++++++++++
b2d430
 1 file changed, 36 insertions(+)
b2d430
b2d430
diff --git a/src/tests/intg/test_local_domain.py b/src/tests/intg/test_local_domain.py
b2d430
index 56e3812b113b36301d1ec6049e5a1210d3070442..5e3e3d4d1cdc6db5d68a6e5b9d96d94c2c694b14 100644
b2d430
--- a/src/tests/intg/test_local_domain.py
b2d430
+++ b/src/tests/intg/test_local_domain.py
b2d430
@@ -133,3 +133,39 @@ def test_sss_group_add_show_del(local_domain_only):
b2d430
 
b2d430
     subprocess.check_call(["sss_groupdel", "foo"])
b2d430
     assert_nonexistent_group("foo")
b2d430
+
b2d430
+
b2d430
+def test_add_local_user_to_local_group(local_domain_only):
b2d430
+    """
b2d430
+    Regression test for ticket
b2d430
+    https://fedorahosted.org/sssd/ticket/3178
b2d430
+    """
b2d430
+    subprocess.check_call(["sss_groupadd", "-g", "10009", "group10009"])
b2d430
+    subprocess.check_call(["sss_useradd", "-u", "10009", "-M", "user10009"])
b2d430
+    subprocess.check_call(["sss_usermod", "-a", "group10009", "user10009"])
b2d430
+
b2d430
+    ent.assert_group_by_name(
b2d430
+        "group10009",
b2d430
+        dict(name="group10009", passwd="*", gid=10009,
b2d430
+             mem=ent.contains_only("user10009")))
b2d430
+
b2d430
+
b2d430
+def test_add_local_group_to_local_group(local_domain_only):
b2d430
+    """
b2d430
+    Regression test for tickets
b2d430
+    https://fedorahosted.org/sssd/ticket/3178
b2d430
+    """
b2d430
+    subprocess.check_call(["sss_groupadd", "-g", "10009", "group_child"])
b2d430
+    subprocess.check_call(["sss_useradd", "-u", "10009", "-M", "user_child"])
b2d430
+    subprocess.check_call(["sss_usermod", "-a", "group_child", "user_child"])
b2d430
+
b2d430
+    subprocess.check_call(["sss_groupadd", "-g", "10008", "group_parent"])
b2d430
+    subprocess.check_call(
b2d430
+        ["sss_groupmod", "-a", "group_parent", "group_child"])
b2d430
+
b2d430
+    # User from child_group is member of parent_group, so child_group's
b2d430
+    # member must be also parent_group's member
b2d430
+    ent.assert_group_by_name(
b2d430
+        "group_parent",
b2d430
+        dict(name="group_parent", passwd="*", gid=10008,
b2d430
+             mem=ent.contains_only("user_child")))
b2d430
-- 
b2d430
2.7.4
b2d430