# under the License.
import os.path
+import shutil
import string
+import tempfile
from cinder import test
from cinder.volume import iscsi
def setUp(self):
super(TgtAdmTestCase, self).setUp()
TargetAdminTestCase.setUp(self)
+ self.persist_tempdir = tempfile.mkdtemp()
self.flags(iscsi_helper='tgtadm')
- self.flags(volumes_dir="./")
+ self.flags(volumes_dir=self.persist_tempdir)
self.script_template = "\n".join([
- 'tgt-admin --conf ./blaa --update iqn.2011-09.org.foo.bar:blaa',
+ 'tgt-admin --conf %s/blaa --update iqn.2011-09.org.foo.bar:blaa'
+ % self.persist_tempdir,
'tgt-admin --delete iqn.2010-10.org.openstack:volume-blaa'])
+ def tearDown(self):
+ try:
+ shutil.rmtree(self.persist_tempdir)
+ except OSError:
+ pass
+
class IetAdmTestCase(test.TestCase, TargetAdminTestCase):