Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit c728c2f

Browse files
committed
meta-refkit-extra: build testing for computer vision demo
Our CI system does not enable the layer by default to avoid tainting "normal" builds. However, we need to ensure that the extra content at least continues to build. This can be done in a meta-refkit selftest which adds the extra layer as needed and removes it again. This is sub-optimal because it adds a long-running test with no output while the test runs; extending the CI setup so that it covers different build configurations would be better. But for now the selftest is better than nothing. Signed-off-by: Patrick Ohly <[email protected]>
1 parent 04c7c38 commit c728c2f

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

meta-refkit/lib/oeqa/selftest/meta-refkit-extra.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,42 @@ def setUpLocal(self):
5151
self.skipTest('meta-refkit-extra already in bblayers.conf')
5252
if layer == 'meta-refkit':
5353
self.refkit_extra_path = path + '/../meta-refkit-extra'
54+
self.extra_conf = "require conf/distro/include/refkit-extra.conf"
55+
self.image_dir = get_bb_var('DEPLOY_DIR_IMAGE')
56+
self.machine = get_bb_var('MACHINE')
57+
58+
def enable_refkit_extra(self):
59+
'''
60+
Adds the meta-refkit-extra layer and enables its content.
61+
Will be undone after the test completes.
62+
'''
63+
self.write_bblayers_config('REFKIT_LAYERS += "%s"' % self.refkit_extra_path)
64+
self.write_config(self.extra_conf)
5465

5566
def test_yocto_compat(self):
5667
"""
5768
Checks for 'Yocto Compatible 2.0' using the yocto-compat-layer.py tool.
5869
"""
5970
runCmd("yocto-compat-layer.py '%s'" % self.refkit_extra_path)
71+
72+
def test_build_computervision(self):
73+
"""
74+
Build an image with the extra packages mentioned in meta-refkit-extra/doc/computervision.rst.
75+
"""
76+
self.enable_refkit_extra()
77+
image = 'refkit-image-common'
78+
packages = 'caffe-imagenet-model python3-pyrealsense opencv'
79+
result = bitbake(image, postconfig='''
80+
REFKIT_IMAGE_EXTRA_INSTALL = "%s"
81+
''' % packages)
82+
83+
# Ensure that the packages really were installed.
84+
manifest = os.path.join(self.image_dir, '%s-%s.manifest' % (image, self.machine))
85+
with open(manifest) as f:
86+
content = f.read()
87+
missing = []
88+
for package in packages.split():
89+
if not package in content.split():
90+
missing.append(package)
91+
if missing:
92+
self.fail('%s not installed in %s:\n%s' % (missing, manifest, content))

0 commit comments

Comments
 (0)