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_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_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 get_fcoe_port(self, sp=None, port_id=None, vport_id=None, poll=False): ret = VNXConnectionPort.get(self._cli, sp=sp, port_id=port_id, vport_id=vport_id, port_type=VNXPortType.FCOE) return self._update_poll(ret, poll)
def test_get_by_sp_port_id(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4) assert_that(len(ports), equal_to(1)) port = ports[0] assert_that(port.port_id, equal_to(4)) assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.virtual_port_id, equal_to(0)) assert_that(port.vport_id, equal_to(0))
def get_iscsi_port(self, sp=None, port_id=None, vport_id=None, has_ip=None): return VNXConnectionPort.get(self._cli, sp=sp, port_id=port_id, vport_id=vport_id, port_type=VNXPortType.ISCSI, has_ip=has_ip)
def get_iscsi_port(self, sp=None, port_id=None, vport_id=None, has_ip=None, poll=False): ret = VNXConnectionPort.get(self._cli, sp=sp, port_id=port_id, vport_id=vport_id, port_type=VNXPortType.ISCSI, has_ip=has_ip) return self._update_poll(ret, poll)
def test_hba_port_with_connection_port(self): sg = VNXStorageGroup.get(cli=t_cli(), name='microsoft') h_port = sg.get_ports( initiator_uid='iqn.1991-05.com.microsoft:abc.def.dev') c_port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A, port_id=1, cli=t_cli()) assert_that(len(h_port), equal_to(2)) r = set(h_port) - {item for item in c_port} assert_that(len(r), equal_to(1)) assert_that(list(r)[0].port_id, equal_to(1)) assert_that(list(r)[0].sp, equal_to(VNXSPEnum.SP_B))
def test_get_by_type(self): ports = VNXConnectionPort.get(t_cli(), port_type=VNXPortType.ISCSI) assert_that(len(ports), equal_to(16)) ports = VNXConnectionPort.get(t_cli(), port_type=VNXPortType.FCOE) assert_that(len(ports), equal_to(4))
def test_get_by_port(self): ports = VNXConnectionPort.get(t_cli(), port_id=8) assert_that(len(ports), equal_to(2))
def test_get_by_sp(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A) assert_that(len(ports), equal_to(10))
def test_get_port_not_found(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 44) assert_that(len(ports), equal_to(0))
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0] port.delete_ip()
def test_ping_node_multiple_success(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0] # success, no error raised port.ping_node('10.244.211.5')
def test_get_port_with_vport_not_found(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_B, 10, 0) assert_that(port.existed, equal_to(False))
def test_get_by_sp(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A) assert_that(len(ports), equal_to(13))
def test_port_display_name(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 5, 0) assert_that('A-10-0', port.display_name)
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0] port.delete_ip()
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0] port.config_ip('6.6.6.6', '255.255.255.0', '5.5.5.1')
def test_ping_node_multiple_success(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0] # success, no error raised port.ping_node('10.244.211.5')
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0] port.ping_node('10.244.211.3', count=1)
def test_get_port_with_vport_not_found(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_B, 10, 0) assert_that(port.existed, equal_to(False))
def test_get_single(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4) assert_that(len(ports), equal_to(1)) port = ports[0] assert_that(port.port_id, equal_to(4)) assert_that(port.sp, equal_to(VNXSPEnum.SP_A))
def test_get_port_not_found(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 44) assert_that(len(ports), equal_to(0))
def f(): uid = 'iqn.1992-04.com.abc:a.b.d' port = VNXConnectionPort.get(sp=VNXSPEnum.SP_A, port_id=8, vport_id=0, cli=t_cli()) sg = VNXStorageGroup(cli=t_cli(), name='sg0') sg.set_path(port, uid, 'host0')
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0] port.ping_node('10.244.211.3', count=1)
def get_fcoe_port(self, sp=None, port_id=None, vport_id=None): return VNXConnectionPort.get(self._cli, sp=sp, port_id=port_id, vport_id=vport_id, port_type=VNXPortType.FCOE)
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0] port.config_ip('6.6.6.6', '255.255.255.0', '5.5.5.1')
def test_get_by_type(self): ports = VNXConnectionPort.get(t_cli(), port_type=VNXPortType.ISCSI) assert_that(len(ports), equal_to(19)) ports = VNXConnectionPort.get(t_cli(), port_type=VNXPortType.FCOE) assert_that(len(ports), equal_to(4))
def test_get_all(self): ports = VNXConnectionPort.get(t_cli()) assert_that(len(ports), equal_to(23))
def test_get_single(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 5, 2) assert_that(port.port_id, equal_to(5)) assert_that(port.sp, equal_to(VNXSPEnum.SP_A)) assert_that(port.virtual_port_id, equal_to(2)) assert_that(port.vport_id, equal_to(2))
def test_get_single(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4) assert_that(port, equal_to([]))
def test_get_all(self): ports = VNXConnectionPort.get(t_cli()) assert_that(len(ports), equal_to(20))
def get_connection_port(self, sp=None, port_id=None, vport_id=None): return VNXConnectionPort.get(self._cli, sp, port_id, vport_id)
def test_get_by_port(self): ports = VNXConnectionPort.get(t_cli(), port_id=8) assert_that(len(ports), equal_to(2))