Exemplo n.º 1
0
 def test_get_properties(self):
     port = UnityEthernetPort('spa_eth3', cli=t_rest())
     assert_that(port.name, equal_to('SP A Ethernet Port 3'))
     assert_that(port.mac_address, equal_to("00:60:16:5C:07:0A"))
     assert_that(port.parent_storage_processor,
                 equal_to(UnityStorageProcessor('spa', cli=t_rest())))
     assert_that(port.mtu, equal_to(1500))
     assert_that(port.requested_mtu, equal_to(1500))
     assert_that(port.connector_type, equal_to(ConnectorTypeEnum.RJ45))
     assert_that(
         port.supported_speeds,
         only_contains(EPSpeedValuesEnum.AUTO, EPSpeedValuesEnum._100MbPS,
                       EPSpeedValuesEnum._1GbPS, EPSpeedValuesEnum._10GbPS))
     assert_that(port.supported_mtus, only_contains(1500, 9000))
     assert_that(port.speed, equal_to(None))
     assert_that(port.needs_replacement, equal_to(False))
     assert_that(port.is_link_up, equal_to(False))
     assert_that(port.bond, equal_to(False))
Exemplo n.º 2
0
 def test_get_properties_io_module_port(self):
     port = UnityEthernetPort('spa_iom_0_eth0', cli=t_rest())
     assert_that(port.name, equal_to('SP A I/O Module 0 Ethernet Port 0'))
     assert_that(port.mac_address, equal_to("00:60:16:57:EC:58"))
     assert_that(port.parent_storage_processor,
                 equal_to(UnityStorageProcessor('spa', cli=t_rest())))
     assert_that(port.mtu, equal_to(1500))
     assert_that(port.requested_mtu, equal_to(0))
     assert_that(port.connector_type, equal_to(ConnectorTypeEnum.LC))
     assert_that(
         port.supported_speeds,
         only_contains(EPSpeedValuesEnum.AUTO, EPSpeedValuesEnum._100MbPS,
                       EPSpeedValuesEnum._1GbPS, EPSpeedValuesEnum._10GbPS))
     assert_that(port.supported_mtus, only_contains(1500, 9000))
     assert_that(port.speed, equal_to(EPSpeedValuesEnum._10GbPS))
     assert_that(port.needs_replacement, equal_to(False))
     assert_that(port.is_link_up, equal_to(True))
     assert_that(port.bond, equal_to(False))
Exemplo n.º 3
0
 def test_modify(self):
     la = UnityLinkAggregation.get(t_rest(), 'spa_la_2')
     la.modify(mtu=1500,
               remove_ports=[UnityEthernetPort.get(t_rest(), "spa_eth2")],
               add_ports=[UnityEthernetPort.get(t_rest(), "spa_eth4")])
Exemplo n.º 4
0
 def do():
     eth_2 = UnityEthernetPort.get(t_rest(), 'spa_eth2')
     eth_4 = UnityEthernetPort.get(t_rest(), 'spa_eth4')
     UnityLinkAggregation.create(t_rest(), [eth_2, eth_4], 1500)
Exemplo n.º 5
0
 def test_create(self):
     eth_2 = UnityEthernetPort.get(t_rest(), 'spa_eth2')
     eth_3 = UnityEthernetPort.get(t_rest(), 'spa_eth3')
     la = UnityLinkAggregation.create(t_rest(), [eth_2, eth_3], 9000)
     assert_that(la.get_id(), equal_to('spa_la_2'))
Exemplo n.º 6
0
 def test_get_peer(self, port_id, peer_id):
     port = UnityEthernetPort(cli=t_rest(), _id=port_id)
     peer = port.get_peer()
     assert_that(peer.get_id(), equal_to(peer_id))
Exemplo n.º 7
0
 def test_modify_when_peer_not_exist(self):
     port = UnityEthernetPort(cli=t_rest(), _id='spa_eth4')
     port.modify(mtu=1500)
Exemplo n.º 8
0
 def do():
     port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3')
     port.modify(speed=40000)
Exemplo n.º 9
0
 def test_modify_speed_to_same_value(self):
     port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3')
     port.modify(speed=EPSpeedValuesEnum.AUTO)
Exemplo n.º 10
0
 def test_modify_speed(self):
     port = UnityEthernetPort(cli=t_rest(), _id='spa_eth3')
     port.modify(speed=100)
Exemplo n.º 11
0
 def test_modify_mtu_to_same_value(self):
     port = UnityEthernetPort(cli=t_rest(), _id='spb_eth3')
     port.modify(mtu=1500)
Exemplo n.º 12
0
 def test_modify_mtu(self):
     port = UnityEthernetPort(cli=t_rest(), _id='spa_eth3')
     port.modify(mtu=9000)