Browse Source

tests/storage: don't fail the test when directory already exists

/var/tmp/test-pool should normally be removed by previous test cleanup,
but do not fail next test if it wasn't.
Marek Marczykowski-Górecki 6 years ago
parent
commit
4b51c9da07
1 changed files with 4 additions and 2 deletions
  1. 4 2
      qubes/tests/integ/storage.py

+ 4 - 2
qubes/tests/integ/storage.py

@@ -288,8 +288,10 @@ class StorageFile(StorageTestMixin, qubes.tests.SystemTestCase):
         self.dir_path = '/var/tmp/test-pool'
         self.pool = self.app.add_pool(dir_path=self.dir_path,
             name='test-pool', driver='file')
-        os.mkdir(os.path.join(self.dir_path, 'appvms', self.vm1.name))
-        os.mkdir(os.path.join(self.dir_path, 'appvms', self.vm2.name))
+        os.makedirs(os.path.join(self.dir_path, 'appvms', self.vm1.name),
+            exist_ok=True)
+        os.makedirs(os.path.join(self.dir_path, 'appvms', self.vm2.name),
+            exist_ok=True)
 
     def tearDown(self):
         self.app.remove_pool('test-pool')