示例#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)))
示例#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')
示例#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')
示例#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')
示例#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)
示例#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))
示例#7
0
文件: system.py 项目: crook/storops
 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)
示例#8
0
文件: system.py 项目: seven/storops
 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)
示例#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))
示例#10
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0]
     port.delete_ip()
示例#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')
示例#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))
示例#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))
示例#14
0
 def test_get_by_port(self):
     ports = VNXConnectionPort.get(t_cli(), port_id=8)
     assert_that(len(ports), equal_to(2))
示例#15
0
 def test_get_all(self):
     ports = VNXConnectionPort.get(t_cli())
     assert_that(len(ports), equal_to(20))
示例#16
0
 def test_get_by_port(self):
     ports = VNXConnectionPort.get(t_cli(), port_id=8)
     assert_that(len(ports), equal_to(2))
示例#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)
示例#18
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 10)[0]
     port.delete_ip()
示例#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')
示例#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')
示例#21
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0]
     port.ping_node('10.244.211.3', count=1)
示例#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))
示例#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')
示例#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))
示例#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))
示例#26
0
 def test_get_single(self):
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 4)
     assert_that(port, equal_to([]))
示例#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)))
示例#28
0
 def test_get_by_sp(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A)
     assert_that(len(ports), equal_to(10))
示例#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))
示例#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))
示例#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))
示例#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))
示例#33
0
文件: system.py 项目: crook/storops
 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)
示例#34
0
 def f():
     port = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A, 8)[0]
     port.ping_node('10.244.211.3', count=1)
示例#35
0
 def test_get_all(self):
     ports = VNXConnectionPort.get(t_cli())
     assert_that(len(ports), equal_to(23))
示例#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')
示例#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))
示例#38
0
 def test_get_by_sp(self):
     ports = VNXConnectionPort.get(t_cli(), VNXSPEnum.SP_A)
     assert_that(len(ports), equal_to(13))
示例#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))
示例#40
0
 def test_port(self):
     return VNXConnectionPort(sp='a', port_id=4, cli=t_cli())
示例#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))
示例#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)
示例#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))