Ejemplo n.º 1
0
    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)))
Ejemplo n.º 2
0
 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')
Ejemplo n.º 3
0
 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')
Ejemplo n.º 4
0
 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')
Ejemplo n.º 5
0
    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)
Ejemplo n.º 6
0
 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))
Ejemplo n.º 7
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)
Ejemplo n.º 8
0
 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)
Ejemplo n.º 9
0
 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))
Ejemplo n.º 10
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0]
     port.delete_ip()
Ejemplo n.º 11
0
 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')
Ejemplo n.º 12
0
 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))
Ejemplo n.º 13
0
 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))
Ejemplo n.º 14
0
 def test_get_by_port(self):
     ports = VNXConnectionPort.get(t_cli(), port_id=8)
     assert_that(len(ports), equal_to(2))
Ejemplo n.º 15
0
 def test_get_all(self):
     ports = VNXConnectionPort.get(t_cli())
     assert_that(len(ports), equal_to(20))
Ejemplo n.º 16
0
 def test_get_by_port(self):
     ports = VNXConnectionPort.get(t_cli(), port_id=8)
     assert_that(len(ports), equal_to(2))
Ejemplo n.º 17
0
 def test_port_display_name(self):
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 5, 0)
     assert_that('A-10-0', port.display_name)
Ejemplo n.º 18
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0]
     port.delete_ip()
Ejemplo n.º 19
0
 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')
Ejemplo n.º 20
0
 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')
Ejemplo n.º 21
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0]
     port.ping_node('10.244.211.3', count=1)
Ejemplo n.º 22
0
 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))
Ejemplo n.º 23
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')
Ejemplo n.º 24
0
 def test_get_port_not_found(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 44)
     assert_that(len(ports), equal_to(0))
Ejemplo n.º 25
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))
Ejemplo n.º 26
0
 def test_get_single(self):
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4)
     assert_that(port, equal_to([]))
Ejemplo n.º 27
0
 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)))
Ejemplo n.º 28
0
 def test_get_by_sp(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A)
     assert_that(len(ports), equal_to(10))
Ejemplo n.º 29
0
 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))
Ejemplo n.º 30
0
 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))
Ejemplo n.º 31
0
 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))
Ejemplo n.º 32
0
 def test_get_port_not_found(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 44)
     assert_that(len(ports), equal_to(0))
Ejemplo n.º 33
0
 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)
Ejemplo n.º 34
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0]
     port.ping_node('10.244.211.3', count=1)
Ejemplo n.º 35
0
 def test_get_all(self):
     ports = VNXConnectionPort.get(t_cli())
     assert_that(len(ports), equal_to(23))
Ejemplo n.º 36
0
 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')
Ejemplo n.º 37
0
 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))
Ejemplo n.º 38
0
 def test_get_by_sp(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A)
     assert_that(len(ports), equal_to(13))
Ejemplo n.º 39
0
 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))
Ejemplo n.º 40
0
 def test_port(self):
     return VNXConnectionPort(sp='a', port_id=4, cli=t_cli())
Ejemplo n.º 41
0
 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))
Ejemplo n.º 42
0
 def get_connection_port(self, sp=None, port_id=None, vport_id=None):
     return VNXConnectionPort.get(self._cli, sp, port_id, vport_id)
Ejemplo n.º 43
0
 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))