Fix unittest run on s390x host

Explicitely mention a supported architecture when doing factory
tests, otherwise instantiation fails on hosts that do not support
them

Change-Id: Icccd955a27c8606b520f4426205d5489fc1c736d
This commit is contained in:
Dirk Mueller 2016-11-20 19:15:09 +01:00
parent 6a18026556
commit 928ced139c
2 changed files with 16 additions and 9 deletions

View File

@ -96,7 +96,7 @@ Request Succeeded
def test_factory(self): def test_factory(self):
"""Can we instantiate a HGSTConnector of the right kind?""" """Can we instantiate a HGSTConnector of the right kind?"""
obj = connector.InitiatorConnector.factory('HGST', None) obj = connector.InitiatorConnector.factory('HGST', None, arch='x86_64')
self.assertEqual("HGSTConnector", obj.__class__.__name__) self.assertEqual("HGSTConnector", obj.__class__.__name__)
def test_get_search_path(self): def test_get_search_path(self):

View File

@ -182,14 +182,15 @@ class ConnectorTestCase(test_base.TestCase):
obj = connector.InitiatorConnector.factory('iscsi', None) obj = connector.InitiatorConnector.factory('iscsi', None)
self.assertEqual("ISCSIConnector", obj.__class__.__name__) self.assertEqual("ISCSIConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory('fibre_channel', None) obj = connector.InitiatorConnector.factory('fibre_channel', None,
arch='x86_64')
self.assertEqual("FibreChannelConnector", obj.__class__.__name__) self.assertEqual("FibreChannelConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory('fibre_channel', None, obj = connector.InitiatorConnector.factory('fibre_channel', None,
arch='s390x') arch='s390x')
self.assertEqual("FibreChannelConnectorS390X", obj.__class__.__name__) self.assertEqual("FibreChannelConnectorS390X", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory('aoe', None) obj = connector.InitiatorConnector.factory('aoe', None, arch='x86_64')
self.assertEqual("AoEConnector", obj.__class__.__name__) self.assertEqual("AoEConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory( obj = connector.InitiatorConnector.factory(
@ -197,11 +198,13 @@ class ConnectorTestCase(test_base.TestCase):
self.assertEqual("RemoteFsConnector", obj.__class__.__name__) self.assertEqual("RemoteFsConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory( obj = connector.InitiatorConnector.factory(
'glusterfs', None, glusterfs_mount_point_base='/mnt/test') 'glusterfs', None, glusterfs_mount_point_base='/mnt/test',
arch='x86_64')
self.assertEqual("RemoteFsConnector", obj.__class__.__name__) self.assertEqual("RemoteFsConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory( obj = connector.InitiatorConnector.factory(
'scality', None, scality_mount_point_base='/mnt/test') 'scality', None, scality_mount_point_base='/mnt/test',
arch='x86_64')
self.assertEqual("RemoteFsConnector", obj.__class__.__name__) self.assertEqual("RemoteFsConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory('local', None) obj = connector.InitiatorConnector.factory('local', None)
@ -210,17 +213,21 @@ class ConnectorTestCase(test_base.TestCase):
obj = connector.InitiatorConnector.factory('gpfs', None) obj = connector.InitiatorConnector.factory('gpfs', None)
self.assertEqual("GPFSConnector", obj.__class__.__name__) self.assertEqual("GPFSConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory('huaweisdshypervisor', None) obj = connector.InitiatorConnector.factory(
'huaweisdshypervisor', None, arch='x86_64')
self.assertEqual("HuaweiStorHyperConnector", obj.__class__.__name__) self.assertEqual("HuaweiStorHyperConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory("scaleio", None) obj = connector.InitiatorConnector.factory(
"scaleio", None, arch='x86_64')
self.assertEqual("ScaleIOConnector", obj.__class__.__name__) self.assertEqual("ScaleIOConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory( obj = connector.InitiatorConnector.factory(
'quobyte', None, quobyte_mount_point_base='/mnt/test') 'quobyte', None, quobyte_mount_point_base='/mnt/test',
arch='x86_64')
self.assertEqual("RemoteFsConnector", obj.__class__.__name__) self.assertEqual("RemoteFsConnector", obj.__class__.__name__)
obj = connector.InitiatorConnector.factory("disco", None) obj = connector.InitiatorConnector.factory(
"disco", None, arch='x86_64')
self.assertEqual("DISCOConnector", obj.__class__.__name__) self.assertEqual("DISCOConnector", obj.__class__.__name__)
self.assertRaises(exception.InvalidConnectorProtocol, self.assertRaises(exception.InvalidConnectorProtocol,