From: Walter A. Boring IV Date: Fri, 8 Mar 2013 00:19:14 +0000 (-0800) Subject: Fix a few bugs for LeftHand Grizzly X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=a332cb941906557bb7e96706d3827e2cd1bd07f2;p=openstack-build%2Fcinder-build.git Fix a few bugs for LeftHand Grizzly This patch fixes a few issues with the LH driver. 1) attach wasn't working because there was no host created. 2) get_volume_stats didn't exist. 3) fixed the unit tests to work with the new config access. Bug 1062508 Bug 1150663 Change-Id: I6f80c3d5c70b64ca6496e50fedcb6b3ca0e2be43 --- diff --git a/cinder/tests/test_HpSanISCSIDriver.py b/cinder/tests/test_HpSanISCSIDriver.py index 1d9d9be10..a9ef2106c 100644 --- a/cinder/tests/test_HpSanISCSIDriver.py +++ b/cinder/tests/test_HpSanISCSIDriver.py @@ -33,6 +33,12 @@ class HpSanISCSITestCase(test.TestCase): self._fake_get_iscsi_properties) configuration = mox.MockObject(conf.Configuration) configuration.san_is_local = False + configuration.san_ip = "10.0.0.1" + configuration.san_login = "foo" + configuration.san_password = "bar" + configuration.san_ssh_port = 16022 + configuration.san_clustername = "CloudCluster1" + configuration.san_thin_provision = True configuration.append_config_values(mox.IgnoreArg()) self.driver = HpSanISCSIDriver(configuration=configuration) @@ -53,7 +59,7 @@ class HpSanISCSITestCase(test.TestCase): def _fake_get_iscsi_properties(self, volume): return self.properties - def _fake_cliq_run(self, verb, cliq_args): + def _fake_cliq_run(self, verb, cliq_args, check_exit_code=True): """Return fake results for the various methods.""" def create_volume(cliq_args): @@ -159,6 +165,22 @@ class HpSanISCSITestCase(test.TestCase): """ return output, None + def get_server_info(cliq_args): + """ + input = "getServerInfo serverName=fakeName" + """ + output = """ + """ + return output, None + + def create_server(cliq_args): + """ + input = "createServer serverName=fakeName initiator=something" + """ + output = """ + """ + return output, None + def test_error(cliq_args): output = """