From 94d9c9c8e5df18589d233f4a713f2f2059bdf92d Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanino Date: Wed, 14 Jan 2015 19:59:54 -0500 Subject: [PATCH] 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 --- cinder/tests/targets/test_lio_driver.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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( -- 2.45.2