Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/common/platform/device_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,7 @@ def add_platform_api_server_port_nat_for_dpu(
The NAT rule is added before the test and removed after the test.
'''
duthost = duthosts[enum_rand_one_per_hwsku_hostname]
if duthost.is_dpu():
if duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu"):
ip_interface_status = duthost.show_and_parse('show ip interface')
for item in ip_interface_status:
if item['interface'] == "eth0-midplane":
Expand All @@ -1162,7 +1162,7 @@ def add_platform_api_server_port_nat_for_dpu(

yield

if duthost.is_dpu():
if duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu"):
npu_host.command(
f'sudo iptables -t nat -D PREROUTING -i eth0 -p tcp --dport \
{SERVER_PORT} -j DNAT --to-destination {dpu_ip}:{SERVER_PORT}')
Expand Down
3 changes: 2 additions & 1 deletion tests/platform_tests/api/test_watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def test_arm_disarm_states(self, duthosts, enum_rand_one_per_hwsku_hostname, loc
self.expect(remaining_time is -1,
"Watchdog remaining_time {} seconds is wrong for disarmed state".format(remaining_time))

ansible_ssh_port = get_ansible_ssh_port(duthost, ansible_adhoc) if duthost.is_dpu() else 22
is_dpu = duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu")
ansible_ssh_port = get_ansible_ssh_port(duthost, ansible_adhoc) if is_dpu else 22
res = localhost.wait_for(host=duthost.mgmt_ip, port=ansible_ssh_port, state="stopped", delay=5,
timeout=watchdog_timeout + TIMEOUT_DEVIATION, module_ignore_errors=True)

Expand Down
4 changes: 2 additions & 2 deletions tests/show_techsupport/test_techsupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def skip_on_dpu(duthosts, enum_rand_one_per_hwsku_frontend_hostname):
When dut is dpu, skip the case
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
if duthost.get_facts().get('is_dpu'):
if duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu"):
pytest.skip("Skip the test, as it is not supported on DPU.")


Expand Down Expand Up @@ -620,7 +620,7 @@ def test_techsupport_on_dpu(duthosts, enum_rand_one_per_hwsku_frontend_hostname)
:param duthosts: DUT host
"""
duthost = duthosts[enum_rand_one_per_hwsku_frontend_hostname]
if not duthost.get_facts().get('is_dpu'):
if not duthost.dut_basic_facts()['ansible_facts']['dut_basic_facts'].get("is_dpu"):
pytest.skip("Skip the test, as it is supported only on DPU.")

since = str(randint(1, 5)) + " minute ago"
Expand Down
Loading