From a332cb941906557bb7e96706d3827e2cd1bd07f2 Mon Sep 17 00:00:00 2001 From: "Walter A. Boring IV" Date: Thu, 7 Mar 2013 16:19:14 -0800 Subject: [PATCH] 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 --- cinder/tests/test_HpSanISCSIDriver.py | 26 +++++++++++- cinder/volume/drivers/san/hp_lefthand.py | 53 ++++++++++++++++++++---- 2 files changed, 70 insertions(+), 9 deletions(-) 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 = """