From 4b51c9da07df1450a3cbd9aa3704b919e9173554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 28 Sep 2017 02:47:46 +0200 Subject: [PATCH] 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. --- qubes/tests/integ/storage.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qubes/tests/integ/storage.py b/qubes/tests/integ/storage.py index fbd315dd..ac4f15df 100644 --- a/qubes/tests/integ/storage.py +++ b/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')