diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/lib/oeqa/selftest/archiver.py | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/archiver.py b/meta/lib/oeqa/selftest/archiver.py index d7f215cbf6..06b2597050 100644 --- a/meta/lib/oeqa/selftest/archiver.py +++ b/meta/lib/oeqa/selftest/archiver.py | |||
@@ -41,3 +41,79 @@ class Archiver(oeSelfTest): | |||
41 | # Check that exclude_recipe was excluded | 41 | # Check that exclude_recipe was excluded |
42 | excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe)) | 42 | excluded_present = len(glob.glob(src_path + '/%s-*' % exclude_recipe)) |
43 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe) | 43 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % exclude_recipe) |
44 | |||
45 | |||
46 | def test_archiver_filters_by_type(self): | ||
47 | """ | ||
48 | Summary: The archiver is documented to filter on the recipe type. | ||
49 | Expected: 1. included recipe type (target) should be included | ||
50 | 2. other types should be excluded | ||
51 | Product: oe-core | ||
52 | Author: André Draszik <adraszik@tycoint.com> | ||
53 | """ | ||
54 | |||
55 | target_recipe = 'initscripts' | ||
56 | native_recipe = 'zlib-native' | ||
57 | |||
58 | features = 'INHERIT += "archiver"\n' | ||
59 | features += 'ARCHIVER_MODE[src] = "original"\n' | ||
60 | features += 'COPYLEFT_RECIPE_TYPES = "target"\n' | ||
61 | self.write_config(features) | ||
62 | |||
63 | bitbake('-c clean %s %s' % (target_recipe, native_recipe)) | ||
64 | bitbake("%s -c deploy_archives %s" % (target_recipe, native_recipe)) | ||
65 | |||
66 | bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS']) | ||
67 | src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS']) | ||
68 | src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS']) | ||
69 | |||
70 | # Check that target_recipe was included | ||
71 | included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipe)) | ||
72 | self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipe) | ||
73 | |||
74 | # Check that native_recipe was excluded | ||
75 | excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipe)) | ||
76 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipe) | ||
77 | |||
78 | def test_archiver_filters_by_type_and_name(self): | ||
79 | """ | ||
80 | Summary: Test that the archiver archives by recipe type, taking the | ||
81 | recipe name into account. | ||
82 | Expected: 1. included recipe type (target) should be included | ||
83 | 2. other types should be excluded | ||
84 | 3. recipe by name should be included / excluded, | ||
85 | overriding previous decision by type | ||
86 | Product: oe-core | ||
87 | Author: André Draszik <adraszik@tycoint.com> | ||
88 | """ | ||
89 | |||
90 | target_recipes = [ 'initscripts', 'zlib' ] | ||
91 | native_recipes = [ 'update-rc.d-native', 'zlib-native' ] | ||
92 | |||
93 | features = 'INHERIT += "archiver"\n' | ||
94 | features += 'ARCHIVER_MODE[src] = "original"\n' | ||
95 | features += 'COPYLEFT_RECIPE_TYPES = "target"\n' | ||
96 | features += 'COPYLEFT_PN_INCLUDE = "%s"\n' % native_recipes[1] | ||
97 | features += 'COPYLEFT_PN_EXCLUDE = "%s"\n' % target_recipes[1] | ||
98 | self.write_config(features) | ||
99 | |||
100 | bitbake('-c clean %s %s' % (' '.join(target_recipes), ' '.join(native_recipes))) | ||
101 | bitbake('-c deploy_archives %s %s' % (' '.join(target_recipes), ' '.join(native_recipes))) | ||
102 | |||
103 | bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS', 'BUILD_SYS']) | ||
104 | src_path_target = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS']) | ||
105 | src_path_native = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['BUILD_SYS']) | ||
106 | |||
107 | # Check that target_recipe[0] and native_recipes[1] were included | ||
108 | included_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[0])) | ||
109 | self.assertTrue(included_present, 'Recipe %s was not included.' % target_recipes[0]) | ||
110 | |||
111 | included_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[1])) | ||
112 | self.assertTrue(included_present, 'Recipe %s was not included.' % native_recipes[1]) | ||
113 | |||
114 | # Check that native_recipes[0] and target_recipes[1] were excluded | ||
115 | excluded_present = len(glob.glob(src_path_native + '/%s-*' % native_recipes[0])) | ||
116 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % native_recipes[0]) | ||
117 | |||
118 | excluded_present = len(glob.glob(src_path_target + '/%s-*' % target_recipes[1])) | ||
119 | self.assertFalse(excluded_present, 'Recipe %s was not excluded.' % target_recipes[1]) | ||