The synchronization decorator added to the NetAppISCSIDriver class
creates a lock file named cinder/openstack/cinder-netapp_dfm
during the unit tests. This commit cleans it up.
Fixes bug
1135619
Change-Id: Iec41a0f23d4a1c6668bdcb451c2c02efd3f97500
import BaseHTTPServer
import httplib
+import shutil
import StringIO
+import tempfile
from lxml import etree
def setUp(self):
super(NetAppDriverTestCase, self).setUp()
+ self.tempdir = tempfile.mkdtemp()
+ self.flags(lock_path=self.tempdir)
driver = iscsi.NetAppISCSIDriver()
self.stubs.Set(httplib, 'HTTPConnection', FakeHTTPConnection)
driver._create_client(wsdl_url='http://localhost:8088/dfm.wsdl',
driver._set_vfiler('')
self.driver = driver
+ def tearDown(self):
+ shutil.rmtree(self.tempdir)
+ super(NetAppDriverTestCase, self).setUp()
+
def test_connect(self):
self.driver.check_for_setup_error()