mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
bitbake: bitbake-setup: tests: add a template-only test configuration
bitbake-setup conf.json can be purely template driven, to setup older yocto LTS (e.g. scarthgap) based layer-collections - where fragment support was not yet present in oe-core+bitbake. Add a configuration for that scenario and add it to the test routine. (Bitbake rev: 23e121befa0779fbb1f342984b583c04ccc637a0) Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
60d995ccc4
commit
151a0f6361
@@ -119,6 +119,11 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
"oe-template": "test-configuration-gizmo",
|
"oe-template": "test-configuration-gizmo",
|
||||||
"oe-fragments": ["test-fragment-2"]
|
"oe-fragments": ["test-fragment-2"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "gizmo-no-fragment",
|
||||||
|
"description": "Gizmo no-fragment template-only build configuration",
|
||||||
|
"oe-template": "test-configuration-gizmo"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "gadget-notemplate",
|
"name": "gadget-notemplate",
|
||||||
"description": "Gadget notemplate build configuration",
|
"description": "Gadget notemplate build configuration",
|
||||||
@@ -189,8 +194,9 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
else:
|
else:
|
||||||
self.assertIn(os.path.join(buildpath, "layers", l), bblayers)
|
self.assertIn(os.path.join(buildpath, "layers", l), bblayers)
|
||||||
|
|
||||||
for f in bitbake_config["oe-fragments"]:
|
if 'oe-fragment' in bitbake_config.keys():
|
||||||
self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f)))
|
for f in bitbake_config["oe-fragments"]:
|
||||||
|
self.assertTrue(os.path.exists(os.path.join(bb_conf_path, f)))
|
||||||
|
|
||||||
|
|
||||||
def test_setup(self):
|
def test_setup(self):
|
||||||
@@ -247,8 +253,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
self.add_file_to_testrepo('test-file', test_file_content)
|
self.add_file_to_testrepo('test-file', test_file_content)
|
||||||
|
|
||||||
# test-config-1 is tested as a registry config, test-config-2 as a local file
|
# test-config-1 is tested as a registry config, test-config-2 as a local file
|
||||||
test_configurations = {'test-config-1': {'cmdline': 'test-config-1', 'buildconfigs':('gadget','gizmo','gadget-notemplate','gizmo-notemplate')},
|
test_configurations = {'test-config-1': {'cmdline': 'test-config-1',
|
||||||
'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') } }
|
'buildconfigs':('gadget','gizmo',
|
||||||
|
'gizmo-no-fragment',
|
||||||
|
'gadget-notemplate','gizmo-notemplate')},
|
||||||
|
'test-config-2': {'cmdline': os.path.join(self.registrypath,'config-2/test-config-2.conf.json'),
|
||||||
|
'buildconfigs': ('gadget','gizmo',
|
||||||
|
'gizmo-no-fragment',
|
||||||
|
'gadget-notemplate','gizmo-notemplate',
|
||||||
|
'gizmo-notemplate-with-thisdir')}
|
||||||
|
}
|
||||||
for cf, v in test_configurations.items():
|
for cf, v in test_configurations.items():
|
||||||
for c in v['buildconfigs']:
|
for c in v['buildconfigs']:
|
||||||
out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c))
|
out = self.runbbsetup("init --non-interactive {} {}".format(v['cmdline'], c))
|
||||||
@@ -272,13 +286,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
prev_test_file_content = test_file_content
|
prev_test_file_content = test_file_content
|
||||||
test_file_content = 'modified\n'
|
test_file_content = 'modified\n'
|
||||||
self.add_file_to_testrepo('test-file', test_file_content)
|
self.add_file_to_testrepo('test-file', test_file_content)
|
||||||
for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'):
|
for c in ('gadget', 'gizmo',
|
||||||
|
'gizmo-env-passthrough',
|
||||||
|
'gizmo-no-fragment',
|
||||||
|
'gadget-notemplate', 'gizmo-notemplate'):
|
||||||
buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c))
|
buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c))
|
||||||
os.environ['BBPATH'] = os.path.join(buildpath, 'build')
|
os.environ['BBPATH'] = os.path.join(buildpath, 'build')
|
||||||
out = self.runbbsetup("status")
|
out = self.runbbsetup("status")
|
||||||
self.assertIn("Layer repository file://{} checked out into {}/layers/test-repo updated revision master from".format(self.testrepopath, buildpath), out[0])
|
self.assertIn("Layer repository file://{} checked out into {}/layers/test-repo updated revision master from".format(self.testrepopath, buildpath), out[0])
|
||||||
out = self.runbbsetup("update")
|
out = self.runbbsetup("update")
|
||||||
if c in ('gadget','gizmo'):
|
if c in ('gadget', 'gizmo'):
|
||||||
self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0])
|
self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0])
|
||||||
self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0])
|
self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0])
|
||||||
with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f:
|
with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f:
|
||||||
@@ -294,14 +311,16 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
self.git('checkout -b {}'.format(branch), cwd=self.testrepopath)
|
self.git('checkout -b {}'.format(branch), cwd=self.testrepopath)
|
||||||
self.add_file_to_testrepo('test-file', test_file_content)
|
self.add_file_to_testrepo('test-file', test_file_content)
|
||||||
json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch)
|
json_1 = self.add_json_config_to_registry('test-config-1.conf.json', branch, branch)
|
||||||
for c in ('gadget','gizmo','gadget-notemplate','gizmo-notemplate'):
|
for c in ('gadget', 'gizmo',
|
||||||
|
'gizmo-no-fragment',
|
||||||
|
'gadget-notemplate', 'gizmo-notemplate'):
|
||||||
buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c))
|
buildpath = os.path.join(self.tempdir, 'bitbake-builds', 'test-config-1-{}'.format(c))
|
||||||
os.environ['BBPATH'] = os.path.join(buildpath, 'build')
|
os.environ['BBPATH'] = os.path.join(buildpath, 'build')
|
||||||
out = self.runbbsetup("status")
|
out = self.runbbsetup("status")
|
||||||
self.assertIn("Configuration in {} has changed:".format(buildpath), out[0])
|
self.assertIn("Configuration in {} has changed:".format(buildpath), out[0])
|
||||||
self.assertIn('- "rev": "master"\n+ "rev": "another-branch"', out[0])
|
self.assertIn('- "rev": "master"\n+ "rev": "another-branch"', out[0])
|
||||||
out = self.runbbsetup("update")
|
out = self.runbbsetup("update")
|
||||||
if c in ('gadget','gizmo'):
|
if c in ('gadget', 'gizmo'):
|
||||||
self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0])
|
self.assertIn("Existing bitbake configuration directory renamed to {}/build/conf-backup.".format(buildpath), out[0])
|
||||||
self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0])
|
self.assertIn('-{}+{}'.format(prev_test_file_content, test_file_content), out[0])
|
||||||
with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f:
|
with open(os.path.join(buildpath, 'config', "config-upstream.json")) as f:
|
||||||
|
|||||||
Reference in New Issue
Block a user