Skip to content

Commit e286ad8

Browse files
committed
DPDK: symmetric_mp test
1 parent ca4b648 commit e286ad8

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

Diff for: microsoft/testsuites/dpdk/dpdksuite.py

+27-17
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
Lsmod,
3535
Make,
3636
Modprobe,
37+
Ping,
3738
Timeout,
3839
)
3940
from lisa.tools.hugepages import HugePageSize
@@ -142,6 +143,8 @@ def verify_dpdk_symmetric_mp(
142143
nics = [node.nics.get_nic("eth1"), node.nics.get_nic("eth2")]
143144
test_nic = node.nics.get_secondary_nic()
144145
extra_nics = [nic for nic in nics if nic.name != test_nic.name]
146+
ping = node.tools[Ping]
147+
ping.install()
145148
try:
146149
test_kit = initialize_node_resources(
147150
node,
@@ -158,17 +161,19 @@ def verify_dpdk_symmetric_mp(
158161
# The Testpmd tool doesn't get re-initialized
159162
# even if you invoke it with new arguments.
160163
raise SkippedException(
161-
"DPDK ring_ping test is not implemented for "
164+
"DPDK symmetric_mp test is not implemented for "
162165
" package manager installation."
163166
)
164167
symmetric_mp_path = testpmd.get_example_app_path("dpdk-symmetric_mp")
165168
node.log.debug("\n".join([str(nic) for nic in nics]))
166-
167-
nic_args = (
168-
f'--vdev="{test_nic.pci_slot},'
169-
f"mac={test_nic.mac_addr},"
170-
f'mac={extra_nics[0].mac_addr}"'
171-
)
169+
if node.nics.is_mana_device_present():
170+
nic_args = (
171+
f'--vdev="{test_nic.pci_slot},'
172+
f"mac={test_nic.mac_addr},"
173+
f'mac={extra_nics[0].mac_addr}"'
174+
)
175+
else:
176+
nic_args = f"-b {node.nics.get_primary_nic().pci_slot}"
172177

173178
output = node.execute(
174179
f"{str(testpmd.get_example_app_path('dpdk-devname'))} {nic_args}",
@@ -193,23 +198,28 @@ def verify_dpdk_symmetric_mp(
193198
f"-- -p {hex(port_mask)[2:]} --num-procs 2"
194199
)
195200
primary = node.tools[Timeout].start_with_timeout(
196-
command=f"{str(symmetric_mp_path)} -l 1,2 {symmetric_mp_args} --proc-id 0",
197-
timeout=30,
201+
command=f"{str(symmetric_mp_path)} -l 1 {symmetric_mp_args} --proc-id 0",
202+
timeout=150,
198203
signal=SIGINT,
199204
kill_timeout=30,
200205
)
201206
primary.wait_output("APP: Finished Process Init")
202-
secondary = node.tools[Timeout].run_with_timeout(
203-
command=f"{str(symmetric_mp_path)} -l 3,4 {symmetric_mp_args} --proc-id 1",
204-
timeout=30,
207+
secondary = node.tools[Timeout].start_with_timeout(
208+
command=f"{str(symmetric_mp_path)} -l 2 {symmetric_mp_args} --proc-id 1",
209+
timeout=120,
205210
signal=SIGINT,
206211
kill_timeout=35,
207212
)
208-
assert_that(secondary.exit_code).described_as(
209-
f"Secondary process failure: {secondary.stdout}"
213+
_ = ping.ping_async(
214+
target=test_nic.ip_addr,
215+
nic_name=node.nics.get_primary_nic().name,
216+
count=100,
217+
)
218+
secondary_exit = secondary.wait_result()
219+
assert_that(secondary_exit.exit_code).described_as(
220+
f"Secondary process failure: {secondary_exit.stdout}"
210221
).is_zero()
211222
process_result = primary.wait_result(
212-
timeout=30,
213223
expected_exit_code=0,
214224
expected_exit_code_failure_message="Primary process failed to exit with 0",
215225
)
@@ -218,8 +228,8 @@ def verify_dpdk_symmetric_mp(
218228
f"\nprimary stderr:\n{process_result.stderr}"
219229
)
220230
node.log.debug(
221-
f"Secondary system:\n\n{secondary.stdout}\n"
222-
f"secondary stderr:\n{secondary.stderr}"
231+
f"Secondary system:\n\n{secondary_exit.stdout}\n"
232+
f"secondary stderr:\n{secondary_exit.stderr}"
223233
)
224234

225235
@TestCaseMetadata(

Diff for: microsoft/testsuites/dpdk/dpdktestpmd.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def get_installed_version(self) -> VersionInfo:
266266

267267
def _install(self) -> None:
268268
super()._install()
269-
devname_path = self._node.tools[Git].clone(
269+
_ = self._node.tools[Git].clone(
270270
url="https://github.com/mcgov/devname.git",
271271
cwd=self.asset_path.joinpath("examples"),
272272
dir_name="devname",

0 commit comments

Comments
 (0)