From 4a513f621162786ce952e0b8afd7c29da6c2f283 Mon Sep 17 00:00:00 2001 From: Yumei Huang Date: Tue, 5 Sep 2017 20:21:19 +0800 Subject: [PATCH] Improve the process of sr_iov_setup Signed-off-by: Yumei Huang --- virttest/test_setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/virttest/test_setup.py b/virttest/test_setup.py index 7e91189702..3b045fc32d 100644 --- a/virttest/test_setup.py +++ b/virttest/test_setup.py @@ -1475,7 +1475,7 @@ def sr_iov_setup(self): time.sleep(3) re_probe = False # If driver not available after modprobe try to remove it and reprobe - if process.system("lsmod | grep %s" % self.driver, ignore_status=True, + if process.system("lsmod | grep -w %s" % self.driver, ignore_status=True, shell=True): re_probe = True # If driver is available then set VFs for ppc64le @@ -1496,7 +1496,7 @@ def sr_iov_setup(self): # Re-probe driver with proper number of VFs once more and raise # exception if re_probe: - if not self.remove_driver() and not self.modprobe_driver(): + if not self.remove_driver() or not self.modprobe_driver(): return False if ARCH == 'ppc64le' and self.driver == 'mlx5_core': set_ip = 0