from cinder.i18n import _LW
from cinder.openstack.common import log as logging
from cinder import test
-from cinder.volume.drivers.fujitsu_eternus_dx_common import FJDXCommon
-from cinder.volume.drivers.fujitsu_eternus_dx_fc import FJDXFCDriver
-from cinder.volume.drivers.fujitsu_eternus_dx_iscsi import FJDXISCSIDriver
+import cinder.volume.drivers.fujitsu.eternus_dx_common as eternus_dx_common
+import cinder.volume.drivers.fujitsu.eternus_dx_fc as eternus_dx_fc
+import cinder.volume.drivers.fujitsu.eternus_dx_iscsi as eternus_dx_iscsi
CONFIG_FILE_NAME = 'cinder_fujitsu_eternus_dx.xml'
STORAGE_SYSTEM = '172.16.0.2'
# replace some configuration function with fake
# self.stubs.Set(self.driver.configuration, 'safe_get',
# self.fake_configuration_safe_get)
- self.stubs.Set(FJDXCommon, '_get_ecom_connection',
+ self.stubs.Set(eternus_dx_common.FJDXCommon, '_get_ecom_connection',
self.fake_ecom_connection)
instancename = FakeCIMInstanceName()
- self.stubs.Set(FJDXCommon, '_getinstancename',
+ self.stubs.Set(eternus_dx_common.FJDXCommon, '_getinstancename',
instancename.fake_getinstancename)
# set fc driver to self.driver
- driver = FJDXFCDriver(configuration=self.configuration)
+ driver = eternus_dx_fc.FJDXFCDriver(configuration=self.configuration)
driver.db = FakeDB()
self.driver = driver
# self.stubs.Set(self.driver.configuration, 'safe_get',
# self.fake_configuration_safe_get)
- self.stubs.Set(FJDXISCSIDriver, '_do_iscsi_discovery',
+ self.stubs.Set(eternus_dx_iscsi.FJDXISCSIDriver, '_do_iscsi_discovery',
self.fake_do_iscsi_discovery)
- self.stubs.Set(FJDXCommon, '_get_ecom_connection',
+ self.stubs.Set(eternus_dx_common.FJDXCommon, '_get_ecom_connection',
self.fake_ecom_connection)
instancename = FakeCIMInstanceName()
- self.stubs.Set(FJDXCommon, '_getinstancename',
+ self.stubs.Set(eternus_dx_common.FJDXCommon, '_getinstancename',
instancename.fake_getinstancename)
# set iscsi driver to self.driver
- driver = FJDXISCSIDriver(configuration=self.configuration)
+ driver = (
+ eternus_dx_iscsi.FJDXISCSIDriver(configuration=self.configuration))
driver.db = FakeDB()
self.driver = driver
--- /dev/null
+# Copyright (c) 2015 FUJITSU LIMITED
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+from oslo_config import cfg
+from oslo_utils import importutils
+
+from cinder import test
+import cinder.volume.drivers.fujitsu.eternus_dx_common as eternus_dx_common
+
+
+CONF = cfg.CONF
+
+FUJITSU_FC_MODULE = ('cinder.volume.drivers.fujitsu.'
+ 'eternus_dx_fc.FJDXFCDriver')
+
+FUJITSU_ISCSI_MODULE = ('cinder.volume.drivers.fujitsu.'
+ 'eternus_dx_iscsi.FJDXISCSIDriver')
+
+
+class FJDriverCompatibility(test.TestCase):
+
+ def setUp(self):
+ super(FJDriverCompatibility, self).setUp()
+ self.manager = importutils.import_object(CONF.volume_manager)
+
+ # Stub definition
+ self.stubs.Set(
+ eternus_dx_common.FJDXCommon, '__init__', self.fake_init)
+
+ def _load_driver(self, driver):
+ self.manager.__init__(volume_driver=driver)
+
+ def _driver_module_name(self):
+ return "%s.%s" % (self.manager.driver.__class__.__module__,
+ self.manager.driver.__class__.__name__)
+
+ def fake_init(self, prtcl, configuration=None):
+ msg = "selected protocol is %s" % prtcl
+ self.assertTrue((prtcl == 'FC') or (prtcl == 'iSCSI'), msg=msg)
+
+ def test_fujitsu_driver_fc_old(self):
+ self._load_driver(
+ 'cinder.volume.drivers.fujitsu_eternus_dx_fc.FJDXFCDriver')
+ self.assertEqual(FUJITSU_FC_MODULE, self._driver_module_name())
+
+ def test_fujitsu_driver_fc_new(self):
+ self._load_driver(FUJITSU_FC_MODULE)
+ self.assertEqual(FUJITSU_FC_MODULE, self._driver_module_name())
+
+ def test_fujitsu_driver_iscsi_old(self):
+ self._load_driver(
+ 'cinder.volume.drivers.fujitsu_eternus_dx_iscsi.FJDXISCSIDriver')
+ self.assertEqual(FUJITSU_ISCSI_MODULE, self._driver_module_name())
+
+ def test_fujitsu_driver_iscsi_new(self):
+ self._load_driver(FUJITSU_ISCSI_MODULE)
+ self.assertEqual(FUJITSU_ISCSI_MODULE, self._driver_module_name())
from cinder import context
from cinder.openstack.common import log as logging
from cinder.volume import driver
-from cinder.volume.drivers import fujitsu_eternus_dx_common
+from cinder.volume.drivers.fujitsu import eternus_dx_common
from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__)
def __init__(self, *args, **kwargs):
super(FJDXFCDriver, self).__init__(*args, **kwargs)
- self.common = fujitsu_eternus_dx_common.FJDXCommon(
+ self.common = eternus_dx_common.FJDXCommon(
'FC',
configuration=self.configuration)
from cinder.i18n import _, _LW
from cinder.openstack.common import log as logging
from cinder.volume import driver
-from cinder.volume.drivers import fujitsu_eternus_dx_common
+from cinder.volume.drivers.fujitsu import eternus_dx_common
LOG = logging.getLogger(__name__)
super(FJDXISCSIDriver, self).__init__(*args, **kwargs)
self.common = \
- fujitsu_eternus_dx_common.\
+ eternus_dx_common.\
FJDXCommon('iSCSI', configuration=self.configuration)
def check_for_setup_error(self):
'cinder.volume.drivers.huawei.huawei_hvs.HuaweiHVSISCSIDriver':
'cinder.volume.drivers.huawei.huawei_18000.Huawei18000ISCSIDriver',
'cinder.volume.drivers.huawei.huawei_hvs.HuaweiHVSFCDriver':
- 'cinder.volume.drivers.huawei.huawei_18000.Huawei18000FCDriver', }
+ 'cinder.volume.drivers.huawei.huawei_18000.Huawei18000FCDriver',
+ 'cinder.volume.drivers.fujitsu_eternus_dx_fc.FJDXFCDriver':
+ 'cinder.volume.drivers.fujitsu.eternus_dx_fc.FJDXFCDriver',
+ 'cinder.volume.drivers.fujitsu_eternus_dx_iscsi.FJDXISCSIDriver':
+ 'cinder.volume.drivers.fujitsu.eternus_dx_iscsi.FJDXISCSIDriver', }
def locked_volume_operation(f):