From 8bac8741cde9387c132fb9f09fef2fd5461d567e Mon Sep 17 00:00:00 2001 From: Avishay Traeger Date: Mon, 15 Jul 2013 22:36:14 +0300 Subject: [PATCH] Clean up Huawei tmp files from tests. Remove tmp files created by Huawei tests. Change-Id: Id2eb4034b7be9d76843659647387344914ce236a Fixes: bug 1200416 --- cinder/tests/test_huawei.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cinder/tests/test_huawei.py b/cinder/tests/test_huawei.py index 0ff2c0115..ab10819d3 100644 --- a/cinder/tests/test_huawei.py +++ b/cinder/tests/test_huawei.py @@ -167,6 +167,8 @@ class HuaweiVolumeTestCase(test.TestCase): def __init__(self, *args, **kwargs): super(HuaweiVolumeTestCase, self).__init__(*args, **kwargs) + def setUp(self): + super(HuaweiVolumeTestCase, self).setUp() self.tmp_dir = tempfile.mkdtemp() self.fake_conf_file = self.tmp_dir + '/cinder_huawei_conf.xml' self._create_fake_conf_file() @@ -176,12 +178,13 @@ class HuaweiVolumeTestCase(test.TestCase): self.driver = FakeHuaweiStorage(configuration=configuration) self.driver.do_setup({}) - - def setUp(self): - super(HuaweiVolumeTestCase, self).setUp() self.driver._test_flg = 'check_for_fail' self._test_check_for_setup_errors() + def tearDown(self): + shutil.rmtree(self.tmp_dir) + super(HuaweiVolumeTestCase, self).tearDown() + def test_create_export_failed(self): self.assertRaises(exception.VolumeBackendAPIException, self.driver.create_export, -- 2.45.2