summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/selftest/cases/updater_qemux86_64.py
diff options
context:
space:
mode:
authorLaurent Bonnans <laurent.bonnans@here.com>2019-03-21 13:59:52 +0100
committerLaurent Bonnans <laurent.bonnans@here.com>2019-03-21 13:59:52 +0100
commite1867d7a7bd52d79fa3d051bb7b16f50934b88e6 (patch)
treed4aca54f1e8ff8e2a3409c2df2506f1f17152d3e /lib/oeqa/selftest/cases/updater_qemux86_64.py
parent262654d184264412498abb461b34c47ec3736e78 (diff)
downloadmeta-updater-e1867d7a7bd52d79fa3d051bb7b16f50934b88e6.tar.gz
Cleanup (not) provisioned checks in oe-selftestfeat/OTA-2142/aktualizr-resource-control
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
Diffstat (limited to 'lib/oeqa/selftest/cases/updater_qemux86_64.py')
-rw-r--r--lib/oeqa/selftest/cases/updater_qemux86_64.py54
1 files changed, 5 insertions, 49 deletions
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py
index 0fac159..bef6cdc 100644
--- a/lib/oeqa/selftest/cases/updater_qemux86_64.py
+++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py
@@ -8,7 +8,7 @@ from time import sleep
8from oeqa.selftest.case import OESelftestTestCase 8from oeqa.selftest.case import OESelftestTestCase
9from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars 9from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars
10from testutils import qemu_launch, qemu_send_command, qemu_terminate, \ 10from testutils import qemu_launch, qemu_send_command, qemu_terminate, \
11 akt_native_run, verifyProvisioned 11 akt_native_run, verifyNotProvisioned, verifyProvisioned
12 12
13 13
14class GeneralTests(OESelftestTestCase): 14class GeneralTests(OESelftestTestCase):
@@ -106,16 +106,6 @@ class AutoProvTests(OESelftestTestCase):
106 value = stdout.decode()[:-1] 106 value = stdout.decode()[:-1]
107 self.assertEqual(value, machine, 107 self.assertEqual(value, machine,
108 'MACHINE does not match hostname: ' + machine + ', ' + value) 108 'MACHINE does not match hostname: ' + machine + ', ' + value)
109 print(value)
110 print('Checking output of aktualizr-info:')
111 ran_ok = False
112 for delay in [1, 2, 5, 10, 15]:
113 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
114 if retcode == 0 and stderr == b'':
115 ran_ok = True
116 break
117 sleep(delay)
118 self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
119 109
120 verifyProvisioned(self, machine) 110 verifyProvisioned(self, machine)
121 111
@@ -204,25 +194,8 @@ class ImplProvTests(OESelftestTestCase):
204 value = stdout.decode()[:-1] 194 value = stdout.decode()[:-1]
205 self.assertEqual(value, machine, 195 self.assertEqual(value, machine,
206 'MACHINE does not match hostname: ' + machine + ', ' + value) 196 'MACHINE does not match hostname: ' + machine + ', ' + value)
207 print(value) 197
208 print('Checking output of aktualizr-info:') 198 verifyNotProvisioned(self, machine)
209 ran_ok = False
210 for delay in [1, 2, 5, 10, 15]:
211 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
212 if retcode == 0 and stderr == b'':
213 ran_ok = True
214 break
215 sleep(delay)
216 self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
217 # Verify that device has NOT yet provisioned.
218 self.assertIn(b'Couldn\'t load device ID', stdout,
219 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
220 self.assertIn(b'Couldn\'t load ECU serials', stdout,
221 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
222 self.assertIn(b'Provisioned on server: no', stdout,
223 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
224 self.assertIn(b'Fetched metadata: no', stdout,
225 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
226 199
227 # Run aktualizr-cert-provider. 200 # Run aktualizr-cert-provider.
228 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') 201 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native')
@@ -279,25 +252,8 @@ class HsmTests(OESelftestTestCase):
279 value = stdout.decode()[:-1] 252 value = stdout.decode()[:-1]
280 self.assertEqual(value, machine, 253 self.assertEqual(value, machine,
281 'MACHINE does not match hostname: ' + machine + ', ' + value) 254 'MACHINE does not match hostname: ' + machine + ', ' + value)
282 print(value) 255
283 print('Checking output of aktualizr-info:') 256 verifyNotProvisioned(self, machine)
284 ran_ok = False
285 for delay in [1, 2, 5, 10, 15]:
286 stdout, stderr, retcode = self.qemu_command('aktualizr-info')
287 if retcode == 0 and stderr == b'':
288 ran_ok = True
289 break
290 sleep(delay)
291 self.assertTrue(ran_ok, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode())
292 # Verify that device has NOT yet provisioned.
293 self.assertIn(b'Couldn\'t load device ID', stdout,
294 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
295 self.assertIn(b'Couldn\'t load ECU serials', stdout,
296 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
297 self.assertIn(b'Provisioned on server: no', stdout,
298 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
299 self.assertIn(b'Fetched metadata: no', stdout,
300 'Device already provisioned!? ' + stderr.decode() + stdout.decode())
301 257
302 # Verify that HSM is not yet initialized. 258 # Verify that HSM is not yet initialized.
303 pkcs11_command = 'pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O' 259 pkcs11_command = 'pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O'