From: Mitsuhiro Tanino Date: Thu, 15 Jan 2015 00:59:54 +0000 (-0500) Subject: Add mock for cinder-rtstool call in tests.targets.test_lio_driver X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=94d9c9c8e5df18589d233f4a713f2f2059bdf92d;p=openstack-build%2Fcinder-build.git 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 --- diff --git a/cinder/tests/targets/test_lio_driver.py b/cinder/tests/targets/test_lio_driver.py index e3fd9a4fa..6839ecc24 100644 --- a/cinder/tests/targets/test_lio_driver.py +++ b/cinder/tests/targets/test_lio_driver.py @@ -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(