def f(): uid = 'iqn.1992-04.com.abc:a.b.c' port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A, port_id=10, cli=t_cli())[0] sg = VNXStorageGroup(cli=t_cli(), name='sg0') sg.set_path(port, uid, 'host0')
def test_missing_right_tab(self): sg = VNXStorageGroup(name='a.b.c', cli=t_cli()) uid = 'iqn.1994-05.com.abcdef:ghijk2-l-mn-opq-2.rstuvw.xyz:c3bf2f4ccc' port = list(filter(lambda i: i[0] == uid, sg.hba_port_list))[0][1] assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.port_id, equal_to(3)) assert_that(port.host_initiator_list, has_item(uid))
def test_set_path_with_fcoe_port_success(self): uid = 'iqn.1992-04.com.abc:a.b.c' port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A, port_id=8, vport_id=0, cli=t_cli()) sg = VNXStorageGroup(cli=t_cli(), name='sg0') # no error raised sg.connect_hba(port, uid, 'host0')
def test_hba_in_sp_port(self): sg = VNXStorageGroup(name='server7', cli=t_cli()) hba = None for hba in sg.ports: if hba.sp == VNXSPEnum.SP_A and hba.port_id == 0: break ports = VNXSPPort.get(t_cli()) assert_that(ports, has_item(hba))
def test_get_sg_os01(self): sg = VNXStorageGroup(name='os01', cli=t_cli()) assert_that(len(sg.hba_sp_pairs), equal_to(1)) assert_that(sg.hba_sp_pairs, instance_of(VNXStorageGroupHBAList)) hba = sg.hba_sp_pairs[0] assert_that(hba.sp, equal_to(VNXSPEnum.SP_A)) assert_that(hba.uid, equal_to('iqn.1993-08.org.debian:01:95bbe389e025')) assert_that(hba.port_id, equal_to(4))
def remove_sg(self, name): self._remove_resource(VNXStorageGroup(name, self._cli))
def get_sg(name='server7'): sg = VNXStorageGroup(name=name, cli=t_cli()) sg.shuffle_hlu = False return sg
def test_get_sg_os01(self): sg = VNXStorageGroup(name='os01', cli=t_cli()) # The hba pare is incomplete, should be 0 assert_that(len(sg.hba_sp_pairs), equal_to(0)) assert_that(sg.hba_sp_pairs, instance_of(VNXStorageGroupHBAList))
def delete_sg(self, name): self._delete_resource(VNXStorageGroup(name, self._cli))
def test_set_path_with_fc_port_success(self): wwn = '01:02:03:04:05:06:07:08:09:0A:0B:0C:0D:0E:0F:10' ports = VNXSPPort.get(sp=VNXSPEnum.SP_A, port_id=0, cli=t_cli()) sg = VNXStorageGroup(cli=t_cli(), name='sg0') # no exception sg.set_path(ports[0], wwn, 'host0')
def f(): ports = VNXSPPort.get(sp=VNXSPEnum.SP_A, port_id=0, cli=t_cli()) sg = VNXStorageGroup(cli=t_cli(), name='sg0') sg.set_path(ports[0], '11:22:33', 'host0')
def test_sg(self, name='server7'): return VNXStorageGroup(name=name, cli=t_cli())