コード例 #1
0
    def test_reserve_on_empty(self):
        man = TopologyManager(CONFIG_FILE)
        topo = man.get_topology()

        # Get a path
        path = nx.shortest_path(topo, source="atl-switch", target="mia-switch")

        # Reserve path on VLAN 1
        man.reserve_vlan_on_path(path, 1)
コード例 #2
0
    def test_unreserve_vlan(self):
        # Get a path
        man = TopologyManager(CONFIG_FILE)
        topo = man.get_topology()

        # Get a path
        path = nx.shortest_path(topo, source="atl-switch", target="mia-switch")

        # Reserve path on VLAN 1
        man.reserve_vlan_on_path(path, 1)

        # Reserve path on VLAN 1
        self.failUnlessRaises(Exception, man.reserve_vlan_on_path, path, 1)
        # Should throw an exception

        # Unreserve path
        man.unreserve_vlan_on_path(path, 1)

        # This should pass:
        man.reserve_vlan_on_path(path, 1)