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

        # Get a tree connecting sw1, sw8, and sw6
        nodes = ['sw1', 'sw8', 'sw6']
        tree = man.find_valid_steiner_tree(nodes)

        # Should work
        vlan = man.find_vlan_on_tree(tree)
コード例 #2
0
    def test_reserve_on_invalid(self):
        man = TopologyManager(STEINER_NO_LOOP_CONFIG_FILE)
        topo = man.get_topology()

        # Get a tree connecting sw1, sw8, and sw6
        nodes = ['sw1', 'sw8', 'sw6']
        tree = man.find_valid_steiner_tree(nodes)

        # Should work
        vlan = man.find_vlan_on_tree(tree)

        # Should work
        man.reserve_vlan_on_tree(tree, vlan)

        # Should work
        self.failUnlessRaises(Exception, man.reserve_vlan_on_tree, tree, vlan)