- if dut_node[u"type"] == NodeType.DUT:
- pci_address1 = Topology.get_interface_pci_addr(dut_node, dut_if1)
- if1_driver = Topology.get_interface_driver(dut_node, dut_if1)
- pci_address2 = Topology.get_interface_pci_addr(dut_node, dut_if2)
- if2_driver = Topology.get_interface_driver(dut_node, dut_if2)
-
- ssh = SSH()
- ssh.connect(dut_node)
-
- cmd = f"{Constants.REMOTE_FW_DIR}/tests/dpdk/dpdk_scripts" \
- f"/cleanup_dpdk.sh {if1_driver} {pci_address1} {if2_driver} " \
- f"{pci_address2}"
-
- ret_code, _, _ = ssh.exec_command_sudo(cmd, timeout=1200)
- if ret_code != 0:
- raise RuntimeError(
- f"Failed to cleanup the dpdk at node {dut_node[u'host']}"
- )
+ if node[u"type"] == NodeType.DUT:
+ pci_address1 = Topology.get_interface_pci_addr(node, if1)
+ pci_address2 = Topology.get_interface_pci_addr(node, if2)
+ # We are not supporting more than one driver yet.
+ nic_driver = Topology.get_interface_driver(node, if1)
+
+ command = f"{Constants.REMOTE_FW_DIR}/{Constants.RESOURCES_LIB_SH}"\
+ f"/entry/cleanup_dpdk.sh " \
+ f"{nic_driver} {pci_address1} {pci_address2}"
+ message = u"Cleanup the DPDK failed!"
+ exec_cmd_no_error(node, command, timeout=1200, message=message)