Hi,

the following batch deals with the following:

* cleans up apache's semaphores prior to installing IPA (CA install can
get stuck when IPA is reinstalled many times)
* allows to pass extra arguments to install_client task
* uses trailing dot in the hostname as fqdn which should not be
overridden by domain name
* fixes incorrect assert for UIDs/GIDs in legacy client tests

-- 
Tomas Babej
Associate Software Engineer | Red Hat | Identity Management
RHCE | Brno Site | IRC: tbabej | freeipa.org 

>From 160b3d5937f45fb3ea1d932f3260be70126dd703 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Mon, 7 Apr 2014 12:40:52 +0200
Subject: [PATCH] ipatests: Fix apache semaphores prior to installing IPA
 server

---
 ipatests/test_integration/tasks.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index d03ee6021fb34f8292814b23ea4e8fdd4606a90b..de233a9394bc8ad416a46eefce81c4af6f96727f 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -110,6 +110,9 @@ def fix_resolv_conf(host):
     log.debug('Writing the following to /etc/resolv.conf:\n%s', contents)
     host.put_file_contents('/etc/resolv.conf', contents)
 
+def fix_apache_semaphores(master):
+    master.run_command('for line in `ipcs -s | grep apache | cut -d " " -f 2`; '
+                       'do ipcrm -s $line; done', raiseonerr=False)
 
 def unapply_fixes(host):
     restore_files(host)
@@ -179,6 +182,7 @@ def install_master(host):
     host.collect_log('/var/log/dirsrv/slapd-%s/access' % inst)
 
     apply_common_fixes(host)
+    fix_apache_semaphores(host)
 
     host.run_command(['ipa-server-install', '-U',
                       '-r', host.domain.name,
@@ -197,6 +201,7 @@ def install_replica(master, replica, setup_ca=True):
     replica.collect_log('/var/log/ipareplica-conncheck.log')
 
     apply_common_fixes(replica)
+    fix_apache_semaphores(replica)
 
     master.run_command(['ipa-replica-prepare',
                         '-p', replica.config.dirman_password,
-- 
1.8.5.3

>From 0393167680f96528d1bfffbb951e13c4fbb3f0f9 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Mon, 7 Apr 2014 13:36:10 +0200
Subject: [PATCH] ipatests: tasks: Accept extra arguments when installing
 client

---
 ipatests/test_integration/tasks.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index de233a9394bc8ad416a46eefce81c4af6f96727f..7632d7950be577d11dd7cf8c34374d4491519ecd 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -227,7 +227,7 @@ def install_replica(master, replica, setup_ca=True):
     kinit_admin(replica)
 
 
-def install_client(master, client):
+def install_client(master, client, extra_args=[]):
     client.collect_log('/var/log/ipaclient-install.log')
 
     apply_common_fixes(client)
@@ -237,7 +237,8 @@ def install_client(master, client):
                         '--realm', client.domain.realm,
                         '-p', client.config.admin_name,
                         '-w', client.config.admin_password,
-                        '--server', master.hostname])
+                        '--server', master.hostname]
+                        + extra_args)
 
     kinit_admin(client)
 
-- 
1.8.5.3

>From 3ffa1732b77484612282d8e1598317f172221ff1 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Mon, 7 Apr 2014 21:37:09 +0200
Subject: [PATCH] ipatests: Allow using FQDN with trailing dot as final
 hostname

When creating a BaseHost instance, the machine's hostname was
reconfigured to have the same shortname prepended the domain name
of the domain where it was defined.

However, it makes sense in certain use cases to define hosts
that have hostnames other than belonging directly in the domain
they were defined in.

Treat input hostnames with trailing dots as static FQDNs that
will not be changed by the name of the domain they were defined in.
---
 ipatests/test_integration/host.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ipatests/test_integration/host.py b/ipatests/test_integration/host.py
index a57e3763c53f5e2c7262e019259293d509624d02..94440c1875654a6866e25f173b27b9fedd5d5945 100644
--- a/ipatests/test_integration/host.py
+++ b/ipatests/test_integration/host.py
@@ -41,7 +41,11 @@ class BaseHost(object):
 
         shortname, dot, ext_domain = hostname.partition('.')
         self.shortname = shortname
-        self.hostname = str(shortname + '.' + self.domain.name)
+
+        self.hostname = (hostname[:-1]
+                         if hostname.endswith('.')
+                         else shortname + '.' + self.domain.name)
+
         self.external_hostname = str(external_hostname or hostname)
 
         self.netbios = self.domain.name.split('.')[0].upper()
-- 
1.8.5.3

>From d2d4a1a9819e8b68ba59344b5c86fa89f780ffb5 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 8 Apr 2014 08:31:58 +0200
Subject: [PATCH] ipatests: Fix incorrect UID/GID reference for subdomain users
 and groups

In legacy client integration test, the test cases that query information
from subdomain about subdomain users and group expected subdomain
users and groups to have the UIDs/GIDs as users and groups in the root
domain.
---
 ipatests/test_integration/test_legacy_clients.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/ipatests/test_integration/test_legacy_clients.py b/ipatests/test_integration/test_legacy_clients.py
index 170b0e2b0eeec8e7a70d2f60ec36660db9b60441..71b266a946bd1113710f3e4da9b4dd79cd051624 100644
--- a/ipatests/test_integration/test_legacy_clients.py
+++ b/ipatests/test_integration/test_legacy_clients.py
@@ -268,7 +268,8 @@ class BaseTestLegacyClient(object):
         testgroup = 'subdomaintestgroup@%s' % self.ad_subdomain
         result = self.legacy_client.run_command(['getent', 'group', testgroup])
 
-        testgroup_stdout = "%s:\*:%s:" % (testgroup, self.testuser_gid_regex)
+        testgroup_stdout = "%s:\*:%s:" % (testgroup,
+                                          self.subdomain_testuser_gid_regex)
         assert re.search(testgroup_stdout, result.stdout_text)
 
     def test_id_subdomain_ad_user(self):
@@ -285,9 +286,12 @@ class BaseTestLegacyClient(object):
         # testgroup
         group_name = '\(%s\)' % testgroup if self.posix_trust else ''
 
-        uid_regex = "uid=%s\(%s\)" % (self.testuser_uid_regex, testuser)
-        gid_regex = "gid=%s%s" % (self.testuser_gid_regex, group_name)
-        groups_regex = "groups=%s%s" % (self.testuser_gid_regex, group_name)
+        uid_regex = "uid=%s\(%s\)" % (self.subdomain_testuser_uid_regex,
+                                      testuser)
+        gid_regex = "gid=%s%s" % (self.subdomain_testuser_gid_regex,
+                                  group_name)
+        groups_regex = "groups=%s%s" % (self.subdomain_testuser_gid_regex,
+                                        group_name)
 
         assert re.search(uid_regex, result.stdout_text)
         assert re.search(gid_regex, result.stdout_text)
-- 
1.8.5.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to