예제 #1
0
    def reboot_spine0_switch(self):
        d0 = Device(cfg.spine0['id'])
        rp_spine0 = RemotePower(cfg.spine0_power)

        rp_spine0.OffOn()

        wait_for_seconds(60)

        links_inspect(cfg.spines, cfg.leaves)
예제 #2
0
    def runTest(self):
        s1_vlan_id = 200
        ports = sorted(config["port_map"].keys())

        cfg.leaf1['portA'].tagged(True)

        t1 = (
            Tenant('t1')
            .segment('s1', 'vlan', [], s1_vlan_id)
            .segment_member(
                SegmentMember('s1', cfg.leaf0['id'])
                .mac_based_vlan(['{}/48'.format(cfg.host0['mac'])])
            )
            .segment_member(
                SegmentMember('s1', cfg.leaf1['id'])
                .ports([cfg.leaf1['portA'].name])
            )
            .build()
        )

        def test_by_packet():
            pkt_from_p0_to_p2 = str(simple_tcp_packet(
                dl_vlan_enable=True,
                vlan_vid=s1_vlan_id,
                eth_dst=cfg.host2['mac'],
                eth_src=cfg.host0['mac'],
                ip_dst=cfg.host2['ip'],
                ip_src=cfg.host0['ip']
            ))

            self.dataplane.send(ports[0], pkt_from_p0_to_p2)
            verify_packet(self, pkt_from_p0_to_p2, ports[2])

        test_by_packet()

        d0 = Device(cfg.leaf0['id'])
        rp_leaf0 = RemotePower(cfg.leaf0_power)
        rp_leaf0.OffOn()

        wait_for_seconds(60)

        assert d0.available == False, "d0 device's avaiable shall be false"

        links_inspect(cfg.spines, cfg.leaves)

        test_by_packet()

        t1.destroy()
    def runTest(self):
        d0 = Device(cfg.spine0['id'])
        d1 = Device(cfg.spine1['id'])

        assert d0.available, "d0 device's avaiable shall be true"
        assert d1.available, "d1 device's avaiable shall be true"

        rp_spine0 = RemotePower(cfg.spine0_power)
        rp_spine1 = RemotePower(cfg.spine1_power)

        # turn off spine0
        rp_spine0.Off()
        wait_for_seconds(60)
        rp_spine0.On()

        assert d0.available == False, "d0 device's avaiable shall be false"

        links_inspect([cfg.spine1], [cfg.leaf0, cfg.leaf1])

        assert d1.available, "d1 device's avaiable shall be true"

        # wait for spine0 resume
        links_inspect([cfg.spine0, cfg.spine1], [cfg.leaf0, cfg.leaf1])

        assert d0.available, "d0 device's avaiable shall be true"
        assert d1.available, "d1 device's avaiable shall be true"

        # turn off spine1
        rp_spine1.Off()
        wait_for_seconds(60)
        rp_spine1.On()

        links_inspect([cfg.spine0], [cfg.leaf0, cfg.leaf1])

        assert d0.available, "d1 device's avaiable shall be true"

        # wait for spine1 resume
        links_inspect([cfg.spine0, cfg.spine1], [cfg.leaf0, cfg.leaf1])

        assert d0.available, "d0 device's avaiable shall be true"
        assert d1.available, "d1 device's avaiable shall be true"
    def spine_link_down_up_verify(self, verify_func, wait_time=60):
        verify_func()

        rp_spine0 = RemotePower(cfg.spine0_power)
        rp_spine0.OffOn()
        wait_for_seconds(wait_time)

        verify_func()

        # wait spine resume
        links_inspect(cfg.spines, cfg.leaves)

        # the other spine reboot
        rp_spine1 = RemotePower(cfg.spine1_power)
        rp_spine1.OffOn()
        wait_for_seconds(wait_time)

        verify_func()

        # wait spine resume
        links_inspect(cfg.spines, cfg.leaves)
예제 #5
0
    def runTest(self):
        d0 = Device(cfg.spine0['id'])
        d1 = Device(cfg.spine1['id'])

        assert d0.available, "d0 device's avaiable shall be true"
        assert d1.available, "d1 device's avaiable shall be true"

        rp_spine0 = RemotePower(cfg.spine0_power)
        rp_spine1 = RemotePower(cfg.spine1_power)

        rp_spine0.OffOn()
        rp_spine1.OffOn()

        wait_for_seconds(60)

        assert d0.available == False, "d0 device's avaiable shall be false"
        assert d1.available == False, "d1 device's avaiable shall be false"

        links_inspect(cfg.spines, cfg.leaves)

        assert d0.available, "d0 device's avaiable shall be true"
        assert d1.available, "d1 device's avaiable shall be true"
예제 #6
0
    def reboot_switch(self):
        rp_spine0 = RemotePower(cfg.spine0_power)
        rp_spine1 = RemotePower(cfg.spine1_power)
        rp_leaf0 = RemotePower(cfg.leaf0_power)
        rp_leaf1 = RemotePower(cfg.leaf1_power)

        rp_spine0.OffOn()
        rp_spine1.OffOn()
        rp_leaf0.OffOn()
        rp_leaf1.OffOn()

        wait_for_seconds(60)

        links_inspect(cfg.spines, cfg.leaves)

        wait_for_seconds(60)