]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa: Add exception handling around qemu process cleanup
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 25 Jul 2015 22:13:55 +0000 (22:13 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 25 Jul 2015 22:15:38 +0000 (23:15 +0100)
The qemu processes may no longer exist at the end of the test so
don't error if that is the case by ignoring any exceptions.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/imagefeatures.py

index 82ea164de10b2ae00d98f5f8e2bd2885bd16cc06..1795b7bcf31825da29710f84b22e8a31cabc215f 100644 (file)
@@ -68,7 +68,10 @@ class ImageFeatures(oeSelfTest):
             proc_ssh.terminate()
 
         # Cleanup
-        killpg(proc_qemu.pid, signal.SIGTERM)
+        try:
+            killpg(proc_qemu.pid, signal.SIGTERM)
+        except:
+            pass
 
     @testcase(1115)
     def test_all_users_can_connect_via_ssh_without_password(self):
@@ -121,7 +124,10 @@ class ImageFeatures(oeSelfTest):
             proc_ssh.terminate()
 
         # Cleanup
-        killpg(proc_qemu.pid, signal.SIGTERM)
+        try:
+            killpg(proc_qemu.pid, signal.SIGTERM)
+        except:
+            pass
 
     @testcase(1114)
     def test_rpm_version_4_support_on_image(self):
@@ -167,7 +173,10 @@ class ImageFeatures(oeSelfTest):
                       'RPM version is not {}, found instead {}.'.format(rpm_version, found_rpm_version))
 
         # Cleanup (close qemu)
-        killpg(proc_qemu.pid, signal.SIGTERM)
+        try:
+            killpg(proc_qemu.pid, signal.SIGTERM)
+        except:
+            pass
 
     @testcase(1116)
     def test_clutter_image_can_be_built(self):