Signed-off-by: Amos Kong <[email protected]>
---
 client/tests/kvm/tests/ethtool.py |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/client/tests/kvm/tests/ethtool.py 
b/client/tests/kvm/tests/ethtool.py
index cc4d475..56277bd 100644
--- a/client/tests/kvm/tests/ethtool.py
+++ b/client/tests/kvm/tests/ethtool.py
@@ -102,15 +102,18 @@ def run_ethtool(test, params, env):
         logging.info("Creat file in source host, cmd: %s" % dd_cmd)
         tcpdump_cmd = "tcpdump -lep -s 0 tcp -vv port ssh"
         if src == "guest":
-            session.cmd_output(dd_cmd, timeout=360)
+            try:
+                session.cmd_output(dd_cmd, timeout=360)
+            except:
+                return (False, "Fail to create file by dd, cmd: %s" % dd_cmd)
             tcpdump_cmd += " and src %s" % guest_ip
             copy_files_from = vm.copy_files_from
         else:
             s, o = commands.getstatusoutput(dd_cmd)
             tcpdump_cmd += " and dst %s" % guest_ip
             copy_files_from = vm.copy_files_to
-        if s != 0:
-            return (False, "Fail to create file by dd, cmd: %s" % dd_cmd)
+            if s != 0:
+                return (False, "Fail to create file by dd, cmd: %s" % dd_cmd)
 
         # only capture the new tcp port after offload setup
         original_tcp_ports = re.findall("tcp.*:(\d+).*%s" % guest_ip,

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to