|
5 | 5 | from decimal import Decimal |
6 | 6 | from enum import Enum |
7 | 7 | from functools import partial |
| 8 | +from pathlib import PurePath |
8 | 9 | from typing import Any, Dict, List, Optional, Tuple, Union |
9 | 10 |
|
10 | 11 | from assertpy import assert_that, fail |
|
30 | 31 | from lisa.operating_system import OperatingSystem, Ubuntu |
31 | 32 | from lisa.testsuite import TestResult |
32 | 33 | from lisa.tools import ( |
| 34 | + Cp, |
33 | 35 | Dmesg, |
34 | 36 | Echo, |
35 | 37 | Firewall, |
@@ -1292,6 +1294,33 @@ def get_port_info(self, nics: List[NicInfo], expect_ports: int = 1) -> str: |
1292 | 1294 | return self.port_mask |
1293 | 1295 |
|
1294 | 1296 |
|
| 1297 | +# TODO: remove this method in 2028 when all updated versions are LTS |
| 1298 | +def _apply_workaround_for_symmetric_mp_main(node: Node) -> None: |
| 1299 | + # workaround for unmerged code in dpdk project |
| 1300 | + # replace symmetric_mp main.c with patched version |
| 1301 | + symmetric_mp_local_dir = PurePath(__file__).parent.joinpath("symmetric_mp") |
| 1302 | + symmetric_mp_patched_main_c = "symmetric-mp-patched-main.c" |
| 1303 | + node.shell.copy( |
| 1304 | + symmetric_mp_local_dir.joinpath(symmetric_mp_patched_main_c), |
| 1305 | + node.working_path, |
| 1306 | + ) |
| 1307 | + symmetric_mp_remote = ( |
| 1308 | + "/usr/local/share/dpdk/examples/multi_process/symmetric_mp/main.c" |
| 1309 | + ) |
| 1310 | + node.tools[Cp].run( |
| 1311 | + ( |
| 1312 | + f"{str(node.working_path.joinpath(symmetric_mp_patched_main_c))} " |
| 1313 | + f"{symmetric_mp_remote}" |
| 1314 | + ), |
| 1315 | + force_run=True, |
| 1316 | + sudo=True, |
| 1317 | + expected_exit_code=0, |
| 1318 | + expected_exit_code_failure_message=( |
| 1319 | + "Could not copy patched symmetric_mp main.c to examples folder." |
| 1320 | + ), |
| 1321 | + ) |
| 1322 | + |
| 1323 | + |
1295 | 1324 | def run_dpdk_symmetric_mp( |
1296 | 1325 | node: Node, |
1297 | 1326 | log: Logger, |
@@ -1351,6 +1380,11 @@ def run_dpdk_symmetric_mp( |
1351 | 1380 | "DPDK symmetric_mp test is not implemented for " |
1352 | 1381 | " package manager installation." |
1353 | 1382 | ) |
| 1383 | + |
| 1384 | + # NOTE: apply workaround for unmerged change to main.c |
| 1385 | + # needed to run symmetric_mp on MANA for now. |
| 1386 | + _apply_workaround_for_symmetric_mp_main(node) |
| 1387 | + |
1354 | 1388 | symmetric_mp_path = testpmd.get_example_app_path("multi_process/symmetric_mp") |
1355 | 1389 |
|
1356 | 1390 | # setup the DPDK EAL arguments for netvsc |
|
0 commit comments