msgid "Flexvisor failed to delete snapshot (failed to get event) %(id)s."
msgstr ""
- #: cinder/volume/drivers/prophetstor/dplcommon.py:960
- #, python-format
- msgid "Flexvisor snapshot %(id)s not existed."
- msgstr ""
-
- #: cinder/volume/drivers/prophetstor/dplcommon.py:969
+ #: cinder/volume/drivers/prophetstor/dplcommon.py:1418
+ #: cinder/volume/drivers/prophetstor/dplcommon.py:1430
#, python-format
- msgid "Flexvisor succeed to delete snapshot %(id)s."
+ msgid "Flexvisor failed to get pool info %(id)s: %(status)s."
msgstr ""
- #: cinder/volume/drivers/prophetstor/dplcommon.py:1021
+ #: cinder/volume/drivers/prophetstor/dplcommon.py:1425
#, python-format
- msgid "Failed to get server info due to %(state)s."
- msgstr ""
-
- #: cinder/volume/drivers/prophetstor/dplcommon.py:1029
- msgid "Activate Flexvisor cinder volume driver."
+ msgid "Flexvisor failed to get pool info (failed to get event)%s."
msgstr ""
- #: cinder/volume/drivers/prophetstor/dplcommon.py:1044
- #: cinder/volume/drivers/prophetstor/dplcommon.py:1057
- #, python-format
- msgid "Flexvisor failed to get pool info %(id)s: %(status)s."
+ #: cinder/volume/drivers/prophetstor/dplcommon.py:1434
+ msgid "Flexvisor succeed to get pool info."
msgstr ""
- #: cinder/volume/drivers/prophetstor/dplcommon.py:1052
+ #: cinder/volume/drivers/san/san.py:151
#, python-format
- msgid "Flexvisor failed to get pool info (failed to get event)%s."
+ msgid "Error running SSH command: %s"
msgstr ""
+#: cinder/volume/drivers/san/san.py:151
+#: cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py:417
+#: cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py:271
+#: cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py:397
+#, python-format
+msgid "Error running SSH command: %s"
+msgstr ""
+
#: cinder/volume/drivers/san/san.py:171
msgid "Specify san_password or san_private_key"
msgstr ""
msgid "Version string '%s' is not parseable"
msgstr ""
- #: cinder/volume/drivers/vmware/vmdk.py:1889
- #, python-format
- msgid "Not able to configure PBM for VC server: %s"
- msgstr ""
-
- #: cinder/volume/drivers/vmware/vmdk.py:1956
+ #: cinder/volume/drivers/vmware/vmdk.py:1953
#, python-format
-msgid "Relocating volume: %(backing)s to %(ds)s and %(rp)s."
+msgid ""
+"There are no datastores matching volume requirements; can't relocate "
+"volume: %s."
msgstr ""
- #: cinder/volume/drivers/vmware/vmdk.py:2008
- #: cinder/volume/drivers/vmware/volumeops.py:1069
+ #: cinder/volume/drivers/vmware/vmdk.py:2001
#, python-format
msgid "Successfully created clone: %s."
msgstr ""
cprops = {}
self.assertRaises(ValueError,
self.connector.connect_volume, cprops)
- LOG.debug("expected = %s." % expected_commands)
+
+
+ class HuaweiStorHyperConnectorTestCase(ConnectorTestCase):
+ """Test cases for StorHyper initiator class."""
+
+ attached = False
+
+ def setUp(self):
+ super(HuaweiStorHyperConnectorTestCase, self).setUp()
+ self.fake_sdscli_file = tempfile.mktemp()
+ self.addCleanup(os.remove, self.fake_sdscli_file)
+ newefile = open(self.fake_sdscli_file, 'w')
+ newefile.write('test')
+ newefile.close()
+
+ self.connector = connector.HuaweiStorHyperConnector(
+ None, execute=self.fake_execute)
+ self.connector.cli_path = self.fake_sdscli_file
+ self.connector.iscliexist = True
+
+ self.connector_fail = connector.HuaweiStorHyperConnector(
+ None, execute=self.fake_execute_fail)
+ self.connector_fail.cli_path = self.fake_sdscli_file
+ self.connector_fail.iscliexist = True
+
+ self.connector_nocli = connector.HuaweiStorHyperConnector(
+ None, execute=self.fake_execute_fail)
+ self.connector_nocli.cli_path = self.fake_sdscli_file
+ self.connector_nocli.iscliexist = False
+
+ self.connection_properties = {
+ 'access_mode': 'rw',
+ 'qos_specs': None,
+ 'volume_id': 'volume-b2911673-863c-4380-a5f2-e1729eecfe3f'
+ }
+
+ self.device_info = {'type': 'block',
+ 'path': '/dev/vdxxx'}
+ HuaweiStorHyperConnectorTestCase.attached = False
+
+ def fake_execute(self, *cmd, **kwargs):
+ method = cmd[2]
+ self.cmds.append(string.join(cmd))
+ if 'attach' == method:
+ HuaweiStorHyperConnectorTestCase.attached = True
+ return 'ret_code=0', None
+ if 'querydev' == method:
+ if HuaweiStorHyperConnectorTestCase.attached:
+ return 'ret_code=0\ndev_addr=/dev/vdxxx', None
+ else:
+ return 'ret_code=1\ndev_addr=/dev/vdxxx', None
+ if 'detach' == method:
+ HuaweiStorHyperConnectorTestCase.attached = False
+ return 'ret_code=0', None
+
+ def fake_execute_fail(self, *cmd, **kwargs):
+ method = cmd[2]
+ self.cmds.append(string.join(cmd))
+ if 'attach' == method:
+ HuaweiStorHyperConnectorTestCase.attached = False
+ return 'ret_code=330151401', None
+ if 'querydev' == method:
+ if HuaweiStorHyperConnectorTestCase.attached:
+ return 'ret_code=0\ndev_addr=/dev/vdxxx', None
+ else:
+ return 'ret_code=1\ndev_addr=/dev/vdxxx', None
+ if 'detach' == method:
+ HuaweiStorHyperConnectorTestCase.attached = True
+ return 'ret_code=330155007', None
+
+ def test_connect_volume(self):
+ """Test the basic connect volume case."""
+
+ retval = self.connector.connect_volume(self.connection_properties)
+ self.assertEqual(self.device_info, retval)
+
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+ LOG.debug("self.cmds = %s." % self.cmds)
+ LOG.debug("expected = %s." % expected_commands)
+
+ self.assertEqual(expected_commands, self.cmds)
+
+ def test_disconnect_volume(self):
+ """Test the basic disconnect volume case."""
+ self.connector.connect_volume(self.connection_properties)
+ self.assertEqual(True, HuaweiStorHyperConnectorTestCase.attached)
+ self.connector.disconnect_volume(self.connection_properties,
+ self.device_info)
+ self.assertEqual(False, HuaweiStorHyperConnectorTestCase.attached)
+
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c detach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+
+ LOG.debug("self.cmds = %s." % self.cmds)
+ LOG.debug("expected = %s." % expected_commands)
+
+ self.assertEqual(expected_commands, self.cmds)
+
+ def test_is_volume_connected(self):
+ """Test if volume connected to host case."""
+ self.connector.connect_volume(self.connection_properties)
+ self.assertEqual(True, HuaweiStorHyperConnectorTestCase.attached)
+ is_connected = self.connector.is_volume_connected(
+ 'volume-b2911673-863c-4380-a5f2-e1729eecfe3f')
+ self.assertEqual(HuaweiStorHyperConnectorTestCase.attached,
+ is_connected)
+ self.connector.disconnect_volume(self.connection_properties,
+ self.device_info)
+ self.assertEqual(False, HuaweiStorHyperConnectorTestCase.attached)
+ is_connected = self.connector.is_volume_connected(
+ 'volume-b2911673-863c-4380-a5f2-e1729eecfe3f')
+ self.assertEqual(HuaweiStorHyperConnectorTestCase.attached,
+ is_connected)
+
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c detach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+
+ LOG.debug("self.cmds = %s." % self.cmds)
+ LOG.debug("expected = %s." % expected_commands)
+
+ self.assertEqual(expected_commands, self.cmds)
+
+ def test__analyze_output(self):
+ cliout = 'ret_code=0\ndev_addr=/dev/vdxxx\nret_desc="success"'
+ analyze_result = {'dev_addr': '/dev/vdxxx',
+ 'ret_desc': '"success"',
+ 'ret_code': '0'}
+ result = self.connector._analyze_output(cliout)
+ self.assertEqual(analyze_result, result)
+
+ def test_connect_volume_fail(self):
+ """Test the fail connect volume case."""
+ self.assertRaises(exception.BrickException,
+ self.connector_fail.connect_volume,
+ self.connection_properties)
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+ LOG.debug("self.cmds = %s." % self.cmds)
+ LOG.debug("expected = %s." % expected_commands)
+ self.assertEqual(expected_commands, self.cmds)
+
+ def test_disconnect_volume_fail(self):
+ """Test the fail disconnect volume case."""
+ self.connector.connect_volume(self.connection_properties)
+ self.assertEqual(True, HuaweiStorHyperConnectorTestCase.attached)
+ self.assertRaises(exception.BrickException,
+ self.connector_fail.disconnect_volume,
+ self.connection_properties,
+ self.device_info)
+
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c detach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+
+ LOG.debug("self.cmds = %s." % self.cmds)
+ LOG.debug("expected = %s." % expected_commands)
+
+ self.assertEqual(expected_commands, self.cmds)
+
+ def test_connect_volume_nocli(self):
+ """Test the fail connect volume case."""
+ self.assertRaises(exception.BrickException,
+ self.connector_nocli.connect_volume,
+ self.connection_properties)
+
+ def test_disconnect_volume_nocli(self):
+ """Test the fail disconnect volume case."""
+ self.connector.connect_volume(self.connection_properties)
+ self.assertEqual(True, HuaweiStorHyperConnectorTestCase.attached)
+ self.assertRaises(exception.BrickException,
+ self.connector_nocli.disconnect_volume,
+ self.connection_properties,
+ self.device_info)
+ expected_commands = [self.fake_sdscli_file + ' -c attach'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f',
+ self.fake_sdscli_file + ' -c querydev'
+ ' -v volume-b2911673-863c-4380-a5f2-e1729eecfe3f']
+
+ LOG.debug("self.cmds = %s." % self.cmds)
++ LOG.debug("expected = %s." % expected_commands)