diff options
-rw-r--r-- | lib/oeqa/selftest/updater.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py index 690dae5..c8ec711 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/updater.py | |||
@@ -170,13 +170,13 @@ class QemuTests(oeSelfTest): | |||
170 | def tearDownClass(cls): | 170 | def tearDownClass(cls): |
171 | qemu_terminate(cls.s) | 171 | qemu_terminate(cls.s) |
172 | 172 | ||
173 | def run_command(self, command): | 173 | def qemu_command(self, command): |
174 | return qemu_send_command(self.qemu.ssh_port, command) | 174 | return qemu_send_command(self.qemu.ssh_port, command) |
175 | 175 | ||
176 | def test_hostname(self): | 176 | def test_hostname(self): |
177 | print('') | 177 | print('') |
178 | print('Checking machine name (hostname) of device:') | 178 | print('Checking machine name (hostname) of device:') |
179 | stdout, stderr, retcode = self.run_command('hostname') | 179 | stdout, stderr, retcode = self.qemu_command('hostname') |
180 | machine = get_bb_var('MACHINE', 'core-image-minimal') | 180 | machine = get_bb_var('MACHINE', 'core-image-minimal') |
181 | self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) | 181 | self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) |
182 | # Strip off line ending. | 182 | # Strip off line ending. |
@@ -188,7 +188,7 @@ class QemuTests(oeSelfTest): | |||
188 | def test_var_sota(self): | 188 | def test_var_sota(self): |
189 | print('') | 189 | print('') |
190 | print('Checking contents of /var/sota:') | 190 | print('Checking contents of /var/sota:') |
191 | stdout, stderr, retcode = self.run_command('ls /var/sota') | 191 | stdout, stderr, retcode = self.qemu_command('ls /var/sota') |
192 | self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) | 192 | self.assertEqual(stderr, b'', 'Error: ' + stderr.decode()) |
193 | self.assertEqual(retcode, 0) | 193 | self.assertEqual(retcode, 0) |
194 | print(stdout.decode()) | 194 | print(stdout.decode()) |
@@ -199,7 +199,7 @@ class QemuTests(oeSelfTest): | |||
199 | for delay in [0, 1, 2, 5, 10, 15]: | 199 | for delay in [0, 1, 2, 5, 10, 15]: |
200 | sleep(delay) | 200 | sleep(delay) |
201 | try: | 201 | try: |
202 | stdout, stderr, retcode = self.run_command('aktualizr-info') | 202 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') |
203 | if retcode == 0 and stderr == b'': | 203 | if retcode == 0 and stderr == b'': |
204 | ran_ok = True | 204 | ran_ok = True |
205 | break | 205 | break |
@@ -252,14 +252,14 @@ class HsmTests(oeSelfTest): | |||
252 | def tearDownLocal(self): | 252 | def tearDownLocal(self): |
253 | qemu_terminate(self.s) | 253 | qemu_terminate(self.s) |
254 | 254 | ||
255 | def run_command(self, command): | 255 | def qemu_command(self, command): |
256 | return qemu_send_command(self.qemu.ssh_port, command) | 256 | return qemu_send_command(self.qemu.ssh_port, command) |
257 | 257 | ||
258 | def test_provisioning(self): | 258 | def test_provisioning(self): |
259 | print('') | 259 | print('') |
260 | ran_ok = False | 260 | ran_ok = False |
261 | for delay in [0, 1, 2, 5, 10, 15]: | 261 | for delay in [0, 1, 2, 5, 10, 15]: |
262 | stdout, stderr, retcode = self.run_command('aktualizr-info') | 262 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') |
263 | if retcode == 0 and stderr == b'': | 263 | if retcode == 0 and stderr == b'': |
264 | ran_ok = True | 264 | ran_ok = True |
265 | break | 265 | break |
@@ -276,11 +276,11 @@ class HsmTests(oeSelfTest): | |||
276 | 276 | ||
277 | # Verify that HSM is not yet initialized. | 277 | # Verify that HSM is not yet initialized. |
278 | pkcs11_command = 'pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O' | 278 | pkcs11_command = 'pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O' |
279 | stdout, stderr, retcode = self.run_command(pkcs11_command) | 279 | stdout, stderr, retcode = self.qemu_command(pkcs11_command) |
280 | self.assertNotEqual(retcode, 0, 'pkcs11-tool succeeded before initialization: ' + | 280 | self.assertNotEqual(retcode, 0, 'pkcs11-tool succeeded before initialization: ' + |
281 | stdout.decode() + stderr.decode()) | 281 | stdout.decode() + stderr.decode()) |
282 | softhsm2_command = 'softhsm2-util --show-slots' | 282 | softhsm2_command = 'softhsm2-util --show-slots' |
283 | stdout, stderr, retcode = self.run_command(softhsm2_command) | 283 | stdout, stderr, retcode = self.qemu_command(softhsm2_command) |
284 | self.assertNotEqual(retcode, 0, 'softhsm2-tool succeeded before initialization: ' + | 284 | self.assertNotEqual(retcode, 0, 'softhsm2-tool succeeded before initialization: ' + |
285 | stdout.decode() + stderr.decode()) | 285 | stdout.decode() + stderr.decode()) |
286 | 286 | ||
@@ -304,8 +304,8 @@ class HsmTests(oeSelfTest): | |||
304 | ran_ok = False | 304 | ran_ok = False |
305 | for delay in [5, 5, 5, 5, 10]: | 305 | for delay in [5, 5, 5, 5, 10]: |
306 | sleep(delay) | 306 | sleep(delay) |
307 | p11_out, p11_err, p11_ret = self.run_command(pkcs11_command) | 307 | p11_out, p11_err, p11_ret = self.qemu_command(pkcs11_command) |
308 | hsm_out, hsm_err, hsm_ret = self.run_command(softhsm2_command) | 308 | hsm_out, hsm_err, hsm_ret = self.qemu_command(softhsm2_command) |
309 | if p11_ret == 0 and hsm_ret == 0 and hsm_err == b'': | 309 | if p11_ret == 0 and hsm_ret == 0 and hsm_err == b'': |
310 | ran_ok = True | 310 | ran_ok = True |
311 | break | 311 | break |
@@ -336,7 +336,7 @@ class HsmTests(oeSelfTest): | |||
336 | ran_ok = False | 336 | ran_ok = False |
337 | for delay in [5, 5, 5, 5, 10]: | 337 | for delay in [5, 5, 5, 5, 10]: |
338 | sleep(delay) | 338 | sleep(delay) |
339 | stdout, stderr, retcode = self.run_command('aktualizr-info') | 339 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') |
340 | if retcode == 0 and stderr == b'' and stdout.decode().find('Provisioned on server: yes') >= 0: | 340 | if retcode == 0 and stderr == b'' and stdout.decode().find('Provisioned on server: yes') >= 0: |
341 | ran_ok = True | 341 | ran_ok = True |
342 | break | 342 | break |