]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add mock for cinder-rtstool call in tests.targets.test_lio_driver
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Thu, 15 Jan 2015 00:59:54 +0000 (19:59 -0500)
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Thu, 15 Jan 2015 01:11:23 +0000 (20:11 -0500)
Unit tests in tests.targets.test_lio_driver are calling out to
cinder-rtstool.
change-id Ic25828361d9c30c4e1aa37b630d8ad272a78977b skips this
unit test to avoid failure of tests.
This patch reverts this change and adds mock for calling of
cinder-rtstool to reenable the unit tests.

Change-Id: I11dc07f692b5ba07484595c980f82bbdd2140d24
Closes-Bug: #1411029

cinder/tests/targets/test_lio_driver.py

index e3fd9a4fa847abcbd5e895d746318a81e4895d20..6839ecc240bfc5f907c94b3ac8137ae58df8ad43 100644 (file)
@@ -15,19 +15,18 @@ from oslo_concurrency import processutils as putils
 
 from cinder import context
 from cinder import exception
-from cinder import test
 from cinder.tests.targets import test_tgt_driver as test_tgt
 from cinder import utils
 from cinder.volume.targets import lio
 
 
-@test.testtools.skip("SKIP until bug #1411029 is fixed")
 class TestLioAdmDriver(test_tgt.TestTgtAdmDriver):
 
     def setUp(self):
         super(TestLioAdmDriver, self).setUp()
-        self.target = lio.LioAdm(root_helper=utils.get_root_helper(),
-                                 configuration=self.configuration)
+        with mock.patch.object(lio.LioAdm, '_verify_rtstool'):
+            self.target = lio.LioAdm(root_helper=utils.get_root_helper(),
+                                     configuration=self.configuration)
         self.fake_iscsi_scan = ('iqn.2010-10.org.openstack:'
                                 'volume-83c2e877-feed-46be-8435-77884fe55b45')
         self.target.db = mock.MagicMock(