summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorDaniel Istrate <daniel.alexandrux.istrate@intel.com>2015-09-22 14:31:50 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-24 17:54:28 +0100
commit9673278dddfe7eb5a676f73ebb9933581db0158b (patch)
treeca3eb54f3024eea9ab457f4f84004ba8827af3d5 /meta
parent68073270f8674104774bee90cf54945a3f6224a8 (diff)
downloadpoky-9673278dddfe7eb5a676f73ebb9933581db0158b.tar.gz
oeqa/selftest/archiver: Test that archiver filters on recipe name
[YOCTO #6929] this test validates the feature introduced in bug 6929 (From OE-Core rev: 2642fb1e00878baa8eaec80015ff3678cb3088f8) Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oeqa/selftest/archiver.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/archiver.py b/meta/lib/oeqa/selftest/archiver.py
new file mode 100644
index 0000000000..f2030c446d
--- /dev/null
+++ b/meta/lib/oeqa/selftest/archiver.py
@@ -0,0 +1,50 @@
1from oeqa.selftest.base import oeSelfTest
2from oeqa.utils.commands import bitbake, get_bb_var
3from oeqa.utils.decorators import testcase
4import glob
5import os
6import shutil
7
8
9class Archiver(oeSelfTest):
10
11 @testcase(1345)
12 def test_archiver_allows_to_filter_on_recipe_name(self):
13 """
14 Summary: The archiver should offer the possibility to filter on the recipe. (#6929)
15 Expected: 1. Included recipe (busybox) should be included
16 2. Excluded recipe (zlib) should be excluded
17 Product: oe-core
18 Author: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
19 AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate@intel.com>
20 """
21
22 include_recipe = 'busybox'
23 exclude_recipe = 'zlib'
24
25 features = 'INHERIT += "archiver"\n'
26 features += 'ARCHIVER_MODE[src] = "original"\n'
27 features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % include_recipe
28 features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % exclude_recipe
29
30 # Update local.conf
31 self.write_config(features)
32
33 tmp_dir = get_bb_var('TMPDIR')
34 deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
35 target_sys = get_bb_var('TARGET_SYS')
36 src_path = os.path.join(deploy_dir_src, target_sys)
37
38 # Delete tmp directory
39 shutil.rmtree(tmp_dir)
40
41 # Build core-image-minimal
42 bitbake('core-image-minimal')
43
44 # Check that include_recipe was included
45 is_included = len(glob.glob(src_path + '/%s*' % include_recipe))
46 self.assertEqual(1, is_included, 'Recipe %s was not included.' % include_recipe)
47
48 # Check that exclude_recipe was excluded
49 is_excluded = len(glob.glob(src_path + '/%s*' % exclude_recipe))
50 self.assertEqual(0, is_excluded, 'Recipe %s was not excluded.' % exclude_recipe)