def set_up(self, n_dps, host_links=None, host_vlans=None): super(FaucetSingleUntaggedIPV4RoutingWithStackingTest, self).setUp() n_vlans = 3 routed_vlans = 2 stack_roots = {0: 1} dp_links = FaucetTopoGenerator.dp_links_networkx_graph( networkx.path_graph(n_dps)) if not host_links and not host_vlans: host_links, host_vlans = FaucetTopoGenerator.untagged_vlan_hosts( n_dps, routed_vlans) vlan_options = {} for v in range(routed_vlans): vlan_options[v] = { 'faucet_mac': self.faucet_mac(v), 'faucet_vips': [self.faucet_vip(v)], 'targeted_gw_resolution': False } dp_options = {dp: self.get_dp_options() for dp in range(n_dps)} routers = {0: [v for v in range(routed_vlans)]} self.build_net(n_dps=n_dps, n_vlans=n_vlans, dp_links=dp_links, host_links=host_links, host_vlans=host_vlans, stack_roots=stack_roots, vlan_options=vlan_options, dp_options=dp_options, routers=routers) self.start_net()
def set_up(self, n_dps, n_vlans, dp_links, stack_roots, host_links=None, host_vlans=None, host_options=None): """ Args: n_dps: Number of DPS to generate n_vlans: Number of VLANs to generate dp_links (dict): Topology to deploy stack_roots (dict): Stack root values for respective stack root DPS host_links (dict): (optional) host_vlans (dict): (optional) host_options (dict): (optional) """ super(FaucetFaultToleranceBaseTest, self).setUp() if not host_links or not host_vlans: host_links, host_vlans = FaucetTopoGenerator.untagged_vlan_hosts( n_dps, n_vlans) vlan_options = {} if n_vlans >= 2: for i in range(n_vlans): vlan_options[i] = { 'faucet_mac': self.faucet_mac(i), 'faucet_vips': [self.faucet_vip(i)], 'targeted_gw_resolution': False } dp_options = {} if n_vlans >= 2: for i in range(n_dps): dp_options[i] = { 'drop_spoofed_faucet_mac': False, 'arp_neighbor_timeout': 2, 'max_resolve_backoff_time': 2, 'proactive_learn_v4': True } routers = {} if n_vlans >= 2: routers = {0: list(range(n_vlans))} self.build_net(n_dps=n_dps, n_vlans=n_vlans, dp_links=dp_links, host_links=host_links, host_vlans=host_vlans, stack_roots=stack_roots, vlan_options=vlan_options, dp_options=dp_options, routers=routers, host_options=host_options) self.start_net()