1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 17:39:31 +00:00
Files
poky/meta/lib/oeqa/selftest/archiver.py
T
Ross Burton cf8fcba8e7 selftest/archiver: don't build an image for a basic test
This test only exercises the include/exclude behaviour so it only needs to build
the two recipes that it tests against, not an entire image.

Part of #10874.

(From OE-Core rev: 9b02216be6c9dbf2f680db1ad1309bcb9fb32b23)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-16 18:05:13 +00:00

43 lines
1.7 KiB
Python

from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import bitbake, get_bb_var
from oeqa.utils.decorators import testcase
import glob
import os
import shutil
class Archiver(oeSelfTest):
@testcase(1345)
def test_archiver_allows_to_filter_on_recipe_name(self):
"""
Summary: The archiver should offer the possibility to filter on the recipe. (#6929)
Expected: 1. Included recipe (busybox) should be included
2. Excluded recipe (zlib) should be excluded
Product: oe-core
Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
"""
include_recipe = 'busybox'
exclude_recipe = 'zlib'
features = 'INHERIT += "archiver"\n'
features += 'ARCHIVER_MODE[src] = "original"\n'
features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % include_recipe
features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe
self.write_config(features)
shutil.rmtree(get_bb_var('TMPDIR'))
bitbake("%s %s" % (include_recipe, exclude_recipe))
src_path = os.path.join(get_bb_var('DEPLOY_DIR_SRC'), get_bb_var('TARGET_SYS'))
# Check that include_recipe was included
included_present = len(glob.glob(src_path + '/%s-*' % include_recipe))
self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe)
# Check that exclude_recipe was excluded
excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe))
self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe)