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.
This commit is contained in:
Marek Marczykowski-Górecki 2017-09-28 02:47:46 +02:00
parent 344bb16ae2
commit 4b51c9da07
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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')