|
|
b2d430 |
From 28db1765c40137e9452b4aa27281a1deb25d1d36 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 15:00:12 +0200
|
|
|
b2d430 |
Subject: [PATCH 134/135] TESTS: Add FQDN variants for some tests
|
|
|
b2d430 |
MIME-Version: 1.0
|
|
|
b2d430 |
Content-Type: text/plain; charset=UTF-8
|
|
|
b2d430 |
Content-Transfer-Encoding: 8bit
|
|
|
b2d430 |
|
|
|
b2d430 |
Adds FQDN variants of some already existing tests.
|
|
|
b2d430 |
|
|
|
b2d430 |
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
|
|
|
b2d430 |
---
|
|
|
b2d430 |
src/tests/intg/test_local_domain.py | 83 +++++++++++++++++++++++++++++++++++++
|
|
|
b2d430 |
1 file changed, 83 insertions(+)
|
|
|
b2d430 |
|
|
|
b2d430 |
diff --git a/src/tests/intg/test_local_domain.py b/src/tests/intg/test_local_domain.py
|
|
|
b2d430 |
index 5e3e3d4d1cdc6db5d68a6e5b9d96d94c2c694b14..b34e4a3d31cdbc1dc257d8fffcf0f5a07803b20c 100644
|
|
|
b2d430 |
--- a/src/tests/intg/test_local_domain.py
|
|
|
b2d430 |
+++ b/src/tests/intg/test_local_domain.py
|
|
|
b2d430 |
@@ -87,6 +87,27 @@ def local_domain_only(request):
|
|
|
b2d430 |
return None
|
|
|
b2d430 |
|
|
|
b2d430 |
|
|
|
b2d430 |
+@pytest.fixture
|
|
|
b2d430 |
+def local_domain_only_fqdn(request):
|
|
|
b2d430 |
+ conf = unindent("""\
|
|
|
b2d430 |
+ [sssd]
|
|
|
b2d430 |
+ domains = LOCAL
|
|
|
b2d430 |
+ services = nss
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ [nss]
|
|
|
b2d430 |
+ memcache_timeout = 0
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ [domain/LOCAL]
|
|
|
b2d430 |
+ id_provider = local
|
|
|
b2d430 |
+ min_id = 10000
|
|
|
b2d430 |
+ max_id = 20000
|
|
|
b2d430 |
+ use_fully_qualified_names = True
|
|
|
b2d430 |
+ """).format(**locals())
|
|
|
b2d430 |
+ create_conf_fixture(request, conf)
|
|
|
b2d430 |
+ create_sssd_fixture(request)
|
|
|
b2d430 |
+ return None
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+
|
|
|
b2d430 |
def assert_nonexistent_user(name):
|
|
|
b2d430 |
with pytest.raises(KeyError):
|
|
|
b2d430 |
pwd.getpwnam(name)
|
|
|
b2d430 |
@@ -169,3 +190,65 @@ def test_add_local_group_to_local_group(local_domain_only):
|
|
|
b2d430 |
"group_parent",
|
|
|
b2d430 |
dict(name="group_parent", passwd="*", gid=10008,
|
|
|
b2d430 |
mem=ent.contains_only("user_child")))
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+def test_sss_group_add_show_del_fqdn(local_domain_only_fqdn):
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+ Regression test for tickets
|
|
|
b2d430 |
+ https://fedorahosted.org/sssd/ticket/3173
|
|
|
b2d430 |
+ https://fedorahosted.org/sssd/ticket/3175
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ subprocess.check_call(["sss_groupadd", "foo@LOCAL", "-g", "10001"])
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ "This should not raise KeyError"
|
|
|
b2d430 |
+ ent.assert_group_by_name("foo@LOCAL", dict(name="foo@LOCAL", gid=10001))
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ "sss_grupshow should return 0 with existing group name"
|
|
|
b2d430 |
+ subprocess.check_call(["sss_groupshow", "foo@LOCAL"])
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ subprocess.check_call(["sss_groupdel", "foo@LOCAL"])
|
|
|
b2d430 |
+ assert_nonexistent_group("foo@LOCAL")
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+def test_add_local_user_to_local_group_fqdn(local_domain_only_fqdn):
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+ Regression test for ticket
|
|
|
b2d430 |
+ https://fedorahosted.org/sssd/ticket/3178
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_groupadd", "-g", "10009", "group10009@LOCAL"])
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_useradd", "-u", "10009", "-M", "user10009@LOCAL"])
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_usermod", "-a", "group10009@LOCAL", "user10009@LOCAL"])
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ ent.assert_group_by_name(
|
|
|
b2d430 |
+ "group10009@LOCAL",
|
|
|
b2d430 |
+ dict(name="group10009@LOCAL", passwd="*", gid=10009,
|
|
|
b2d430 |
+ mem=ent.contains_only("user10009@LOCAL")))
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+def test_add_local_group_to_local_group_fqdn(local_domain_only_fqdn):
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+ Regression test for tickets
|
|
|
b2d430 |
+ https://fedorahosted.org/sssd/ticket/3178
|
|
|
b2d430 |
+ """
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_groupadd", "-g", "10009", "group_child@LOCAL"])
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_useradd", "-u", "10009", "-M", "user_child@LOCAL"])
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_usermod", "-a", "group_child@LOCAL", "user_child@LOCAL"])
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_groupadd", "-g", "10008", "group_parent@LOCAL"])
|
|
|
b2d430 |
+ subprocess.check_call(
|
|
|
b2d430 |
+ ["sss_groupmod", "-a", "group_parent@LOCAL", "group_child@LOCAL"])
|
|
|
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@LOCAL",
|
|
|
b2d430 |
+ dict(name="group_parent@LOCAL", passwd="*", gid=10008,
|
|
|
b2d430 |
+ mem=ent.contains_only("user_child@LOCAL")))
|
|
|
b2d430 |
--
|
|
|
b2d430 |
2.7.4
|
|
|
b2d430 |
|