def test_arbitrary(self): topologies = [ 1221, 1239, 1755, 3257, 3967, 6461, ] n_contents = 10000 network_cache = 0.1 hit_ratio = 0.2 results = { 1221: 104.43627218934938, 1239: 129.9188933590089, 3257: 102.65934570425449, 1755: 94.2634958382883, 6461: 168.74678558156853, 3967: 132.65163549797435, } for asn in topologies: # Set up topology topo = scenarios.topology_rocketfuel_latency(asn, source_ratio=0.1) scenarios.uniform_cache_placement(topo, n_contents * network_cache) sources = topo.sources() receivers = topo.receivers() req_rates = {v: 1 / len(receivers) for v in receivers} source_content_ratio = {v: 1 / len(sources) for v in sources} # Run experiment and validate results latency = cacheperf.hashrouting_model(topo, "SYMM", hit_ratio, source_content_ratio, req_rates) assert round(abs(results[asn] - latency), 7) == 0
def test_rocketfuel(): t = topology.topology_rocketfuel_latency(1221, 0.1, 20) assert len(t.receivers()) == len(t.graph["icr_candidates"])
def test_rocketfuel(self): t = topology.topology_rocketfuel_latency(1221, 0.1, 20) self.assertEqual(len(t.receivers()), len(t.graph['icr_candidates']))