浏览代码

Ticket 49024 - Fix CI test failures and defaults.inf

Description: Fix error_log path in the defaults.inf file.
Ticket 1347760 - set access_log path properly.
pwdPolicy_warning_test - replace a month with 30 day,
because it will cause large test time execution in the end of
a month, when next month has less days then the current.

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

Reviewed by: nhosoi, wbrown (Thanks!)
Simon Pichugin 9 年之前
父节点
当前提交
299169ecbd

+ 2 - 2
dirsrvtests/tests/suites/password/pwdPolicy_warning_test.py

@@ -442,7 +442,7 @@ def test_with_different_password_states(topology, global_policy, add_user):
     try:
         log.info("Expiring user's password by moving the"\
                  " system date past the valid period")
-        subprocess.check_call(['/usr/bin/date', '-s', 'next month'])
+        subprocess.check_call(['/usr/bin/date', '-s', '+30 day'])
 
         log.info('Wait for the server to pick up new date')
         time.sleep(5)
@@ -455,7 +455,7 @@ def test_with_different_password_states(topology, global_policy, add_user):
         log.info("Bind Failed, error: {:s}".format(str(ex)))
 
         log.info("Resetting the system date")
-        subprocess.check_call(['/usr/bin/date', '-s', 'last month'])
+        subprocess.check_call(['/usr/bin/date', '-s', '-30 day'])
 
         log.info('Wait for the server to pick up new date')
         time.sleep(5)

+ 6 - 6
dirsrvtests/tests/tickets/ticket1347760_test.py

@@ -13,6 +13,7 @@ import logging
 import pytest
 from subprocess import Popen
 from lib389 import DirSrv, Entry
+from lib389.paths import Paths
 from lib389._constants import *
 from lib389.properties import *
 from lib389.tasks import *
@@ -38,11 +39,6 @@ BOGUSSUFFIX = 'uid=bogus,ou=people,dc=bogus'
 GROUPOU = 'ou=groups,%s' % DEFAULT_SUFFIX
 BOGUSOU = 'ou=OU,%s' % DEFAULT_SUFFIX
 
-logging.getLogger(__name__).setLevel(logging.DEBUG)
-log = logging.getLogger(__name__)
-
-installation1_prefix = None
-
 
 class TopologyStandalone(object):
     def __init__(self, standalone):
@@ -224,6 +220,11 @@ def test_ticket1347760(topology):
     log.info('Deleting aci in %s.' % DEFAULT_SUFFIX)
     topology.standalone.modify_s(DEFAULT_SUFFIX, [(ldap.MOD_DELETE, 'aci', None)])
 
+    log.info('While binding as DM, acquire an access log path')
+    ds_paths = Paths(serverid=topology.standalone.serverid,
+                     instance=topology.standalone)
+    file_path = ds_paths.access_log
+
     log.info('Bind case 1. the bind user has no rights to read the entry itself, bind should be successful.')
     log.info('Bind as {%s,%s} who has no access rights.' % (BINDDN, BINDPW))
     try:
@@ -232,7 +233,6 @@ def test_ticket1347760(topology):
         log.info('Desc ' + e.message['desc'])
         assert False
 
-    file_path = os.path.join(topology.standalone.prefix, 'var/log/dirsrv/slapd-%s/access' % topology.standalone.serverid)
     file_obj = open(file_path, "r")
     log.info('Access log path: %s' % file_path)
 

+ 1 - 1
ldap/admin/src/defaults.inf.in

@@ -48,7 +48,7 @@ lock_dir = @localstatedir@/lock/dirsrv/slapd-{instance_name}
 log_dir = @localstatedir@/log/dirsrv/slapd-{instance_name}
 access_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/access
 audit_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/audit
-error_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/error
+error_log = @localstatedir@/log/dirsrv/slapd-{instance_name}/errors
 inst_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}
 db_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/db
 backup_dir = @localstatedir@/lib/dirsrv/slapd-{instance_name}/bak