示例#1
0
 def test_hassel_c_no_loop(self):
     if not hassel_c_loaded:
         return
     topo = self._create_loopy_network(cut_loop=True)
     (name_tf_pairs, TTF) = InvariantChecker._get_transfer_functions(topo.switches, topo.network_links)
     loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF, topo.access_links)
     self.assertTrue(loops == [])
示例#2
0
 def test_hassel_c_no_loop(self):
     if not hassel_c_loaded:
         return
     topo = self._create_loopy_network(cut_loop=True)
     (name_tf_pairs, TTF) = InvariantChecker\
                             ._get_transfer_functions(topo.switches, topo.network_links)
     loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF, topo.access_links)
     self.assertTrue(loops == [])
示例#3
0
 def check_loops(simulation):
   import headerspace.applications as hsa
   live_switches = simulation.topology.live_switches
   live_links = simulation.topology.live_links
   (name_tf_pairs, TTF) = InvariantChecker._get_transfer_functions(live_switches, live_links)
   loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF, simulation.topology.access_links)
   violations = [ str(l) for l in loops ]
   violations = list(set(violations))
   return violations
 def check_loops(simulation, check_liveness_first=True):
   import headerspace.applications as hsa
   if check_liveness_first and simulation.controller_manager.all_controllers_down():
     return simulation.controller_manager.cids
   live_switches = simulation.topology.live_switches
   live_links = simulation.topology.live_links
   (name_tf_pairs, TTF) = InvariantChecker._get_transfer_functions(live_switches, live_links)
   loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF, simulation.topology.access_links)
   violations = [ str(l) for l in loops ]
   violations = list(set(violations))
   return violations
示例#5
0
 def check_loops(simulation):
     import headerspace.applications as hsa
     live_switches = simulation.topology.live_switches
     live_links = simulation.topology.live_links
     (name_tf_pairs, TTF) = InvariantChecker._get_transfer_functions(
         live_switches, live_links)
     loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF,
                                      simulation.topology.access_links)
     violations = [str(l) for l in loops]
     violations = list(set(violations))
     return violations
示例#6
0
 def check_loops(simulation, check_liveness_first=True):
     import headerspace.applications as hsa
     if check_liveness_first:
         simulation.controller_manager.check_controller_status()
         if simulation.controller_manager.all_controllers_down():
             return simulation.controller_manager.cids
     live_switches = simulation.topology.live_switches
     live_links = simulation.topology.live_links
     (name_tf_pairs, TTF) = InvariantChecker._get_transfer_functions(
         live_switches, live_links)
     loops = hsa.check_loops_hassel_c(name_tf_pairs, TTF,
                                      simulation.topology.access_links)
     violations = [str(l) for l in loops]
     violations = list(set(violations))
     return violations