MCPcopy Create free account
hub / github.com/FDio/vpp / setUpClass

Method setUpClass

test/test_l2bd_multi_instance.py:81–121  ·  view source on GitHub ↗

Perform standard class setup (defined by class method setUpClass in class VppTestCase) before running the test case, set test case related variables and configure VPP.

(cls)

Source from the content-addressed store, hash-verified

79
80 @classmethod
81 def setUpClass(cls):
82 """
83 Perform standard class setup (defined by class method setUpClass in
84 class VppTestCase) before running the test case, set test case related
85 variables and configure VPP.
86 """
87 super(TestL2bdMultiInst, cls).setUpClass()
88
89 try:
90 # Create pg interfaces
91 n_bd = 5
92 cls.ifs_per_bd = ifs_per_bd = 3
93 n_ifs = n_bd * ifs_per_bd
94 cls.create_pg_interfaces(range(n_ifs))
95
96 # Packet flows mapping pg0 -> pg1, pg2 etc.
97 cls.flows = dict()
98 for b in range(n_bd):
99 bd_ifs = cls.bd_if_range(b + 1)
100 for j in bd_ifs:
101 cls.flows[cls.pg_interfaces[j]] = [
102 cls.pg_interfaces[x] for x in bd_ifs if x != j
103 ]
104 assert len(cls.flows[cls.pg_interfaces[j]]) == ifs_per_bd - 1
105
106 # Mapping between packet-generator index and lists of test hosts
107 cls.hosts_by_pg_idx = dict()
108
109 # Create test host entries
110 cls.create_hosts(5)
111
112 # Packet sizes - jumbo packet (9018 bytes) skipped
113 cls.pg_if_packet_sizes = [64, 512, 1518]
114
115 # Set up all interfaces
116 for i in cls.pg_interfaces:
117 i.admin_up()
118
119 except Exception:
120 super(TestL2bdMultiInst, cls).tearDownClass()
121 raise
122
123 @classmethod
124 def tearDownClass(cls):

Callers

nothing calls this directly

Calls 5

create_pg_interfacesMethod · 0.80
bd_if_rangeMethod · 0.80
create_hostsMethod · 0.45
admin_upMethod · 0.45
tearDownClassMethod · 0.45

Tested by

no test coverage detected