diff options
Diffstat (limited to 'lib/oeqa')
-rw-r--r-- | lib/oeqa/selftest/cases/updater.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 96058e7..e620491 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
@@ -193,6 +193,49 @@ class AutoProvTests(OESelftestTestCase): | |||
193 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) | 193 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) |
194 | 194 | ||
195 | 195 | ||
196 | class ManualControlTests(OESelftestTestCase): | ||
197 | |||
198 | def setUpLocal(self): | ||
199 | layer = "meta-updater-qemux86-64" | ||
200 | result = runCmd('bitbake-layers show-layers') | ||
201 | if re.search(layer, result.output) is None: | ||
202 | # Assume the directory layout for finding other layers. We could also | ||
203 | # make assumptions by using 'show-layers', but either way, if the | ||
204 | # layers we need aren't where we expect them, we are out of like. | ||
205 | path = os.path.abspath(os.path.dirname(__file__)) | ||
206 | metadir = path + "/../../../../../" | ||
207 | self.meta_qemu = metadir + layer | ||
208 | runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu) | ||
209 | else: | ||
210 | self.meta_qemu = None | ||
211 | self.append_config('MACHINE = "qemux86-64"') | ||
212 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') | ||
213 | self.append_config('SYSTEMD_AUTO_ENABLE_aktualizr = "disable"') | ||
214 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | ||
215 | |||
216 | def tearDownLocal(self): | ||
217 | qemu_terminate(self.s) | ||
218 | if self.meta_qemu: | ||
219 | runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True) | ||
220 | |||
221 | def qemu_command(self, command): | ||
222 | return qemu_send_command(self.qemu.ssh_port, command) | ||
223 | |||
224 | def test_manual_running_mode_once(self): | ||
225 | """ | ||
226 | Disable the systemd service then run aktualizr manually | ||
227 | """ | ||
228 | sleep(20) | ||
229 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') | ||
230 | self.assertIn(b'Fetched metadata: no', stdout, | ||
231 | 'Aktualizr should not have run yet' + stderr.decode() + stdout.decode()) | ||
232 | |||
233 | stdout, stderr, retcode = self.qemu_command('aktualizr --running-mode=once') | ||
234 | |||
235 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') | ||
236 | self.assertIn(b'Fetched metadata: yes', stdout, | ||
237 | 'Aktualizr should have run' + stderr.decode() + stdout.decode()) | ||
238 | |||
196 | class RpiTests(OESelftestTestCase): | 239 | class RpiTests(OESelftestTestCase): |
197 | 240 | ||
198 | def setUpLocal(self): | 241 | def setUpLocal(self): |