summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2019-05-28 09:46:28 +0200
committerPatrick Vacek <patrickvacek@gmail.com>2019-06-05 11:55:41 +0200
commitecd33302096d269953b52d75b21225778263e27a (patch)
tree41c15ddb5e90e9b49acc78384bae2cc4dcd814d6 /lib
parenteb63622b2f3aa4869e0a4e927b5b2ee5bd152053 (diff)
downloadmeta-updater-ecd33302096d269953b52d75b21225778263e27a.tar.gz
Rename provisioning methods.
"Autoprovisioning" or "automatic provisioning" is now known as "shared credential provisioning". "Implicit provisioning" is now known as "device credential provisioning". "HSM provisioning" was always a misnomer, so it is now refered to as "device credential provisioning with an HSM". This includes a bump of the aktualizr version as well. Signed-off-by: Patrick Vacek <patrickvacek@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/oeqa/selftest/cases/updater_minnowboard.py2
-rw-r--r--lib/oeqa/selftest/cases/updater_qemux86_64.py40
-rw-r--r--lib/oeqa/selftest/cases/updater_raspberrypi.py3
3 files changed, 22 insertions, 23 deletions
diff --git a/lib/oeqa/selftest/cases/updater_minnowboard.py b/lib/oeqa/selftest/cases/updater_minnowboard.py
index f5df584..267445b 100644
--- a/lib/oeqa/selftest/cases/updater_minnowboard.py
+++ b/lib/oeqa/selftest/cases/updater_minnowboard.py
@@ -29,7 +29,7 @@ class MinnowTests(OESelftestTestCase):
29 self.meta_minnow = None 29 self.meta_minnow = None
30 self.append_config('MACHINE = "intel-corei7-64"') 30 self.append_config('MACHINE = "intel-corei7-64"')
31 self.append_config('OSTREE_BOOTLOADER = "grub"') 31 self.append_config('OSTREE_BOOTLOADER = "grub"')
32 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 32 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
33 self.qemu, self.s = qemu_launch(efi=True, machine='intel-corei7-64') 33 self.qemu, self.s = qemu_launch(efi=True, machine='intel-corei7-64')
34 34
35 def tearDownLocal(self): 35 def tearDownLocal(self):
diff --git a/lib/oeqa/selftest/cases/updater_qemux86_64.py b/lib/oeqa/selftest/cases/updater_qemux86_64.py
index f951bc7..e26a022 100644
--- a/lib/oeqa/selftest/cases/updater_qemux86_64.py
+++ b/lib/oeqa/selftest/cases/updater_qemux86_64.py
@@ -16,7 +16,7 @@ class GeneralTests(OESelftestTestCase):
16 def test_credentials(self): 16 def test_credentials(self):
17 logger = logging.getLogger("selftest") 17 logger = logging.getLogger("selftest")
18 logger.info('Running bitbake to build core-image-minimal') 18 logger.info('Running bitbake to build core-image-minimal')
19 self.append_config('SOTA_CLIENT_PROV = "aktualizr-auto-prov"') 19 self.append_config('SOTA_CLIENT_PROV = "aktualizr-shared-prov"')
20 bitbake('core-image-minimal') 20 bitbake('core-image-minimal')
21 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS') 21 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS')
22 # skip the test if the variable SOTA_PACKED_CREDENTIALS is not set 22 # skip the test if the variable SOTA_PACKED_CREDENTIALS is not set
@@ -46,13 +46,13 @@ class AktualizrToolsTests(OESelftestTestCase):
46 46
47 def test_cert_provider_local_output(self): 47 def test_cert_provider_local_output(self):
48 logger = logging.getLogger("selftest") 48 logger = logging.getLogger("selftest")
49 logger.info('Running bitbake to build aktualizr-ca-implicit-prov') 49 logger.info('Running bitbake to build aktualizr-device-prov')
50 bitbake('aktualizr-ca-implicit-prov') 50 bitbake('aktualizr-device-prov')
51 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS', 'T'], 'aktualizr-native') 51 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS', 'T'], 'aktualizr-native')
52 creds = bb_vars['SOTA_PACKED_CREDENTIALS'] 52 creds = bb_vars['SOTA_PACKED_CREDENTIALS']
53 temp_dir = bb_vars['T'] 53 temp_dir = bb_vars['T']
54 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-ca-implicit-prov') 54 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-device-prov')
55 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov_ca.toml' 55 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota-device-cred.toml'
56 56
57 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -r -l {temp} -g {config}' 57 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -r -l {temp} -g {config}'
58 .format(creds=creds, temp=temp_dir, config=config)) 58 .format(creds=creds, temp=temp_dir, config=config))
@@ -69,7 +69,7 @@ class AktualizrToolsTests(OESelftestTestCase):
69 self.assertTrue(os.path.getsize(ca_path) > 0, "Client certificate at %s is empty." % ca_path) 69 self.assertTrue(os.path.getsize(ca_path) > 0, "Client certificate at %s is empty." % ca_path)
70 70
71 71
72class AutoProvTests(OESelftestTestCase): 72class SharedCredProvTests(OESelftestTestCase):
73 73
74 def setUpLocal(self): 74 def setUpLocal(self):
75 layer = "meta-updater-qemux86-64" 75 layer = "meta-updater-qemux86-64"
@@ -85,7 +85,7 @@ class AutoProvTests(OESelftestTestCase):
85 else: 85 else:
86 self.meta_qemu = None 86 self.meta_qemu = None
87 self.append_config('MACHINE = "qemux86-64"') 87 self.append_config('MACHINE = "qemux86-64"')
88 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 88 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
89 self.qemu, self.s = qemu_launch(machine='qemux86-64') 89 self.qemu, self.s = qemu_launch(machine='qemux86-64')
90 90
91 def tearDownLocal(self): 91 def tearDownLocal(self):
@@ -127,7 +127,7 @@ class ManualControlTests(OESelftestTestCase):
127 else: 127 else:
128 self.meta_qemu = None 128 self.meta_qemu = None
129 self.append_config('MACHINE = "qemux86-64"') 129 self.append_config('MACHINE = "qemux86-64"')
130 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 130 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
131 self.append_config('SYSTEMD_AUTO_ENABLE_aktualizr = "disable"') 131 self.append_config('SYSTEMD_AUTO_ENABLE_aktualizr = "disable"')
132 self.qemu, self.s = qemu_launch(machine='qemux86-64') 132 self.qemu, self.s = qemu_launch(machine='qemux86-64')
133 133
@@ -155,7 +155,7 @@ class ManualControlTests(OESelftestTestCase):
155 'Aktualizr should have run' + stderr.decode() + stdout.decode()) 155 'Aktualizr should have run' + stderr.decode() + stdout.decode())
156 156
157 157
158class ImplProvTests(OESelftestTestCase): 158class DeviceCredProvTests(OESelftestTestCase):
159 159
160 def setUpLocal(self): 160 def setUpLocal(self):
161 layer = "meta-updater-qemux86-64" 161 layer = "meta-updater-qemux86-64"
@@ -171,9 +171,9 @@ class ImplProvTests(OESelftestTestCase):
171 else: 171 else:
172 self.meta_qemu = None 172 self.meta_qemu = None
173 self.append_config('MACHINE = "qemux86-64"') 173 self.append_config('MACHINE = "qemux86-64"')
174 self.append_config('SOTA_CLIENT_PROV = " aktualizr-ca-implicit-prov "') 174 self.append_config('SOTA_CLIENT_PROV = " aktualizr-device-prov "')
175 self.append_config('SOTA_DEPLOY_CREDENTIALS = "0"') 175 self.append_config('SOTA_DEPLOY_CREDENTIALS = "0"')
176 runCmd('bitbake -c cleanall aktualizr aktualizr-ca-implicit-prov') 176 runCmd('bitbake -c cleanall aktualizr aktualizr-device-prov')
177 self.qemu, self.s = qemu_launch(machine='qemux86-64') 177 self.qemu, self.s = qemu_launch(machine='qemux86-64')
178 178
179 def tearDownLocal(self): 179 def tearDownLocal(self):
@@ -201,8 +201,8 @@ class ImplProvTests(OESelftestTestCase):
201 # Run aktualizr-cert-provider. 201 # Run aktualizr-cert-provider.
202 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') 202 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native')
203 creds = bb_vars['SOTA_PACKED_CREDENTIALS'] 203 creds = bb_vars['SOTA_PACKED_CREDENTIALS']
204 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-ca-implicit-prov') 204 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-device-prov')
205 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov_ca.toml' 205 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota-device-cred.toml'
206 206
207 print('Provisining at root@localhost:%d' % self.qemu.ssh_port) 207 print('Provisining at root@localhost:%d' % self.qemu.ssh_port)
208 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -s -u -r -g {config}' 208 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -s -u -r -g {config}'
@@ -211,7 +211,7 @@ class ImplProvTests(OESelftestTestCase):
211 verifyProvisioned(self, machine) 211 verifyProvisioned(self, machine)
212 212
213 213
214class HsmTests(OESelftestTestCase): 214class DeviceCredProvHsmTests(OESelftestTestCase):
215 215
216 def setUpLocal(self): 216 def setUpLocal(self):
217 layer = "meta-updater-qemux86-64" 217 layer = "meta-updater-qemux86-64"
@@ -227,11 +227,11 @@ class HsmTests(OESelftestTestCase):
227 else: 227 else:
228 self.meta_qemu = None 228 self.meta_qemu = None
229 self.append_config('MACHINE = "qemux86-64"') 229 self.append_config('MACHINE = "qemux86-64"')
230 self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') 230 self.append_config('SOTA_CLIENT_PROV = "aktualizr-device-prov-hsm"')
231 self.append_config('SOTA_DEPLOY_CREDENTIALS = "0"') 231 self.append_config('SOTA_DEPLOY_CREDENTIALS = "0"')
232 self.append_config('SOTA_CLIENT_FEATURES = "hsm"') 232 self.append_config('SOTA_CLIENT_FEATURES = "hsm"')
233 self.append_config('IMAGE_INSTALL_append = " softhsm-testtoken"') 233 self.append_config('IMAGE_INSTALL_append = " softhsm-testtoken"')
234 runCmd('bitbake -c cleanall aktualizr aktualizr-hsm-prov') 234 runCmd('bitbake -c cleanall aktualizr aktualizr-device-prov-hsm')
235 self.qemu, self.s = qemu_launch(machine='qemux86-64') 235 self.qemu, self.s = qemu_launch(machine='qemux86-64')
236 236
237 def tearDownLocal(self): 237 def tearDownLocal(self):
@@ -269,8 +269,8 @@ class HsmTests(OESelftestTestCase):
269 # Run aktualizr-cert-provider. 269 # Run aktualizr-cert-provider.
270 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') 270 bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native')
271 creds = bb_vars['SOTA_PACKED_CREDENTIALS'] 271 creds = bb_vars['SOTA_PACKED_CREDENTIALS']
272 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-hsm-prov') 272 bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-device-prov-hsm')
273 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_hsm_prov.toml' 273 config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota-device-cred-hsm.toml'
274 274
275 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -r -s -u -g {config}' 275 akt_native_run(self, 'aktualizr-cert-provider -c {creds} -t root@localhost -p {port} -r -s -u -g {config}'
276 .format(creds=creds, port=self.qemu.ssh_port, config=config)) 276 .format(creds=creds, port=self.qemu.ssh_port, config=config))
@@ -369,7 +369,7 @@ class IpSecondaryTests(OESelftestTestCase):
369 369
370 def configure(self): 370 def configure(self):
371 self._test_ctx.append_config('MACHINE = "qemux86-64"') 371 self._test_ctx.append_config('MACHINE = "qemux86-64"')
372 self._test_ctx.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 372 self._test_ctx.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
373 373
374 def is_ecu_registered(self, ecu_id): 374 def is_ecu_registered(self, ecu_id):
375 max_number_of_tries = 20 375 max_number_of_tries = 20
@@ -456,7 +456,7 @@ class ResourceControlTests(OESelftestTestCase):
456 else: 456 else:
457 self.meta_qemu = None 457 self.meta_qemu = None
458 self.append_config('MACHINE = "qemux86-64"') 458 self.append_config('MACHINE = "qemux86-64"')
459 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 459 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
460 self.append_config('IMAGE_INSTALL_append += " aktualizr-resource-control "') 460 self.append_config('IMAGE_INSTALL_append += " aktualizr-resource-control "')
461 self.append_config('RESOURCE_CPU_WEIGHT_pn-aktualizr = "1000"') 461 self.append_config('RESOURCE_CPU_WEIGHT_pn-aktualizr = "1000"')
462 self.append_config('RESOURCE_MEMORY_HIGH_pn-aktualizr = "50M"') 462 self.append_config('RESOURCE_MEMORY_HIGH_pn-aktualizr = "50M"')
diff --git a/lib/oeqa/selftest/cases/updater_raspberrypi.py b/lib/oeqa/selftest/cases/updater_raspberrypi.py
index bb7cfa3..e976100 100644
--- a/lib/oeqa/selftest/cases/updater_raspberrypi.py
+++ b/lib/oeqa/selftest/cases/updater_raspberrypi.py
@@ -47,7 +47,7 @@ class RpiTests(OESelftestTestCase):
47 self.meta_qemu = None 47 self.meta_qemu = None
48 48
49 self.append_config('MACHINE = "raspberrypi3"') 49 self.append_config('MACHINE = "raspberrypi3"')
50 self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') 50 self.append_config('SOTA_CLIENT_PROV = " aktualizr-shared-prov "')
51 51
52 def tearDownLocal(self): 52 def tearDownLocal(self):
53 if self.meta_qemu: 53 if self.meta_qemu:
@@ -60,7 +60,6 @@ class RpiTests(OESelftestTestCase):
60 def test_build(self): 60 def test_build(self):
61 logger = logging.getLogger("selftest") 61 logger = logging.getLogger("selftest")
62 logger.info('Running bitbake to build core-image-minimal') 62 logger.info('Running bitbake to build core-image-minimal')
63 self.append_config('SOTA_CLIENT_PROV = "aktualizr-auto-prov"')
64 bitbake('core-image-minimal') 63 bitbake('core-image-minimal')
65 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS') 64 credentials = get_bb_var('SOTA_PACKED_CREDENTIALS')
66 # Skip the test if the variable SOTA_PACKED_CREDENTIALS is not set. 65 # Skip the test if the variable SOTA_PACKED_CREDENTIALS is not set.