aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmin Kuster <akuster808@gmail.com>2019-05-01 08:14:37 -0700
committerArmin Kuster <akuster808@gmail.com>2019-05-12 11:10:36 -0700
commit6e3c025a5b94a0bb6e074d944a5d63d785dfbe6c (patch)
tree7280e174854e9b44fdc4f60a4e0361f39e3bfed3
parent462d76700a3c2748067d4685db8985c511b1b46c (diff)
downloadmeta-security-6e3c025a5b94a0bb6e074d944a5d63d785dfbe6c.tar.gz
meta-security-6e3c025a5b94a0bb6e074d944a5d63d785dfbe6c.tar.bz2
meta-security-6e3c025a5b94a0bb6e074d944a5d63d785dfbe6c.zip
oe-selftest: add running cve checker
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--lib/oeqa/selftest/cases/cvechecker.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/oeqa/selftest/cases/cvechecker.py b/lib/oeqa/selftest/cases/cvechecker.py
new file mode 100644
index 0000000..23ca7d2
--- /dev/null
+++ b/lib/oeqa/selftest/cases/cvechecker.py
@@ -0,0 +1,27 @@
+import os
+import re
+
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import bitbake, get_bb_var
+
+class CveCheckerTests(OESelftestTestCase):
+ def test_cve_checker(self):
+ image = "core-image-sato"
+
+ deploy_dir = get_bb_var("DEPLOY_DIR_IMAGE")
+ image_link_name = get_bb_var('IMAGE_LINK_NAME', image)
+
+ manifest_link = os.path.join(deploy_dir, "%s.cve" % image_link_name)
+
+ self.logger.info('CVE_CHECK_MANIFEST = "%s"' % manifest_link)
+ if (not 'cve-check' in get_bb_var('INHERIT')):
+ add_cve_check_config = 'INHERIT += "cve-check"'
+ self.append_config(add_cve_check_config)
+ self.append_config('CVE_CHECK_MANIFEST = "%s"' % manifest_link)
+ result = bitbake("-k -c cve_check %s" % image, ignore_status=True)
+ if (not 'cve-check' in get_bb_var('INHERIT')):
+ self.remove_config(add_cve_check_config)
+
+ isfile = os.path.isfile(manifest_link)
+ self.assertEqual(True, isfile, 'Failed to create cve data file : %s' % manifest_link)
+