diff options
-rw-r--r-- | bitbake/lib/bb/tests/setup.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/setup.py b/bitbake/lib/bb/tests/setup.py index c1e753b14a..495d1da203 100644 --- a/bitbake/lib/bb/tests/setup.py +++ b/bitbake/lib/bb/tests/setup.py | |||
@@ -120,6 +120,17 @@ 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-env-passthrough", | ||
124 | "description": "Gizmo build configuration with environment-passthrough", | ||
125 | "bb-layers": ["layerC","layerD/meta-layer"], | ||
126 | "oe-fragments": ["test-fragment-1"], | ||
127 | "bb-env-passthrough-additions": [ | ||
128 | "BUILD_ID", | ||
129 | "BUILD_DATE", | ||
130 | "BUILD_SERVER" | ||
131 | ] | ||
132 | }, | ||
133 | { | ||
123 | "name": "gizmo-no-fragment", | 134 | "name": "gizmo-no-fragment", |
124 | "description": "Gizmo no-fragment template-only build configuration", | 135 | "description": "Gizmo no-fragment template-only build configuration", |
125 | "oe-template": "test-configuration-gizmo" | 136 | "oe-template": "test-configuration-gizmo" |
@@ -198,6 +209,15 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
198 | for f in bitbake_config["oe-fragments"]: | 209 | for f in bitbake_config["oe-fragments"]: |
199 | self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f))) | 210 | self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f))) |
200 | 211 | ||
212 | if 'bb-environment-passthrough' in bitbake_config.keys(): | ||
213 | with open(os.path.join(bb_build_path, 'init-build-env'), 'r') as f: | ||
214 | init_build_env = f.read() | ||
215 | self.assertTrue('BB_ENV_PASSTHROUGH_ADDITIONS' in init_build_env) | ||
216 | self.assertTrue('BUILD_ID' in init_build_env) | ||
217 | self.assertTrue('BUILD_DATE' in init_build_env) | ||
218 | self.assertTrue('BUILD_SERVER' in init_build_env) | ||
219 | # a more throrough test could be to initialize a bitbake build-env, export FOO to the shell environment, set the env-passthrough on it and finally check against 'bitbake-getvar FOO' | ||
220 | |||
201 | 221 | ||
202 | def test_setup(self): | 222 | def test_setup(self): |
203 | # unset BBPATH to ensure tests run in isolation from the existing bitbake environment | 223 | # unset BBPATH to ensure tests run in isolation from the existing bitbake environment |
@@ -255,10 +275,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
255 | # test-config-1 is tested as a registry config, test-config-2 as a local file | 275 | # test-config-1 is tested as a registry config, test-config-2 as a local file |
256 | test_configurations = {'test-config-1': {'cmdline': 'test-config-1', | 276 | test_configurations = {'test-config-1': {'cmdline': 'test-config-1', |
257 | 'buildconfigs':('gadget','gizmo', | 277 | 'buildconfigs':('gadget','gizmo', |
278 | 'gizmo-env-passthrough', | ||
258 | 'gizmo-no-fragment', | 279 | 'gizmo-no-fragment', |
259 | 'gadget-notemplate','gizmo-notemplate')}, | 280 | 'gadget-notemplate','gizmo-notemplate')}, |
260 | 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), | 281 | 'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'), |
261 | 'buildconfigs': ('gadget','gizmo', | 282 | 'buildconfigs': ('gadget','gizmo', |
283 | 'gizmo-env-passthrough', | ||
262 | 'gizmo-no-fragment', | 284 | 'gizmo-no-fragment', |
263 | 'gadget-notemplate','gizmo-notemplate', | 285 | 'gadget-notemplate','gizmo-notemplate', |
264 | 'gizmo-notemplate-with-thisdir')} | 286 | 'gizmo-notemplate-with-thisdir')} |
@@ -312,6 +334,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"])) | |||
312 | self.add_file_to_testrepo('test-file', test_file_content) | 334 | self.add_file_to_testrepo('test-file', test_file_content) |
313 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) | 335 | json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch) |
314 | for c in ('gadget', 'gizmo', | 336 | for c in ('gadget', 'gizmo', |
337 | 'gizmo-env-passthrough', | ||
315 | 'gizmo-no-fragment', | 338 | 'gizmo-no-fragment', |
316 | 'gadget-notemplate', 'gizmo-notemplate'): | 339 | 'gadget-notemplate', 'gizmo-notemplate'): |
317 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) | 340 | buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c)) |