From: Avishay Traeger Date: Mon, 15 Jul 2013 19:36:14 +0000 (+0300) Subject: Clean up Huawei tmp files from tests. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=8bac8741cde9387c132fb9f09fef2fd5461d567e;p=openstack-build%2Fcinder-build.git Clean up Huawei tmp files from tests. Remove tmp files created by Huawei tests. Change-Id: Id2eb4034b7be9d76843659647387344914ce236a Fixes: bug 1200416 --- 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,