From 157c3be2ca93f076033f725ec1ee912df91f7488 Mon Sep 17 00:00:00 2001 From: Leonardo Sandoval Date: Fri, 12 May 2017 14:40:21 -0700 Subject: oeqa/selftest/cases: Migrate test cases into the new oe-qa framework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Aníbal Limón Signed-off-by: Richard Purdie --- meta/lib/oeqa/selftest/cases/archiver.py | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 meta/lib/oeqa/selftest/cases/archiver.py (limited to 'meta/lib/oeqa/selftest/cases/archiver.py') 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 @@ +import os +import glob +from oeqa.utils.commands import bitbake, get_bb_vars +from oeqa.selftest.case import OESelftestTestCase +from oeqa.core.decorator.oeid import OETestID + +class Archiver(OESelftestTestCase): + + @OETestID(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 + AutomatedBy: Daniel Istrate + """ + + 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) + + bitbake('-c clean %s %s' % (include_recipe, exclude_recipe)) + bitbake("%s %s" % (include_recipe, exclude_recipe)) + + bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS']) + src_path = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['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) -- cgit v1.2.3-54-g00ecf