summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-06-10 15:04:21 -0400
committerScott Moser <smoser@ubuntu.com>2016-06-10 15:04:21 -0400
commita3720feb537cb5189bccf4889b601704a4cdf1da (patch)
tree3dce25ab9923df2aa507087f4c6f452a96d1ea19 /tests
parent8da73fb6ccb0d99c7e5183257c4cbd2dd94719f1 (diff)
parent785fe5632d58633dea5d6b2c1c5ecbaca35471a3 (diff)
downloadvyos-cloud-init-a3720feb537cb5189bccf4889b601704a4cdf1da.tar.gz
vyos-cloud-init-a3720feb537cb5189bccf4889b601704a4cdf1da.zip
clean up temp files made in tests
After a 'tox' run, now there are no tmpdirs left in /tmp.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_datasource/test_azure_helper.py1
-rw-r--r--tests/unittests/test_datasource/test_smartos.py4
2 files changed, 4 insertions, 1 deletions
diff --git a/tests/unittests/test_datasource/test_azure_helper.py b/tests/unittests/test_datasource/test_azure_helper.py
index d07a1f07..70e8f7f2 100644
--- a/tests/unittests/test_datasource/test_azure_helper.py
+++ b/tests/unittests/test_datasource/test_azure_helper.py
@@ -288,6 +288,7 @@ class TestOpenSSLManager(TestCase):
self.subp.side_effect = capture_directory
manager = azure_helper.OpenSSLManager()
self.assertEqual(manager.tmpdir, subp_directory['path'])
+ manager.clean_up()
@mock.patch.object(azure_helper, 'cd', mock.MagicMock())
@mock.patch.object(azure_helper.tempfile, 'mkdtemp', mock.MagicMock())
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py
index c809117b..ec57cff1 100644
--- a/tests/unittests/test_datasource/test_smartos.py
+++ b/tests/unittests/test_datasource/test_smartos.py
@@ -146,7 +146,9 @@ class TestSmartOSDataSource(FilesystemMockingTestCase):
self.addCleanup(shutil.rmtree, self.tmp)
self.paths = c_helpers.Paths({'cloud_dir': self.tmp})
- self.legacy_user_d = tempfile.mkdtemp()
+ self.legacy_user_d = os.path.join(self.tmp, 'legacy_user_tmp')
+ os.mkdir(self.legacy_user_d)
+
self.orig_lud = DataSourceSmartOS.LEGACY_USER_D
DataSourceSmartOS.LEGACY_USER_D = self.legacy_user_d