Add mock for cinder-rtstool call in tests.targets.test_lio_driver

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
This commit is contained in:
Mitsuhiro Tanino 2015-01-14 19:59:54 -05:00
parent e35cbfa22b
commit 94d9c9c8e5
1 changed files with 3 additions and 4 deletions

View 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(