Bladeren bron

Ticket 48832 - CI Tests - make tests more portable

Description:  This patch addresses some portability issues with the CI tests.
              In some cases the amchine just runs too slow, so we need to
              increase sleep intervals, and in other cases we need to get
              the proper host name.

https://fedorahosted.org/389/ticket/48832

Reviewed by: spichugi (Thanks!)
Mark Reynolds 9 jaren geleden
bovenliggende
commit
724adba659

+ 10 - 1
dirsrvtests/tests/suites/rootdn_plugin/rootdn_plugin_test.py

@@ -381,6 +381,9 @@ def test_rootdn_access_denied_host(topology):
         topology.standalone.modify_s(PLUGIN_DN, [(ldap.MOD_ADD,
                                                   'rootdn-deny-host',
                                                   hostname)])
+        topology.standalone.modify_s(PLUGIN_DN, [(ldap.MOD_ADD,
+                                                  'rootdn-deny-host',
+                                                  'localhost')])
     except ldap.LDAPError as e:
         log.fatal('test_rootdn_access_denied_host: Failed to set deny host: error ' +
                   e.message['desc'])
@@ -555,8 +558,14 @@ def test_rootdn_access_allowed_host(topology):
         log.fatal('test_rootdn_access_allowed_host: : failed to bind as user1')
         assert False
 
+    hostname = socket.gethostname()
     try:
-        topology.standalone.modify_s(PLUGIN_DN, [(ldap.MOD_ADD, 'rootdn-allow-host', 'localhost.localdomain')])
+        topology.standalone.modify_s(PLUGIN_DN, [(ldap.MOD_ADD,
+                                                  'rootdn-allow-host',
+                                                  'localhost')])
+        topology.standalone.modify_s(PLUGIN_DN, [(ldap.MOD_ADD,
+                                                  'rootdn-allow-host',
+                                                  hostname)])
     except ldap.LDAPError as e:
         log.fatal('test_rootdn_access_allowed_host: Failed to set allowed host: error ' +
                   e.message['desc'])

+ 2 - 2
dirsrvtests/tests/tickets/ticket47462_test.py

@@ -267,8 +267,8 @@ def test_ticket47462(topology):
     # Run the upgrade...
     #
     topology.master1.upgrade('online')
-    topology.master1.restart(timeout=10)
-    topology.master2.restart(timeout=10)
+    topology.master1.restart()
+    topology.master2.restart()
 
     #
     # Check that the restart converted existing DES credentials

+ 0 - 2
dirsrvtests/tests/tickets/ticket47823_test.py

@@ -67,8 +67,6 @@ def topology(request):
     '''
     global installation_prefix
 
-
-
     standalone = DirSrv(verbose=False)
     if installation_prefix:
         args_instance[SER_DEPLOYED_DIR] = installation_prefix

+ 8 - 1
dirsrvtests/tests/tickets/ticket47838_test.py

@@ -34,8 +34,12 @@ plus_all_dcount = 0
 plus_all_ecount_noweak = 0
 plus_all_dcount_noweak = 0
 
+# Cipher counts tend to change with each new verson of NSS
 nss_version = ''
 NSS320 = '3.20.0'
+NSS321 = '3.21.0'  # RHEL6
+NSS323 = '3.23.0'  # F22
+NSS325 = '3.25.0'  # F23/F24
 
 
 class TopologyStandalone(object):
@@ -368,7 +372,10 @@ def _47838_run_4(topology):
     log.info("Disabled ciphers: %d" % dcount)
     global plus_all_ecount
     global plus_all_dcount
-    assert ecount == 23
+    if nss_version >= NSS323:
+        assert ecount == 23
+    else:
+        assert ecount == 20
     assert dcount == (plus_all_ecount + plus_all_dcount - ecount)
     weak = os.popen('egrep "SSL alert:" %s | egrep \": enabled\" | egrep "WEAK CIPHER" | wc -l' % topology.standalone.errlog)
     wcount = int(weak.readline().rstrip())

+ 1 - 1
dirsrvtests/tests/tickets/ticket48784_test.py

@@ -393,7 +393,7 @@ def test_ticket48784(topology):
     add_entry(topology.master1, 'master1', 'uid=m1user', 0, 5)
     add_entry(topology.master2, 'master2', 'uid=m2user', 0, 5)
 
-    time.sleep(1)
+    time.sleep(10)
 
     log.info('##### Searching for entries on master1...')
     entries = topology.master1.search_s(DEFAULT_SUFFIX, ldap.SCOPE_SUBTREE, '(uid=*)')