diff options
-rw-r--r-- | bitbake/lib/bb/tests/setup.py | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py index 747a9b733f..c1e753b14a 100644 --- a/bitbake/lib/bb/tests/setup.py +++ b/bitbake/lib/bb/tests/setup.py | |||
@@ -120,6 +120,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
120 | "oe-fragments": ["test-fragment-2"] | 120 | "oe-fragments": ["test-fragment-2"] |
121 | }, | 121 | }, |
122 | { | 122 | { |
123 | "name": "gizmo-no-fragment", | ||
124 | "description": "Gizmo no-fragment template-only build configuration", | ||
125 | "oe-template": "test-configuration-gizmo" | ||
126 | }, | ||
127 | { | ||
123 | "name": "gadget-notemplate", | 128 | "name": "gadget-notemplate", |
124 | "description": "Gadget notemplate build configuration", | 129 | "description": "Gadget notemplate build configuration", |
125 | "bb-layers": ["layerA","layerB/meta-layer"], | 130 | "bb-layers": ["layerA","layerB/meta-layer"], |
@@ -189,8 +194,9 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
189 | else: | 194 | else: |
190 | self.assertIn(os.path.join(buildpath, "layers", l), bblayers) | 195 | self.assertIn(os.path.join(buildpath, "layers", l), bblayers) |
191 | 196 | ||
192 | for f in bitbake_config["oe-fragments"]: | 197 | if 'oe-fragment' in bitbake_config.keys(): |
193 | self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f))) | 198 | for f in bitbake_config["oe-fragments"]: |
199 | self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f))) | ||
194 | 200 | ||
195 | 201 | ||
196 | def test_setup(self): | 202 | def test_setup(self): |
@@ -247,8 +253,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
247 | self.add_file_to_testrepo('test-file', test_file_content) | 253 | self.add_file_to_testrepo('test-file', test_file_content) |
248 | 254 | ||
249 | # test-config-1 is tested as a registry config, test-config-2 as a local file | 255 | # test-config-1 is tested as a registry config, test-config-2 as a local file |
250 | test_configurations = {'test-config-1': {'cmdline': 'test-config-1', 'buildconfigs':('gadget','gizmo','gadget-notemplate','gizmo-notemplate')}, | 256 | test_configurations = {'test-config-1': {'cmdline': 'test-config-1', |
251 | 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), 'buildconfigs': ('gadget','gizmo','gadget-notemplate','gizmo-notemplate', 'gizmo-notemplate-with-thisdir') } } | 257 | 'buildconfigs':('gadget','gizmo', |
258 | 'gizmo-no-fragment', | ||
259 | 'gadget-notemplate','gizmo-notemplate')}, | ||
260 | 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), | ||
261 | 'buildconfigs': ('gadget','gizmo', | ||
262 | 'gizmo-no-fragment', | ||
263 | 'gadget-notemplate','gizmo-notemplate', | ||
264 | 'gizmo-notemplate-with-thisdir')} | ||
265 | } | ||
252 | for cf, v in test_configurations.items(): | 266 | for cf, v in test_configurations.items(): |
253 | for c in v['buildconfigs']: | 267 | for c in v['buildconfigs']: |
254 | out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) | 268 | out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c)) |
@@ -272,13 +286,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
272 | prev_test_file_content = test_file_content | 286 | prev_test_file_content = test_file_content |
273 | test_file_content = 'modified\n' | 287 | test_file_content = 'modified\n' |
274 | self.add_file_to_testrepo('test-file', test_file_content) | 288 | self.add_file_to_testrepo('test-file', test_file_content) |
275 | for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): | 289 | for c in ('gadget', 'gizmo', |
290 | 'gizmo-env-passthrough', | ||
291 | 'gizmo-no-fragment', | ||
292 | 'gadget-notemplate', 'gizmo-notemplate'): | ||
276 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) | 293 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) |
277 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') | 294 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') |
278 | out = self.runbbsetup("status") | 295 | out = self.runbbsetup("status") |
279 | self.assertIn("Layer repository file://{} checked out into {}/layers/test-repo updated revision master from".format(self.testrepopath, buildpath), out[0]) | 296 | self.assertIn("Layer repository file://{} checked out into {}/layers/test-repo updated revision master from".format(self.testrepopath, buildpath), out[0]) |
280 | out = self.runbbsetup("update") | 297 | out = self.runbbsetup("update") |
281 | if c in ('gadget','gizmo'): | 298 | if c in ('gadget', 'gizmo'): |
282 | self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0]) | 299 | self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0]) |
283 | self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0]) | 300 | self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0]) |
284 | with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: | 301 | with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: |
@@ -294,14 +311,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
294 | self.git('checkout -b {}'.format(branch), cwd=self.testrepopath) | 311 | self.git('checkout -b {}'.format(branch), cwd=self.testrepopath) |
295 | self.add_file_to_testrepo('test-file', test_file_content) | 312 | self.add_file_to_testrepo('test-file', test_file_content) |
296 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) | 313 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) |
297 | for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'): | 314 | for c in ('gadget', 'gizmo', |
315 | 'gizmo-no-fragment', | ||
316 | 'gadget-notemplate', 'gizmo-notemplate'): | ||
298 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) | 317 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) |
299 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') | 318 | os.environ['BBPATH'] = os.path.join(buildpath, 'build') |
300 | out = self.runbbsetup("status") | 319 | out = self.runbbsetup("status") |
301 | self.assertIn("Configuration in {} has changed:".format(buildpath), out[0]) | 320 | self.assertIn("Configuration in {} has changed:".format(buildpath), out[0]) |
302 | self.assertIn('- "rev": "master"\n+ "rev": "another-branch"', out[0]) | 321 | self.assertIn('- "rev": "master"\n+ "rev": "another-branch"', out[0]) |
303 | out = self.runbbsetup("update") | 322 | out = self.runbbsetup("update") |
304 | if c in ('gadget','gizmo'): | 323 | if c in ('gadget', 'gizmo'): |
305 | self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0]) | 324 | self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0]) |
306 | self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0]) | 325 | self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0]) |
307 | with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: | 326 | with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f: |