summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/cases/archiver.py66
1 files changed, 66 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/archiver.py b/meta/lib/oeqa/selftest/cases/archiver.py
index f8672f8abb..6bd0e06ec4 100644
--- a/meta/lib/oeqa/selftest/cases/archiver.py
+++ b/meta/lib/oeqa/selftest/cases/archiver.py
@@ -129,3 +129,69 @@ class Archiver(OESelftestTestCase):
129 self.write_config(features) 129 self.write_config(features)
130 130
131 bitbake('-n core-image-sato') 131 bitbake('-n core-image-sato')
132
133 def _test_archiver_mode(self, mode, target_file_name, extra_config=None):
134 target = "selftest-ed"
135
136 features = 'INHERIT += "archiver"\n'
137 features += 'ARCHIVER_MODE[src] = "%s"\n' % (mode)
138 if extra_config:
139 features += extra_config
140 self.write_config(features)
141
142 bitbake('-c clean %s' % (target))
143 bitbake('-c deploy_archives %s' % (target))
144
145 bb_vars = get_bb_vars(['DEPLOY_DIR_SRC', 'TARGET_SYS'])
146 glob_str = os.path.join(bb_vars['DEPLOY_DIR_SRC'], bb_vars['TARGET_SYS'], '%s-*' % (target))
147 glob_result = glob.glob(glob_str)
148 self.assertTrue(glob_result, 'Missing archiver directory for %s' % (target))
149
150 archive_path = os.path.join(glob_result[0], target_file_name)
151 self.assertTrue(os.path.exists(archive_path), 'Missing archive file %s' % (target_file_name))
152
153 def test_archiver_mode_original(self):
154 """
155 Test that the archiver works in with `ARCHIVER_MODE[src] = "original"`.
156 """
157
158 self._test_archiver_mode('original', 'ed-1.14.1.tar.lz')
159
160 def test_archiver_mode_patched(self):
161 """
162 Test that the archiver works in with `ARCHIVER_MODE[src] = "patched"`.
163 """
164
165 self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-patched.tar.gz')
166
167 def test_archiver_mode_configured(self):
168 """
169 Test that the archiver works in with `ARCHIVER_MODE[src] = "configured"`.
170 """
171
172 self._test_archiver_mode('configured', 'selftest-ed-1.14.1-r0-configured.tar.gz')
173
174 def test_archiver_mode_recipe(self):
175 """
176 Test that the archiver works in with `ARCHIVER_MODE[recipe] = "1"`.
177 """
178
179 self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-recipe.tar.gz',
180 'ARCHIVER_MODE[recipe] = "1"\n')
181
182 def test_archiver_mode_diff(self):
183 """
184 Test that the archiver works in with `ARCHIVER_MODE[diff] = "1"`.
185 Exclusions controlled by `ARCHIVER_MODE[diff-exclude]` are not yet tested.
186 """
187
188 self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-diff.gz',
189 'ARCHIVER_MODE[diff] = "1"\n')
190
191 def test_archiver_mode_dumpdata(self):
192 """
193 Test that the archiver works in with `ARCHIVER_MODE[dumpdata] = "1"`.
194 """
195
196 self._test_archiver_mode('patched', 'selftest-ed-1.14.1-r0-showdata.dump',
197 'ARCHIVER_MODE[dumpdata] = "1"\n')