Beispiel #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 == [])
Beispiel #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 == [])
 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
 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
Beispiel #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