]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Clean up Huawei tmp files from tests.
authorAvishay Traeger <avishay@il.ibm.com>
Mon, 15 Jul 2013 19:36:14 +0000 (22:36 +0300)
committerAvishay Traeger <avishay@il.ibm.com>
Mon, 15 Jul 2013 19:49:25 +0000 (22:49 +0300)
Remove tmp files created by Huawei tests.

Change-Id: Id2eb4034b7be9d76843659647387344914ce236a
Fixes: bug 1200416
cinder/tests/test_huawei.py

index 0ff2c0115a98dea9ffc39f82cd38b82b58f20f8f..ab10819d3b32f1263c9b046681edb1cafc1aa76f 100644 (file)
@@ -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,