summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/selftest/cases/archiver.py
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>2017-05-12 14:40:21 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-06 19:02:43 +0100
commit157c3be2ca93f076033f725ec1ee912df91f7488 (patch)
tree8ef896ff7adf78d63b34059cd5b017a4f0a3419a /meta/lib/oeqa/selftest/cases/archiver.py
parent10c512b60d1167122b5fe778b93838dca3def717 (diff)
downloadpoky-157c3be2ca93f076033f725ec1ee912df91f7488.tar.gz
oeqa/selftest/cases: Migrate test cases into the new oe-qa framework
New framework has different classes/decorators so adapt current test cases to support these. Changes include changes on base classes and decorators. Also include paths in selftest/__init__.py isn't needed because the loader is the standard unittest one. (From OE-Core rev: ddbbefdd124604d10bd47dd0266b55a764fcc0ab) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/archiver.py')
-rw-r--r--meta/lib/oeqa/selftest/cases/archiver.py41
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 @@
1import os
2import glob
3from oeqa.utils.commands import bitbake, get_bb_vars
4from oeqa.selftest.case import OESelftestTestCase
5from oeqa.core.decorator.oeid import OETestID
6
7class 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)