diff --git a/tests/test_rwm.py b/tests/test_rwm.py index 70dd1603db941eef99eae5cf98e8cf9f64c65011..a351cced706e932f62c5b309daeac6ef1c97f333 100644 --- a/tests/test_rwm.py +++ b/tests/test_rwm.py @@ -133,7 +133,8 @@ def test_backup(tmpworkdir: str, motoserver: str): # pylint: disable=unused-arg }, "retention": { "keep-daily": "1" - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", }) Path("testdatadir").mkdir() @@ -164,7 +165,8 @@ def test_backup_excludes(tmpworkdir: str, motoserver: str): # pylint: disable=u "excludes": ["testdatadir/proc/*", "*.ignored"], "extras": ["--tag", "dummytag"], } - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", }) Path("testdatadir").mkdir() @@ -202,7 +204,8 @@ def test_backup_error_handling(tmpworkdir: str): # pylint: disable=unused-argum "restic_bucket": "restictest", "backups": { "dummycfg": {"filesdirs": ["dummydir"]} - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", } mock_true = Mock(return_value=True) @@ -275,7 +278,8 @@ def test_storage_delete(tmpworkdir: str, radosuser_admin: rwm.StorageManager): "restic_password": "dummydummydummydummy", "backups": { "testcfg": {"filesdirs": ["testdatadir/"]} - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", }) bucket_name = trwm.config.restic_bucket @@ -350,7 +354,8 @@ def test_storage_restore_state_restic(tmpworkdir: str, radosuser_admin: rwm.Stor "testcfg": { "filesdirs": ["testdatadir/"], } - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", }) # create and initialize storage @@ -394,7 +399,7 @@ def test_storage_restore_state_restic(tmpworkdir: str, radosuser_admin: rwm.Stor def test_locks(tmpworkdir: str): # pylint: disable=unused-argument """test LockManager""" - lock_path = "./test.lock" + lock_path = f"{tmpworkdir}/rwm.lock" locker1 = rwm.LockManager(lock_path) locker1.lock() diff --git a/tests/test_storage.py b/tests/test_storage.py index 3e08529065abad60e622bd0fbe443d0fd90e5cc4..90185b81b7494484175c4efaaf5c2a9e9e5e24ff 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -134,7 +134,8 @@ def test_storage_backup_usage( "restic_password": "dummydummydummydummy", "backups": { "dummy": {"filesdirs": ["testdir"]} - } + }, + "lock_path": f"{tmpworkdir}/rwm.lock", }) assert trwm.restic_cmd(["init"]).returncode == 0 assert trwm.backup("dummy") == 0