def test_connection_port_not_in_hba_port_set(self): ports = self.hba_port_set() c_port = VNXConnectionPort(sp='a', port_id=4, cli=t_cli()) assert_that(ports, is_not(has_item(c_port))) c_port = VNXConnectionPort(sp='a', port_id=9, cli=t_cli()) assert_that(ports, is_not(has_item(c_port)))
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 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 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 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_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_by_port(self): ports = VNXConnectionPort.get(t_cli(), port_id=8) assert_that(len(ports), equal_to(2))
def test_get_all(self): ports = VNXConnectionPort.get(t_cli()) assert_that(len(ports), equal_to(20))
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.config_ip('6.6.6.6', '255.255.255.0', '5.5.5.1')
def f(): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0] port.ping_node('10.244.211.3', count=1)
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 test_get_port_not_found(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 44) assert_that(len(ports), equal_to(0))
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_single(self): port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4) assert_that(port, equal_to([]))
def test_connection_port_not_equal_sp_port(self): c_port = VNXConnectionPort(sp='a', port_id=4, cli=t_cli()) s_port = VNXSPPort.get(t_cli(), VNXSPEnum.SP_A, 4) # one has vport_id, others not, not equal assert_that(c_port, is_not(equal_to(s_port)))
def test_get_by_sp(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A) assert_that(len(ports), equal_to(10))
def test_connection_port_equal_sp_port(self): c_port = VNXConnectionPort(sp='a', port_id=9, cli=t_cli()) s_port = VNXSPPort.get(t_cli(), VNXSPEnum.SP_A, 9)[0] assert_that(c_port, equal_to(s_port))
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_connection_port_equal_hba_port(self): c_port = VNXConnectionPort(sp='a', port_id=4, cli=t_cli()) h_port = VNXHbaPort.create('a', 4, vport_id=0) assert_that(c_port, equal_to(h_port))
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 test_get_all(self): ports = VNXConnectionPort.get(t_cli()) assert_that(len(ports), equal_to(23))
def test_connection_port_in_sp_port_list(self): c_port = VNXConnectionPort(sp='a', port_id=9, cli=t_cli()) ports = VNXSPPort.get(t_cli()) assert_that(ports, has_item(c_port))
def test_get_by_sp(self): ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A) assert_that(len(ports), equal_to(13))
def test_hba_equal_connection_port(self): hba = test_hba() c_port = VNXConnectionPort(sp='a', port_id=3, vport_id=1, cli=t_cli()) assert_that(hba, equal_to(c_port))
def test_port(self): return VNXConnectionPort(sp='a', port_id=4, cli=t_cli())
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 get_connection_port(self, sp=None, port_id=None, vport_id=None): return VNXConnectionPort.get(self._cli, sp, port_id, vport_id)
def test_connection_port_in_hba_port_set(self): ports = self.hba_port_set() c_port = VNXConnectionPort(sp='a', port_id=6, vport_id=0, cli=t_cli()) assert_that(ports, has_item(c_port))