diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/archiver.py')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/archiver.py | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py new file mode 100644 index 0000000000..70c7282f22 --- /dev/null +++ b/meta/lib/oeqa/selftest/cases/archiver.py | |||
@@ -0,0 +1,41 @@ | |||
1 | import os | ||
2 | import glob | ||
3 | from oeqa.utils.commands import bitbake, get_bb_vars | ||
4 | from oeqa.selftest.case import OESelftestTestCase | ||
5 | from oeqa.core.decorator.oeid import OETestID | ||
6 | |||
7 | class Archiver(OESelftestTestCase): | ||
8 | |||
9 | @OETestID(1345) | ||
10 | def test_archiver_allows_to_filter_on_recipe_name(self): | ||
11 | """ | ||
12 | Summary: The archiver should offer the possibility to filter on the recipe. (#6929) | ||
13 | Expected: 1. Included recipe (busybox) should be included | ||
14 | 2. Excluded recipe (zlib) should be excluded | ||
15 | Product: oe-core | ||
16 | Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | ||
17 | AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com> | ||
18 | """ | ||
19 | |||
20 | include_recipe = 'busybox' | ||
21 | exclude_recipe = 'zlib' | ||
22 | |||
23 | features = 'INHERIT += "archiver"\n' | ||
24 | features += 'ARCHIVER_MODE[src] = "original"\n' | ||
25 | features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % include_recipe | ||
26 | features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe | ||
27 | self.write_config(features) | ||
28 | |||
29 | bitbake('-c clean %s %s' % (include_recipe, exclude_recipe)) | ||
30 | bitbake("%s %s" % (include_recipe, exclude_recipe)) | ||
31 | |||
32 | bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS']) | ||
33 | src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS']) | ||
34 | |||
35 | # Check that include_recipe was included | ||
36 | included_present = len(glob.glob(src_path + '/%s-*' % include_recipe)) | ||
37 | self.assertTrue(included_present, 'Recipe %s was not included.' % include_recipe) | ||
38 | |||
39 | # Check that exclude_recipe was excluded | ||
40 | excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe)) | ||
41 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe) | ||