Skip to content

Commit ef780d0

Browse files
committed
Fix dual basic tests
1 parent fb419de commit ef780d0

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

tests/validation/mtl_engine/RxTxApp.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ def add_dual_interfaces(
14821482
tx_config["interfaces"][0]["name"] = tx_nic_port_list[0]
14831483

14841484
# Configure RX host interface only
1485-
rx_config["interfaces"][0]["name"] = rx_nic_port_list[1]
1485+
rx_config["interfaces"][0]["name"] = rx_nic_port_list[0]
14861486

14871487
if test_mode == "unicast":
14881488
tx_config["interfaces"][0]["ip"] = unicast_ip_dict["tx_interfaces"]
@@ -1673,20 +1673,27 @@ def execute_dual_test(
16731673
tx_config = config["tx_config"]
16741674
rx_config = config["rx_config"]
16751675

1676+
tx_config_json = json.dumps(tx_config, indent=4)
1677+
rx_config_json = json.dumps(rx_config, indent=4)
1678+
16761679
# Log test start
16771680
logger.info(f"Starting dual RxTxApp test: {get_case_id()}")
16781681
log_to_file(f"Starting dual RxTxApp test: {get_case_id()}", tx_host, build)
16791682
log_to_file(f"Starting dual RxTxApp test: {get_case_id()}", rx_host, build)
1680-
log_to_file(f"TX config: {json.dumps(tx_config, indent=4)}", tx_host, build)
1681-
log_to_file(f"RX config: {json.dumps(rx_config, indent=4)}", rx_host, build)
1683+
log_to_file(f"TX config: {tx_config_json}", tx_host, build)
1684+
log_to_file(f"RX config: {rx_config_json}", rx_host, build)
16821685

16831686
# Prepare TX config
1687+
tx_config_file = f"{build}/tests/tx_config.json"
16841688
tx_f = tx_host.connection.path(build, "tests", "tx_config.json")
1685-
tx_f.write_text(tx_config, encoding="utf-8")
1689+
tx_json_content = tx_config_json.replace('"', '\\"')
1690+
tx_f.write_text(tx_json_content)
16861691

16871692
# Prepare RX config
1688-
rx_f = tx_host.connection.path(build, "tests", "rx_config.json")
1689-
rx_f.write_text(rx_config, encoding="utf-8")
1693+
rx_config_file = f"{build}/tests/rx_config.json"
1694+
rx_f = rx_host.connection.path(build, "tests", "rx_config.json")
1695+
rx_json_content = rx_config_json.replace('"', '\\"')
1696+
rx_f.write_text(rx_json_content)
16901697

16911698
# Adjust test_time for high-res/fps/replicas
16921699
if (
@@ -1710,8 +1717,8 @@ def execute_dual_test(
17101717
if ptp:
17111718
base_command += " --ptp"
17121719

1713-
tx_command = f"{base_command} --config_file {tx_config}"
1714-
rx_command = f"{base_command} --config_file {rx_config}"
1720+
tx_command = f"{base_command} --config_file {tx_config_file}"
1721+
rx_command = f"{base_command} --config_file {rx_config_file}"
17151722

17161723
logger.info(f"TX Command: {tx_command}")
17171724
logger.info(f"RX Command: {rx_command}")

0 commit comments

Comments
 (0)