diff options
Diffstat (limited to 'meta/lib/oeqa/selftest')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/bblayers.py | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/bblayers.py b/meta/lib/oeqa/selftest/cases/bblayers.py index f2460cb451..e2009496ad 100644 --- a/meta/lib/oeqa/selftest/cases/bblayers.py +++ b/meta/lib/oeqa/selftest/cases/bblayers.py | |||
@@ -152,12 +152,12 @@ class BitbakeLayers(OESelftestTestCase): | |||
152 | self.validate_layersjson(jsonfile) | 152 | self.validate_layersjson(jsonfile) |
153 | 153 | ||
154 | # The revision-under-test may not necessarily be available on the remote server, | 154 | # The revision-under-test may not necessarily be available on the remote server, |
155 | # so replace it with a revision that has a yocto-4.0 tag. | 155 | # so replace it with a revision that has a yocto-4.1 tag. |
156 | import json | 156 | import json |
157 | with open(jsonfile) as f: | 157 | with open(jsonfile) as f: |
158 | data = json.load(f) | 158 | data = json.load(f) |
159 | for s in data['sources']: | 159 | for s in data['sources']: |
160 | data['sources'][s]['git-remote']['rev'] = '00cfdde791a0176c134f31e5a09eff725e75b905' | 160 | data['sources'][s]['git-remote']['rev'] = '5200799866b92259e855051112520006e1aaaac0' |
161 | with open(jsonfile, 'w') as f: | 161 | with open(jsonfile, 'w') as f: |
162 | json.dump(data, f) | 162 | json.dump(data, f) |
163 | 163 | ||
@@ -165,3 +165,25 @@ class BitbakeLayers(OESelftestTestCase): | |||
165 | result = runCmd('{}/setup-layers --destdir {}'.format(self.testlayer_path, testcheckoutdir)) | 165 | result = runCmd('{}/setup-layers --destdir {}'.format(self.testlayer_path, testcheckoutdir)) |
166 | layers_json = os.path.join(testcheckoutdir, ".oe-layers.json") | 166 | layers_json = os.path.join(testcheckoutdir, ".oe-layers.json") |
167 | self.assertTrue(os.path.exists(layers_json), "File {} not found in test layer checkout".format(layers_json)) | 167 | self.assertTrue(os.path.exists(layers_json), "File {} not found in test layer checkout".format(layers_json)) |
168 | |||
169 | # As setup-layers checkout out an old revision of poky, there is no setup-build symlink, | ||
170 | # and we need to run oe-setup-build directly from the current poky tree under test | ||
171 | oe_setup_build = os.path.join(get_bb_var('COREBASE'), 'scripts/oe-setup-build') | ||
172 | oe_setup_build_l = os.path.join(testcheckoutdir, 'setup-build') | ||
173 | os.symlink(oe_setup_build,oe_setup_build_l) | ||
174 | |||
175 | cmd = '{} --layerlist {} list -v'.format(oe_setup_build_l, layers_json) | ||
176 | result = runCmd(cmd) | ||
177 | cond = "conf/templates/default" in result.output | ||
178 | self.assertTrue(cond, "Incorrect output from {}: {}".format(cmd, result.output)) | ||
179 | |||
180 | # rather than hardcode the build setup cmdline here, let's actually run what the tool suggests to the user | ||
181 | conf = None | ||
182 | if 'poky-default' in result.output: | ||
183 | conf = 'poky-default' | ||
184 | elif 'meta-default' in result.output: | ||
185 | conf = 'meta-default' | ||
186 | self.assertIsNotNone(conf, "Could not find the configuration to set up a build in the output: {}".format(result.output)) | ||
187 | |||
188 | cmd = '{} --layerlist {} setup -c {} --no-shell'.format(oe_setup_build_l, layers_json, conf) | ||
189 | result = runCmd(cmd) | ||