summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Wise <phil@advancedtelematic.com>2018-06-20 13:26:57 +0200
committerPatrick Vacek <patrickvacek@gmail.com>2018-07-06 16:31:42 +0200
commit86119ed65491d27c8e6ab87046427328800db1e4 (patch)
tree87f924d8b5bfc7e54b8103bb699c8cfaddd74e85
parent2b7245586e41d59ebb6b24e63bc5668246e42a9d (diff)
downloadmeta-updater-86119ed65491d27c8e6ab87046427328800db1e4.tar.gz
Test --running-mode=once
-rw-r--r--lib/oeqa/selftest/cases/updater.py43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py
index 08fb696..ed4d8d7 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
196class 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
196class RpiTests(OESelftestTestCase): 239class RpiTests(OESelftestTestCase):
197 240
198 def setUpLocal(self): 241 def setUpLocal(self):