def stress_test(inp=None, n=256): """Run a stress test, for profiling. can use inp=(topo, zip(slices, policies)) if you already have it. Otherwise, uses the n-ary break_vlans graph and slices. """ if inp is None: from examples import break_vlans, policy_gen topo, slices = break_vlans.get_slices(n=n) policies = [policy_gen.flood(s.l_topo, all_ports=True) for s in slices] combined = zip(slices, policies) else: topo, combined = inp transformed = transform(topo, combined, verbose=True)
def flood(topo): return pg.flood(topo)