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

Function test_func

test/vm_vpp_interfaces.py:93–137  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

91 config.skip_netns_tests, "netns not available or disabled from cli"
92 )
93 def test_func(self):
94 self.logger.debug(f"Starting unittest:{test_name}")
95 self.setUpTestToplogy(test=test, ip_version=ip_version)
96 result = self.set_interfaces_mtu(
97 mtu=mtu,
98 ip_version=ip_version,
99 vpp_interfaces=self.vpp_interfaces,
100 linux_interfaces=self.linux_interfaces,
101 )
102 if "memif" in self.if_types:
103 self.logger.debug("Starting libmemif test_app for memif test")
104 self.memif_process = libmemif_test_app(
105 memif_sock_path=self.get_memif_sock_path(), logger=self.logger
106 )
107 if result is True:
108 # Start an instance of an iperf server using
109 # a unique port. Save the iperf cmdline for
110 # terminating the iperf_server process after the test.
111 self.iperf_cmd = start_iperf(
112 ip_version=ip_version,
113 client_ns=self.client_namespace,
114 server_ns=self.server_namespace,
115 server_only=True,
116 server_args=f"-p {self.iperf_port}",
117 logger=self.logger,
118 )
119 # Send traffic between iperf client & server
120 self.assertTrue(
121 start_iperf(
122 ip_version=ip_version,
123 client_ns=self.client_namespace,
124 server_ns=self.server_namespace,
125 server_ipv4_address=self.server_ip4_address,
126 server_ipv6_address=self.server_ip6_address,
127 client_args=f"-p {self.iperf_port}",
128 client_only=True,
129 duration=2,
130 logger=self.logger,
131 )
132 )
133 else:
134 return unittest.skip(
135 f"Skipping test:{test_name} as mtu:{mtu} is "
136 f"invalid for TCP/IPv{ip_version}"
137 )
138
139 test_func.__name__ = test_name
140 return test_func

Callers

nothing calls this directly

Calls 6

libmemif_test_appFunction · 0.90
start_iperfFunction · 0.90
setUpTestToplogyMethod · 0.80
set_interfaces_mtuMethod · 0.80
skipMethod · 0.80
get_memif_sock_pathMethod · 0.45

Tested by

no test coverage detected