ldap/admin/src/defaults.inf.in | 3 +
2 files changed, 20 insertions(+), 39 deletions(-)
New commits:
commit 83a7705b432a55a648b07acb331d3d94afa4b3d7
Author: William Brown <firstyear@redhat.com>
Date: Wed Oct 12 16:51:17 2016 +1000
Ticket 49007 - Update DS basic test to better work with systemd.
Bug Description: The basic test used to assume certain systemd paths.
Fix Description: Because lib389 has picked up support for systemctl, we
can now call upon this in our tests.
https://fedorahosted.org/389/ticket/49007
Author: wibrown
Review by: mreynolds (Thanks!)
diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py
index 8b0ad9b..1033fd6 100644
--- a/dirsrvtests/tests/suites/basic/basic_test.py
+++ b/dirsrvtests/tests/suites/basic/basic_test.py
@@ -595,43 +595,26 @@ def test_basic_referrals(topology, import_example_ldif):
def test_basic_systemctl(topology, import_example_ldif):
- """Test systemctl can stop and start the server. Also test that start reports an
+ """Test systemctl/lib389 can stop and start the server. Also test that start reports an
error when the instance does not start. Only for RPM builds
"""
log.info('Running test_basic_systemctl...')
- # We can only use systemctl on RPM installations
- if topology.standalone.prefix and topology.standalone.prefix != '/':
- return
-
- data_dir = topology.standalone.getDir(__file__, DATA_DIR)
- tmp_dir = '/tmp'
- config_dir = topology.standalone.confdir
- start_ds = 'sudo systemctl start dirsrv@' + topology.standalone.serverid + '.service'
- stop_ds = 'sudo systemctl stop dirsrv@' + topology.standalone.serverid + '.service'
- is_running = 'sudo systemctl is-active dirsrv@' + topology.standalone.serverid + '.service'
+ config_dir = topology.standalone.get_config_dir()
#
# Stop the server
#
log.info('Stopping the server...')
- rc = os.system(stop_ds)
- log.info('Check the status...')
- if rc != 0 or os.system(is_running) == 0:
- log.fatal('test_basic_systemctl: Failed to stop the server')
- assert False
+ topology.standalone.stop()
log.info('Stopped the server.')
#
# Start the server
#
log.info('Starting the server...')
- rc = os.system(start_ds)
- log.info('Check the status...')
- if rc != 0 or os.system(is_running) != 0:
- log.fatal('test_basic_systemctl: Failed to start the server')
- assert False
+ topology.standalone.start()
log.info('Started the server.')
#
@@ -639,22 +622,21 @@ def test_basic_systemctl(topology, import_example_ldif):
# and verify that systemctl detects the failed start
#
log.info('Stopping the server...')
- rc = os.system(stop_ds)
- log.info('Check the status...')
- if rc != 0 or os.system(is_running) == 0:
- log.fatal('test_basic_systemctl: Failed to stop the server')
- assert False
+ topology.standalone.stop()
log.info('Stopped the server before breaking the dse.ldif.')
- shutil.copy(config_dir + '/dse.ldif', tmp_dir)
- shutil.copy(data_dir + 'basic/dse.ldif.broken', config_dir + '/dse.ldif')
+ shutil.copy(config_dir + '/dse.ldif', config_dir + '/dse.ldif.correct' )
+ open(config_dir + '/dse.ldif', 'w').close()
+ # We need to kill the .bak file too, DS is just too smart!
+ open(config_dir + '/dse.ldif.bak', 'w').close()
log.info('Attempting to start the server with broken dse.ldif...')
- rc = os.system(start_ds)
+ try:
+ topology.standalone.start()
+ except:
+ log.info('Server failed to start as expected')
log.info('Check the status...')
- if rc == 0 or os.system(is_running) == 0:
- log.fatal('test_basic_systemctl: The server incorrectly started')
- assert False
+ assert(not topology.standalone.status())
log.info('Server failed to start as expected')
time.sleep(5)
@@ -662,16 +644,12 @@ def test_basic_systemctl(topology, import_example_ldif):
# Fix the dse.ldif, and make sure the server starts up,
# and systemctl correctly identifies the successful start
#
- shutil.copy(tmp_dir + '/dse.ldif', config_dir)
+ shutil.copy(config_dir + '/dse.ldif.correct', config_dir + '/dse.ldif' )
log.info('Starting the server with good dse.ldif...')
- rc = os.system(start_ds)
- time.sleep(5)
+ topology.standalone.start()
log.info('Check the status...')
- if rc != 0 or os.system(is_running) != 0:
- log.fatal('test_basic_systemctl: Failed to start the server')
- assert False
+ assert(topology.standalone.status())
log.info('Server started after fixing dse.ldif.')
- time.sleep(1)
log.info('test_basic_systemctl: PASSED')
diff --git a/ldap/admin/src/defaults.inf.in b/ldap/admin/src/defaults.inf.in
index 80d1596..c0469b3 100644
--- a/ldap/admin/src/defaults.inf.in
+++ b/ldap/admin/src/defaults.inf.in
@@ -46,6 +46,9 @@ cert_dir = @instconfigdir@/slapd-{instance_name}
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
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
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
No comments:
Post a Comment