summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2018-06-20 17:31:00 +0200
committerGitHub <noreply@github.com>2018-06-20 17:31:00 +0200
commit81bdec797138ce2cdcfcea666caa5e64c8e4feb6 (patch)
tree15e1d247fae87d5d983cea3329183f3e827ef992
parent56c58c6f64bf9b123201da4a542ca00b334162c0 (diff)
parent4f2bb16b31bdc063fcb626004e63d6a28ed5bf19 (diff)
downloadmeta-updater-81bdec797138ce2cdcfcea666caa5e64c8e4feb6.tar.gz
Merge pull request #346 from advancedtelematic/test/running-mode
Test --running-mode=once
-rw-r--r--lib/oeqa/selftest/cases/updater.py43
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb2
2 files changed, 44 insertions, 1 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
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):
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index f1540b2..3684372 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -26,7 +26,7 @@ SRC_URI = " \
26 file://aktualizr-secondary.socket \ 26 file://aktualizr-secondary.socket \
27 file://aktualizr-serialcan.service \ 27 file://aktualizr-serialcan.service \
28 " 28 "
29SRCREV = "9f538a8a411ca917184fe11a6cf92e5ebf9efc61" 29SRCREV = "41ffd4a967a15f9b4638573cda12bd9d4c260626"
30BRANCH ?= "master" 30BRANCH ?= "master"
31 31
32S = "${WORKDIR}/git" 32S = "${WORKDIR}/git"