summaryrefslogtreecommitdiffstats
path: root/lib/oeqa/selftest/updater.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oeqa/selftest/updater.py')
-rw-r--r--lib/oeqa/selftest/updater.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py
new file mode 100644
index 0000000..e9048fd
--- /dev/null
+++ b/lib/oeqa/selftest/updater.py
@@ -0,0 +1,41 @@
1import unittest
2import os
3import logging
4
5from oeqa.selftest.base import oeSelfTest
6from oeqa.utils.commands import runCmd, bitbake, get_bb_var
7
8class UpdaterTests(oeSelfTest):
9
10 @classmethod
11 def setUpClass(cls):
12 logger = logging.getLogger("selftest")
13 logger.info('Running bitbake to build aktualizr-native tools and garage-sign-native')
14 bitbake('aktualizr-native garage-sign-native')
15
16 def test_help(self):
17 image_dir = get_bb_var("D", "aktualizr-native")
18 bin_dir = get_bb_var("bindir", "aktualizr-native")
19 gp_path = os.path.join(image_dir, bin_dir[1:], 'garage-push')
20 result = runCmd('%s --help' % gp_path, ignore_status=True)
21 self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output)
22
23 def test_java(self):
24 result = runCmd('which java', ignore_status=True)
25 self.assertEqual(result.status, 0, "Java not found.")
26
27 def test_sign(self):
28 image_dir = get_bb_var("D", "garage-sign-native")
29 bin_dir = get_bb_var("bindir", "garage-sign-native")
30 gs_path = os.path.join(image_dir, bin_dir[1:], 'garage-sign')
31 result = runCmd('%s --help' % gs_path, ignore_status=True)
32 self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output)
33
34 def test_push(self):
35 bitbake('core-image-minimal')
36 self.write_config('IMAGE_INSTALL_append = " man "')
37 bitbake('core-image-minimal')
38
39 def test_hsm(self):
40 self.write_config('SOTA_CLIENT_FEATURES="hsm hsm-test"')
41 bitbake('core-image-minimal')