diff options
author | Leon Anavi <leon.anavi@konsulko.com> | 2017-11-14 19:11:32 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2017-11-15 17:56:04 +0100 |
commit | 50d8ea5e540f1d2f423db77e8a93b0f5bcc1d1ca (patch) | |
tree | 0a762b5672d86620293311cc212c31f27e310962 | |
parent | de48c402e207cde0c723ebb8ff5c2992101cfc27 (diff) | |
download | meta-updater-50d8ea5e540f1d2f423db77e8a93b0f5bcc1d1ca.tar.gz |
garage_push.py: Test SOTA_PACKED_CREDENTIALS
Add test to verify that the file specified at
SOTA_PACKED_CREDENTIALS exists and is included
in the image. If SOTA_PACKED_CREDENTIALS is not
set this test case will be skipped.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
-rw-r--r-- | lib/oeqa/selftest/updater.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py index 9945b40..b59eefc 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/updater.py | |||
@@ -65,6 +65,20 @@ class GeneralTests(oeSelfTest): | |||
65 | result = get_bb_var('DISTRO_FEATURES').find('systemd') | 65 | result = get_bb_var('DISTRO_FEATURES').find('systemd') |
66 | self.assertNotEqual(result, -1, 'Feature "systemd" not set at DISTRO_FEATURES'); | 66 | self.assertNotEqual(result, -1, 'Feature "systemd" not set at DISTRO_FEATURES'); |
67 | 67 | ||
68 | def test_credentials(self): | ||
69 | bitbake('core-image-minimal') | ||
70 | credentials = get_bb_var('SOTA_PACKED_CREDENTIALS') | ||
71 | # skip the test if the variable SOTA_PACKED_CREDENTIALS is not set | ||
72 | if credentials is None: | ||
73 | raise unittest.SkipTest("Variable 'SOTA_PACKED_CREDENTIALS' not set.") | ||
74 | # Check if the file exists | ||
75 | self.assertTrue(os.path.isfile(credentials), "File %s does not exist" % credentials) | ||
76 | deploydir = get_bb_var('DEPLOY_DIR_IMAGE') | ||
77 | imagename = get_bb_var('IMAGE_LINK_NAME', 'core-image-minimal') | ||
78 | # Check if the credentials are included in the output image | ||
79 | result = runCmd('tar -jtvf %s/%s.tar.bz2 | grep sota_provisioning_credentials.zip' % (deploydir, imagename), ignore_status=True) | ||
80 | self.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) | ||
81 | |||
68 | def test_java(self): | 82 | def test_java(self): |
69 | result = runCmd('which java', ignore_status=True) | 83 | result = runCmd('which java', ignore_status=True) |
70 | self.assertEqual(result.status, 0, "Java not found.") | 84 | self.assertEqual(result.status, 0, "Java not found.") |