self.assertNotIn(volume['id'], self.driver._vdiskcopyops)
def test_storwize_initiator_multiple_preferred_nodes_matching(self):
- # Set the context.
- ctxt = context.get_admin_context()
# Generate us a test volume
- volume = self._generate_vol_info(None, None)
- self.driver.create_volume(volume)
+ volume = self._create_volume()
# Fibre Channel volume type
- vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
+ extra_spec = {'capabilities:storage_protocol': '<in> FC'}
+ vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
volume['volume_type_id'] = vol_type['id']
'AABBCCDDEEFF0010')
def test_storwize_initiator_multiple_preferred_nodes_no_matching(self):
- # Set the context.
- ctxt = context.get_admin_context()
-
# Generate us a test volume
- volume = self._generate_vol_info(None, None)
- self.driver.create_volume(volume)
+ volume = self._create_volume()
# Fibre Channel volume type
- vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
+ extra_spec = {'capabilities:storage_protocol': '<in> FC'}
+ vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
volume['volume_type_id'] = vol_type['id']
'AABBCCDDEEFF0001')
def test_storwize_initiator_single_preferred_node_matching(self):
- # Set the context
- ctxt = context.get_admin_context()
-
# Generate us a test volume
- volume = self._generate_vol_info(None, None)
- self.driver.create_volume(volume)
+ volume = self._create_volume()
# Fibre Channel volume type
- vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
+ extra_spec = {'capabilities:storage_protocol': '<in> FC'}
+ vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
volume['volume_type_id'] = vol_type['id']
self.assertEqual(init_ret['data']['target_wwn'],
'AABBCCDDEEFF0012')
- def test_storwize_initiator_target_map(self):
- # Create two volumes to be used in mappings
- ctxt = context.get_admin_context()
+ def test_storwize_terminate_connection(self):
+ # create a FC volume
+ volume_fc = self._create_volume()
+ extra_spec = {'capabilities:storage_protocol': '<in> FC'}
+ vol_type_fc = volume_types.create(self.ctxt, 'FC', extra_spec)
+ volume_fc['volume_type_id'] = vol_type_fc['id']
+
+ # create a iSCSI volume
+ volume_iSCSI = self._create_volume()
+ extra_spec = {'capabilities:storage_protocol': '<in> iSCSI'}
+ vol_type_iSCSI = volume_types.create(self.ctxt, 'iSCSI', extra_spec)
+ volume_iSCSI['volume_type_id'] = vol_type_iSCSI['id']
+
+ connector = {'host': 'storwize-svc-host',
+ 'wwnns': ['20000090fa17311e', '20000090fa17311f'],
+ 'wwpns': ['ff00000000000000', 'ff00000000000001'],
+ 'initiator': 'iqn.1993-08.org.debian:01:eac5ccc1aaa'}
+
+ self.driver.initialize_connection(volume_fc, connector)
+ self.driver.initialize_connection(volume_iSCSI, connector)
+ self.driver.terminate_connection(volume_iSCSI, connector)
+ self.driver.terminate_connection(volume_fc, connector)
+ def test_storwize_initiator_target_map(self):
# Generate us a test volume
- volume = self._generate_vol_info(None, None)
- self.driver.create_volume(volume)
+ volume = self._create_volume()
# FIbre Channel volume type
- vol_type = volume_types.create(ctxt, 'FC', {'protocol': 'FC'})
+ extra_spec = {'capabilities:storage_protocol': '<in> FC'}
+ vol_type = volume_types.create(self.ctxt, 'FC', extra_spec)
volume['volume_type_id'] = vol_type['id']