Example #1
0
def test_3n_l0_l1_l2():
    passive_nodes = os.getenv("RIFT_PASSIVE_NODES", "").split(",")
    # Bring topology up
    les = LogExpectSession()
    res = RiftExpectSession("3n_l0_l1_l2")
    # Check that node1-node2 and node2-node3 adjacencies reaches 3-way
    if "node1" not in passive_nodes:
        check_rift_node1_intf_up(res)
        check_log_node1_intf_up(les)
    if "node2" not in passive_nodes:
        check_rift_node2_intf_up(res)
        check_log_node2_intf_up(les)
    if "node3" not in passive_nodes:
        check_rift_node3_intf_up(res)
        check_log_node3_intf_up(les)
    if "node1" not in passive_nodes:
        # Bring interface if1 on node1 down
        res.interface_failure("node1", "if1", "failed")
        check_rift_node1_intf_down(res)
        check_log_node1_intf_down(res)
        if "node2" not in passive_nodes:
            check_rift_node2_intf_down(res)
            check_log_node2_intf_down(res)
        if "node3" not in passive_nodes:
            check_rift_node3_intf_down(res)
            check_log_node3_intf_down(res)
    # TODO: add test cases for bringing interface node2-node3 down
    # Done
    res.stop()
Example #2
0
def test_neg_disagg_spf():
    # Disable debug logging for large topologies such as multiple (it makes convergence too slow)
    res = RiftExpectSession("multiplane",
                            start_converge_secs=45.0,
                            reconverge_secs=20.0,
                            log_debug=False)

    # E-W neighbors should not be present in south SPF
    check_ew_absence_in_south_spf(res)
    # E-W neighbors must be present in special SPF
    check_ew_in_special_spf(res)

    # Break spine_1_1_1 interfaces connected to ToFs to reach a fallen leaf situation
    res.interface_failure(node="spine_1_1_1",
                          interface="if2",
                          failure="failed")
    res.interface_failure(node="spine_1_1_1",
                          interface="if3",
                          failure="failed")

    # Check that leaf_1_0_1 and leaf_1_0_2 are not reachable
    # with south SPF of tof_1_1_1 and tof_1_2_2
    check_fall_leafs_s_spf(res)

    # Check that leaf_1_0_1 and leaf_1_0_2 are reachable
    # using special SPF of tof_1_1_1 and tof_1_2_2
    check_fall_leafs_sp_spf(res)

    res.stop()
Example #3
0
def test_neg_disagg_spf_propagation():
    # Disable debug logging for large topologies such as multiple (it makes convergence too slow)
    res = RiftExpectSession("multiplane",
                            start_converge_secs=45.0,
                            reconverge_secs=30.0,
                            log_debug=False)

    # Break spine_1_1_1 interfaces connected to tof_1_2_1 (so a next hop should be removed from SPF)
    res.interface_failure(node="spine_1_1_1",
                          interface="if2",
                          failure="failed")

    # Check that spines lost a positive next hop for the negative disaggregated prefixes
    check_spine_positive_next_hops(res)

    # Break last spine_1_1_1 interface to reach a fallen leaf situation with first ToF plane
    res.interface_failure(node="spine_1_1_1",
                          interface="if3",
                          failure="failed")

    # Check that each spine loses all the positive next hops for the negative disaggregated prefixes
    # and computes only negative next hops
    check_spine_negative_disagg_spf(res)

    # Check that each leaf computed a negative next hops for the negative disaggregated prefixes
    check_leaf_negative_next_hops(res)

    res.stop()
def test__large__neg_disagg():
    # __large__  means: don't run this test in a constrained environment (e.g. a small laptop)

    # Disable debug logging for large topologies such as multiple (it makes convergence too slow)
    res = RiftExpectSession("multiplane",
                            start_converge_secs=45.0,
                            reconverge_secs=20.0,
                            log_debug=False)

    # E-W neighbors should not be present in south SPF
    check_ew_absence_in_south_spf(res)

    # E-W neighbors must be present in special SPF
    check_ew_in_special_spf(res)

    # Break spine_1_1_1 interfaces connected to tof_1_2_1 (so a next hop should be removed from SPF)
    res.interface_failure(node="spine_1_1_1",
                          interface="if2",
                          failure="failed")

    # Check that spines lost a positive next hop for the negative disaggregated prefixes
    check_spine_positive_next_hops(res)

    # Break last spine_1_1_1 interface to reach a fallen leaf situation with first ToF plane
    res.interface_failure(node="spine_1_1_1",
                          interface="if3",
                          failure="failed")

    # Check that leaf_1_0_1 and leaf_1_0_2 are not reachable with south SPF of tof_1_1_1 and
    # tof_1_2_2
    check_fall_leafs_s_spf(res)

    # Check that leaf_1_0_1 and leaf_1_0_2 are reachable using special SPF of tof_1_1_1 and
    # tof_1_2_2
    check_fall_leafs_sp_spf(res)

    # Check that each spine loses all the positive next hops for the negative disaggregated prefixes
    # and computes only negative next hops
    check_spine_negative_disagg_spf(res)

    # Check that each leaf computed a negative next hops for the negative disaggregated prefixes
    check_leaf_negative_next_hops(res)

    # Both ToFs of plane 1 should store neg disagg TIE
    check_neg_tie_in_tof(res)

    # Spines should store the neg disagg TIE
    check_neg_tie_in_spines(res)

    # Neg disagg TIE should be also propagated from spine to leafs
    check_neg_tie_in_leafs(res)

    res.stop()
Example #5
0
def test_neg_disagg_ties():
    # Disable debug logging for large topologies such as multiple (it makes convergence too slow)
    res = RiftExpectSession("multiplane",
                            start_converge_secs=45.0,
                            reconverge_secs=20.0,
                            log_debug=False)
    # Break spine_1_1_1 interfaces connected to ToFs to reach a fallen leaf situation
    res.interface_failure(node="spine_1_1_1",
                          interface="if2",
                          failure="failed")
    res.interface_failure(node="spine_1_1_1",
                          interface="if3",
                          failure="failed")
    # Both ToFs of plane 1 should store neg disagg TIE
    check_neg_tie_in_tof(res)
    # Spines should store the neg disagg TIE
    check_neg_tie_in_spines(res)
    # Neg disagg TIE should be also propagated from spine to leafs
    check_neg_tie_in_leafs(res)
    res.stop()
Example #6
0
def test_2n_l0_l1():
    passive_nodes = os.getenv("RIFT_PASSIVE_NODES", "").split(",")
    # Bring topology up
    les = LogExpectSession()
    res = RiftExpectSession("2n_l0_l1")
    # Check that adjacency reaches 3-way, check offers, check levels
    if "node1" not in passive_nodes:
        check_rift_node1_intf_up(res)
        check_log_node1_intf_up(les)
    if "node2" not in passive_nodes:
        check_rift_node2_intf_up(res)
        check_log_node2_intf_up(les)
    if "node1" not in passive_nodes:
        # Bring interface if1 on node1 down
        res.interface_failure("node1", "if1", "failed")
        # Check that adjacency goes back to 1-way, check offers, check levels
        check_rift_node1_intf_down(res)
        check_log_node1_intf_down(les)
        if "node2" not in passive_nodes:
            check_rift_node2_intf_down(res)
            check_log_node2_intf_down(les)
    # Done
    res.stop()