diff options
Diffstat (limited to 'lib/oeqa/selftest/cases/testutils.py')
-rw-r--r-- | lib/oeqa/selftest/cases/testutils.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py index 28087ca..802d665 100644 --- a/lib/oeqa/selftest/cases/testutils.py +++ b/lib/oeqa/selftest/cases/testutils.py | |||
@@ -119,7 +119,7 @@ def verifyNotProvisioned(testInst, machine): | |||
119 | 'Device already provisioned!? ' + stderr.decode() + stdout.decode()) | 119 | 'Device already provisioned!? ' + stderr.decode() + stdout.decode()) |
120 | 120 | ||
121 | 121 | ||
122 | def verifyProvisioned(testInst, machine): | 122 | def verifyProvisioned(testInst, machine, hwid=''): |
123 | # Verify that device HAS provisioned. | 123 | # Verify that device HAS provisioned. |
124 | # First loop while waiting for the device to boot. | 124 | # First loop while waiting for the device to boot. |
125 | ran_ok = False | 125 | ran_ok = False |
@@ -133,12 +133,15 @@ def verifyProvisioned(testInst, machine): | |||
133 | # Then wait for aktualizr to provision. | 133 | # Then wait for aktualizr to provision. |
134 | if stdout.decode().find('Fetched metadata: yes') < 0: | 134 | if stdout.decode().find('Fetched metadata: yes') < 0: |
135 | stdout, stderr, retcode = testInst.qemu_command('aktualizr-info --wait-until-provisioned') | 135 | stdout, stderr, retcode = testInst.qemu_command('aktualizr-info --wait-until-provisioned') |
136 | 136 | testInst.assertFalse(retcode, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | |
137 | testInst.assertFalse(retcode, 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | 137 | testInst.assertEqual(stderr, b'', 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) |
138 | testInst.assertEqual(stderr, b'', 'aktualizr-info failed: ' + stderr.decode() + stdout.decode()) | ||
139 | testInst.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) | 138 | testInst.assertIn(b'Device ID: ', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) |
140 | testInst.assertIn(b'Primary ecu hardware ID: ' + machine.encode(), stdout, | 139 | if hwid == '': |
141 | 'Provisioning failed: ' + stderr.decode() + stdout.decode()) | 140 | testInst.assertIn(b'Primary ecu hardware ID: ' + machine.encode(), stdout, |
141 | 'Provisioning failed: ' + stderr.decode() + stdout.decode()) | ||
142 | else: | ||
143 | testInst.assertIn(b'Primary ecu hardware ID: ' + hwid.encode(), stdout, | ||
144 | 'Provisioning failed: ' + stderr.decode() + stdout.decode()) | ||
142 | testInst.assertIn(b'Fetched metadata: yes', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) | 145 | testInst.assertIn(b'Fetched metadata: yes', stdout, 'Provisioning failed: ' + stderr.decode() + stdout.decode()) |
143 | p = re.compile(r'Device ID: ([a-z0-9-]*)\n') | 146 | p = re.compile(r'Device ID: ([a-z0-9-]*)\n') |
144 | m = p.search(stdout.decode()) | 147 | m = p.search(stdout.decode()) |