[oe-commits] Daniel Istrate : oeqa/selftest/archiver: Test that archiver filters on recipe name
git at git.openembedded.org
git at git.openembedded.org
Wed Sep 23 21:46:27 UTC 2015
Module: openembedded-core.git
Branch: master-next
Commit: 2642fb1e00878baa8eaec80015ff3678cb3088f8
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=2642fb1e00878baa8eaec80015ff3678cb3088f8
Author: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
Date: Tue Sep 22 14:31:50 2015 +0300
oeqa/selftest/archiver: Test that archiver filters on recipe name
[YOCTO #6929] this test validates the feature introduced in bug 6929
Signed-off-by: Daniel Istrate <daniel.alexandrux.istrate at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/lib/oeqa/selftest/archiver.py | 50 ++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/meta/lib/oeqa/selftest/archiver.py b/meta/lib/oeqa/selftest/archiver.py
new file mode 100644
index 0000000..f2030c4
--- /dev/null
+++ b/meta/lib/oeqa/selftest/archiver.py
@@ -0,0 +1,50 @@
+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 at intel.com>
+ AutomatedBy: Daniel Istrate <daniel.alexandrux.istrate at 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
+
+ # Update local.conf
+ self.write_config(features)
+
+ tmp_dir = get_bb_var('TMPDIR')
+ deploy_dir_src = get_bb_var('DEPLOY_DIR_SRC')
+ target_sys = get_bb_var('TARGET_SYS')
+ src_path = os.path.join(deploy_dir_src, target_sys)
+
+ # Delete tmp directory
+ shutil.rmtree(tmp_dir)
+
+ # Build core-image-minimal
+ bitbake('core-image-minimal')
+
+ # Check that include_recipe was included
+ is_included = len(glob.glob(src_path + '/%s*' % include_recipe))
+ self.assertEqual(1, is_included, 'Recipe %s was not included.' % include_recipe)
+
+ # Check that exclude_recipe was excluded
+ is_excluded = len(glob.glob(src_path + '/%s*' % exclude_recipe))
+ self.assertEqual(0, is_excluded, 'Recipe %s was not excluded.' % exclude_recipe)
More information about the Openembedded-commits
mailing list