]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fixed inconsistency in iqn
authorWalter A. Boring IV <walter.boring@hp.com>
Tue, 21 Jan 2014 19:54:15 +0000 (11:54 -0800)
committerWalter A. Boring IV <walter.boring@hp.com>
Tue, 21 Jan 2014 19:58:55 +0000 (11:58 -0800)
Brick's TargetAdmin classes have a
default value set in __init__ for
iscsi_target_prefix.   The unit test was changing
the value returned for the internal _get_target,
but wasn't changing the CONF.iscsi_target_prefix to
match.  So the default value in the __init__ was
being used and hence the differences.

This patch sets the configuration's iscsi_target_prefix
which alters the values passed into the driver.  This
also makes the tests consistent between the iqn of the volume
at create time and delete time.

Closes-Bug: #1271249
Change-Id: Ie3308cf68adcbdff6057ea795af1299dded82e14

cinder/tests/test_iscsi.py

index f07c8a4f6b8f07dd41a65a5b7ca2f63ebb9bf8b9..cc072fabffb2b407397f53a0c9d78a58cf0d95a6 100644 (file)
@@ -47,6 +47,7 @@ class TargetAdminTestCase(object):
         self.stubs.Set(iscsi.TgtAdm, '_verify_backing_lun',
                        self.fake_verify_backing_lun)
         self.driver = driver.ISCSIDriver()
+        self.flags(iscsi_target_prefix='iqn.2011-09.org.foo.bar:')
 
     def fake_verify_backing_lun(obj, iqn, tid):
         return True
@@ -113,7 +114,7 @@ class TgtAdmTestCase(test.TestCase, TargetAdminTestCase):
         self.script_template = "\n".join([
             'tgt-admin --update iqn.2011-09.org.foo.bar:blaa',
             'tgt-admin --force '
-            '--delete iqn.2010-10.org.openstack:volume-blaa',
+            '--delete iqn.2011-09.org.foo.bar:volume-blaa',
             'tgtadm --lld iscsi --op show --mode target'])
 
     def tearDown(self):
@@ -198,7 +199,7 @@ class LioAdmTestCase(test.TestCase, TargetAdminTestCase):
         self.script_template = "\n".join([
             'cinder-rtstool create '
             '/foo iqn.2011-09.org.foo.bar:blaa test_id test_pass',
-            'cinder-rtstool delete iqn.2010-10.org.openstack:volume-blaa'])
+            'cinder-rtstool delete iqn.2011-09.org.foo.bar:volume-blaa'])
 
 
 class ISERTgtAdmTestCase(TgtAdmTestCase):