diff options
| author | Patrick Vacek <patrickvacek@gmail.com> | 2017-11-03 11:14:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-03 11:14:41 +0100 |
| commit | c72d37a4de49242c154e89e1acf9f67a1f536bdd (patch) | |
| tree | 4ea1f2fd9fe1ba8067d7bd149f9482cb978bb9c5 /lib | |
| parent | cdeaf6933f894edafdf9a01f2d0b118a1fcbb35c (diff) | |
| parent | 3814eb4b6341c2a3f6cc0c7811e88e0e4a417d32 (diff) | |
| download | meta-updater-c72d37a4de49242c154e89e1acf9f67a1f536bdd.tar.gz | |
Merge pull request #158 from leon-anavi/feat/PRO-4199/oe-selftest
Feat/pro 4199/oe selftest
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/oeqa/selftest/garage_push.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/garage_push.py b/lib/oeqa/selftest/garage_push.py new file mode 100644 index 0000000..3490de5 --- /dev/null +++ b/lib/oeqa/selftest/garage_push.py | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | import unittest | ||
| 2 | import os | ||
| 3 | import logging | ||
| 4 | |||
| 5 | from oeqa.selftest.base import oeSelfTest | ||
| 6 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var | ||
| 7 | |||
| 8 | class GaragePushTests(oeSelfTest): | ||
| 9 | |||
| 10 | @classmethod | ||
| 11 | def setUpClass(cls): | ||
| 12 | # Ensure we have the right data in pkgdata | ||
| 13 | logger = logging.getLogger("selftest") | ||
| 14 | logger.info('Running bitbake to build aktualizr-native tools') | ||
| 15 | bitbake('aktualizr-native garage-sign-native') | ||
| 16 | |||
| 17 | def test_help(self): | ||
| 18 | image_dir = get_bb_var("D", "aktualizr-native") | ||
| 19 | bin_dir = get_bb_var("bindir", "aktualizr-native") | ||
| 20 | gp_path = os.path.join(image_dir, bin_dir[1:], 'garage-push') | ||
| 21 | result = runCmd('%s --help' % gp_path, ignore_status=True) | ||
| 22 | self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) | ||
| 23 | |||
| 24 | def test_java(self): | ||
| 25 | result = runCmd('which java', ignore_status=True) | ||
| 26 | self.assertEqual(result.status, 0, "Java not found.") | ||
| 27 | |||
| 28 | def test_sign(self): | ||
| 29 | image_dir = get_bb_var("D", "garage-sign-native") | ||
| 30 | bin_dir = get_bb_var("bindir", "garage-sign-native") | ||
| 31 | gs_path = os.path.join(image_dir, bin_dir[1:], 'garage-sign') | ||
| 32 | result = runCmd('%s --help' % gs_path, ignore_status=True) | ||
| 33 | self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) | ||
| 34 | |||
| 35 | def test_push(self): | ||
| 36 | bitbake('core-image-minimal') | ||
| 37 | self.write_config('IMAGE_INSTALL_append = " man "') | ||
| 38 | bitbake('core-image-minimal') | ||
| 39 | |||
