diff options
author | Zee314159 <252806294@qq.com> | 2019-07-31 16:01:01 +0200 |
---|---|---|
committer | Zee314159 <252806294@qq.com> | 2019-08-08 03:18:46 +0200 |
commit | a2fc4db9ca899db957bb5feb8bc15b6526b1b23e (patch) | |
tree | 124e1e2415c4c59509aec0e51f59e3336e8dd149 /lib/oeqa/selftest/cases/testutils.py | |
parent | 558c25c0f0da4ca9456162844d05b7b00b3629da (diff) | |
download | meta-updater-a2fc4db9ca899db957bb5feb8bc15b6526b1b23e.tar.gz |
Test for setting hwidtest/ota-3064/test-for-setting-custom-hardware-id
Fixed bug taking device ID for hardware ID
Signed-off-by: Zee314159 <252806294@qq.com>
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()) |