From 2e7d54add06d49a624314276573eef1bdf5479ec Mon Sep 17 00:00:00 2001 From: yoguo Date: Tue, 18 Feb 2025 14:48:35 +0800 Subject: [PATCH] Fix the issue when getting the active nic --- os_tests/libs/utils_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os_tests/libs/utils_lib.py b/os_tests/libs/utils_lib.py index 9e7b865..c7c27cf 100644 --- a/os_tests/libs/utils_lib.py +++ b/os_tests/libs/utils_lib.py @@ -1964,7 +1964,7 @@ def collect_kmemleak(test_instance=None): test_instance.log.info('Memory leak found!') def get_active_nic(test_instance=None, rmt_node=None, vm=None): - cmd = "sudo ip link show|grep mtu|grep -v lo|awk -F':' '{print $2}'" + cmd = "sudo ip link show|grep mtu|grep -v lo|awk -F': ' '{print $2}'" output = run_cmd(test_instance, cmd, rmt_node=rmt_node, vm=vm) test_instance.active_nic = "eth0" test_instance.log.info("Test which nic connects to public") @@ -1973,7 +1973,7 @@ def get_active_nic(test_instance=None, rmt_node=None, vm=None): if len(net) < 3: continue cmd = "sudo ping {} -c 6 -I {}".format(test_instance.params.get('ping_server'), net) - ret = run_cmd(test_instance, cmd, rmt_node=rmt_node, vm=vm) + ret = run_cmd(test_instance, cmd, ret_status=True, rmt_node=rmt_node, vm=vm) if ret == 0: test_instance.active_nic = net nic_found = True