Commit 4f3391d2 authored by Nicolas Wavrant's avatar Nicolas Wavrant

fixup

parent 2b3b9318
......@@ -191,8 +191,7 @@ def writeSignatureFile(slappart_signature_method_dict, runner_working_path, sign
def backupFilesWereModifiedDuringExport(export_start_date):
export_time = (datetime.now() - export_start_date).total_seconds()
time.sleep(1)
process = subprocess.Popen(['find', '-cmin', str(export_time / 60.), '-type', 'f', '!', '-path', '*/srv/backup/*'], stdout=subprocess.PIPE)
process = subprocess.Popen(['find', '-cmin', str(export_time / 60.), '-type', 'f', '-path', '*/srv/backup/*'], stdout=subprocess.PIPE)
process.wait()
if process.stdout.read():
return True
......
......@@ -78,7 +78,7 @@ class TestRunnerExporter(unittest.TestCase):
os.makedirs('instance/slappart0/srv/backup')
os.makedirs('instance/slappart1/etc')
os.makedirs('instance/slappart1/srv')
os.makedirs('instance/slappart1/srv/backup')
self._createFile('instance/slappart0/.installed.cfg', tested_instance_cfg)
......@@ -207,3 +207,5 @@ class TestRunnerExporter(unittest.TestCase):
self.assertTrue(runner_exporter.backupFilesWereModifiedDuringExport(datetime.now() + timedelta(seconds=-5)))
time.sleep(2)
self.assertFalse(runner_exporter.backupFilesWereModifiedDuringExport(datetime.now() + timedelta(seconds=-1)))
self._createFile('slappart1/srv/backup/bakckup.data', 'my backup')
self.assertTrue(runner_exporter.backupFilesWereModifiedDuringExport(datetime.now() + timedelta(seconds=-1)))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment