From 545b627ac01c712a35c59335f1b39bee8c7b30cc Mon Sep 17 00:00:00 2001 From: William Brown Date: Nov 21 2017 16:06:51 +0000 Subject: Ticket 49298 - issue with test case and remove-ds.pl Bug Description: In some cases, the missing dse.ldif would cause remove ds.pl to fail. Fix Description: Move and restore the dse.ldif instead to allow the test to pass. https://pagure.io/389-ds-base/issue/49298 Author: wibrown Review by: vashirov (Thanks!) --- diff --git a/dirsrvtests/tests/suites/config/removed_config_49298_test.py b/dirsrvtests/tests/suites/config/removed_config_49298_test.py index e652369..7cf0f20 100644 --- a/dirsrvtests/tests/suites/config/removed_config_49298_test.py +++ b/dirsrvtests/tests/suites/config/removed_config_49298_test.py @@ -42,7 +42,8 @@ def test_restore_config(topo): for i in ('dse.ldif', 'dse.ldif.startOK'): p = os.path.join(dse_path, i) - os.remove(p) + d = os.path.join(dse_path, i + '.49298') + os.rename(p, d) # This will pass. topo.standalone.start() @@ -70,7 +71,8 @@ def test_removed_config(topo): for i in ('dse.ldif', 'dse.ldif.bak', 'dse.ldif.startOK'): p = os.path.join(dse_path, i) - os.remove(p) + d = os.path.join(dse_path, i + '.49298') + os.rename(p, d) # We actually can't check the log output, because it can't read dse.ldif, # don't know where to write it yet! All we want is the server fail to @@ -78,4 +80,9 @@ def test_removed_config(topo): with pytest.raises(subprocess.CalledProcessError): topo.standalone.start() + # Restore the files so that setup-ds.l can work + for i in ('dse.ldif', 'dse.ldif.bak', 'dse.ldif.startOK'): + p = os.path.join(dse_path, i) + d = os.path.join(dse_path, i + '.49298') + os.rename(d, p)