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
示例#2
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
示例#3
0
def topology1():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([2, 3, 4, 5])
    # graph.remove_edges_from([(101,103),(103,104),(104,106)])
    return graph
示例#4
0
def topology3():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([3, 5])
    # graph.remove_edges_from([(101,103),(103,104),(104,106)])
    policy = shortest_path_policy(graph)
    return graph
def topology1():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([2,3,4,5])
    # graph.remove_edges_from([(101,103),(103,104),(104,106)])
    return graph
def topology3():
    graph = Topology().nx_graph()
    graph.remove_nodes_from([3,5])
    # graph.remove_edges_from([(101,103),(103,104),(104,106)])        
    policy = shortest_path_policy(graph)
    return graph