Beispiel #1
0
def test_verification():
    graph = Topology().nx_graph()
    graph.remove_edges_from([(101, 102), (103, 104), (105, 106)])
    policy = shortest_path_policy(graph)

    # Induce a loop
    conf = policy.get_configuration(106)
    conf.rules.insert(0, Rule({DL_TYPE: 0x800}, [forward(graph.node[106]["ports"][105])]))

    # Verify no loops -- should return false
    model = verification.KripkeModel(graph, policy)
    result, msg = model.verify(verification.NO_LOOPS)
    if not result:
        send_signal("SUCCESS - loop detected.\n")
    else:
        send_signal("FAILURE - loop not detected.\n%s\n" % msg)
    return
Beispiel #2
0
def topology1():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([2, 3, 4, 5])
    return graph
Beispiel #3
0
def topology3():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([3, 5])
    policy = shortest_path_policy(graph)
    return graph