Skip to content

Commit

Permalink
Clean up Huawei tmp files from tests.
Browse files Browse the repository at this point in the history
Remove tmp files created by Huawei tests.

Change-Id: Id2eb4034b7be9d76843659647387344914ce236a
Fixes: bug 1200416
  • Loading branch information
avishay-traeger committed Jul 15, 2013
1 parent 54a7345 commit 8bac874
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cinder/tests/test_huawei.py
Expand Up @@ -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()
Expand All @@ -176,12 +178,13 @@ def __init__(self, *args, **kwargs):
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,
Expand Down

0 comments on commit 8bac874

Please sign in to comment.