diff options
author | Ross Burton <ross.burton@intel.com> | 2015-07-23 22:59:48 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-25 14:41:42 +0100 |
commit | 46cb3f0d2f87c4e247d5b566e19e5ff340813961 (patch) | |
tree | 34d51e64c7c44c65622d63069639d8e42f1660a6 /meta/lib | |
parent | 7b33ced7d201e7adc33f64febbbed339b7b88f29 (diff) | |
download | poky-46cb3f0d2f87c4e247d5b566e19e5ff340813961.tar.gz |
oeqa/selftest/imagefeatures: handle killpg victim not existing
If Pexpect throws an exception it may be because the child has already died, in
which case killpg will fail. Catch the latter exception silently, and output
the exception from Pexpect.
(From OE-Core rev: 4d777ce9736e91bb560558b691b8025acf784046)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/selftest/imagefeatures.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/meta/lib/oeqa/selftest/imagefeatures.py b/meta/lib/oeqa/selftest/imagefeatures.py index 70ebbe4321..82ea164de1 100644 --- a/meta/lib/oeqa/selftest/imagefeatures.py +++ b/meta/lib/oeqa/selftest/imagefeatures.py | |||
@@ -43,9 +43,12 @@ class ImageFeatures(oeSelfTest): | |||
43 | proc_qemu.expect(self.get_ip_patt, timeout=100) | 43 | proc_qemu.expect(self.get_ip_patt, timeout=100) |
44 | qemu_ip = proc_qemu.match.group('qemu_ip') | 44 | qemu_ip = proc_qemu.match.group('qemu_ip') |
45 | proc_qemu.expect('qemux86 login:', timeout=100) | 45 | proc_qemu.expect('qemux86 login:', timeout=100) |
46 | except: | 46 | except Exception as e: |
47 | killpg(proc_qemu.pid, signal.SIGTERM) | 47 | try: |
48 | self.fail('Failed to start qemu.') | 48 | killpg(proc_qemu.pid, signal.SIGTERM) |
49 | except: | ||
50 | pass | ||
51 | self.fail('Failed to start qemu: %s' % e) | ||
49 | 52 | ||
50 | # Attempt to ssh with each user into qemu with empty password | 53 | # Attempt to ssh with each user into qemu with empty password |
51 | for user in [self.root_user, self.test_user]: | 54 | for user in [self.root_user, self.test_user]: |
@@ -93,9 +96,12 @@ class ImageFeatures(oeSelfTest): | |||
93 | proc_qemu.expect(self.get_ip_patt, timeout=100) | 96 | proc_qemu.expect(self.get_ip_patt, timeout=100) |
94 | qemu_ip = proc_qemu.match.group('qemu_ip') | 97 | qemu_ip = proc_qemu.match.group('qemu_ip') |
95 | proc_qemu.expect('qemux86 login:', timeout=100) | 98 | proc_qemu.expect('qemux86 login:', timeout=100) |
96 | except: | 99 | except Exception as e: |
97 | killpg(proc_qemu.pid, signal.SIGTERM) | 100 | try: |
98 | self.fail('Failed to start qemu.') | 101 | killpg(proc_qemu.pid, signal.SIGTERM) |
102 | except: | ||
103 | pass | ||
104 | self.fail('Failed to start qemu: %s' % e) | ||
99 | 105 | ||
100 | # Attempt to ssh with each user into qemu with empty password | 106 | # Attempt to ssh with each user into qemu with empty password |
101 | for user in [self.root_user, self.test_user]: | 107 | for user in [self.root_user, self.test_user]: |
@@ -147,9 +153,12 @@ class ImageFeatures(oeSelfTest): | |||
147 | proc_qemu.expect(self.prompt) | 153 | proc_qemu.expect(self.prompt) |
148 | proc_qemu.sendline('rpm --version') | 154 | proc_qemu.sendline('rpm --version') |
149 | proc_qemu.expect(self.prompt) | 155 | proc_qemu.expect(self.prompt) |
150 | except: | 156 | except Exception as e: |
151 | killpg(proc_qemu.pid, signal.SIGTERM) | 157 | try: |
152 | self.fail('Failed to boot qemu.') | 158 | killpg(proc_qemu.pid, signal.SIGTERM) |
159 | except: | ||
160 | pass | ||
161 | self.fail('Failed to start qemu: %s' % e) | ||
153 | 162 | ||
154 | found_rpm_version = proc_qemu.before | 163 | found_rpm_version = proc_qemu.before |
155 | 164 | ||