From fb94618662006a076899f9741383acac09bfd024 Mon Sep 17 00:00:00 2001 From: Mate Lakat Date: Fri, 19 Oct 2012 14:19:03 +0100 Subject: Remove mountpoint from parse_volume_info Related to blueprint xenapi-volume-drivers parse_volume_info method did too many things. It was checking the connection_data for iscsi information, and also checked the mountpoint. This change extracts the mountpoint conversion, and performs that check earlier in the volume attach process. Change-Id: I7c26e813319f6d9de287782ad188b22804d032a9 --- nova/tests/test_xenapi.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'nova/tests') diff --git a/nova/tests/test_xenapi.py b/nova/tests/test_xenapi.py index d50379b48..7b92c352d 100644 --- a/nova/tests/test_xenapi.py +++ b/nova/tests/test_xenapi.py @@ -215,20 +215,19 @@ class XenAPIVolumeTestCase(stubs.XenAPITestBase): self.assertEqual(actual, expected, '%s yielded %s, not %s' % (input, actual, expected)) - def test_parse_volume_info_raise_exception(self): - self.assertRaises(volume_utils.StorageError, - volume_utils.parse_volume_info, - self._make_connection_data(), - 'dev/sd' - ) - def test_parse_volume_info_parsing_auth_details(self): result = volume_utils.parse_volume_info( - self._make_connection_data(), '/dev/sda') + self._make_connection_data()) self.assertEquals('username', result['chapuser']) self.assertEquals('password', result['chappassword']) + def test_get_device_number_raise_exception_on_wrong_mountpoint(self): + self.assertRaises( + volume_utils.StorageError, + volume_utils.get_device_number, + 'dev/sd') + def test_attach_volume(self): """This shows how to test Ops classes' methods.""" stubs.stubout_session(self.stubs, stubs.FakeSessionForVolumeTests) -- cgit