diff options
-rw-r--r-- | meta/lib/oeqa/selftest/cases/recipetool.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/cases/recipetool.py b/meta/lib/oeqa/selftest/cases/recipetool.py index a55d7dea15..bfe06eb4a5 100644 --- a/meta/lib/oeqa/selftest/cases/recipetool.py +++ b/meta/lib/oeqa/selftest/cases/recipetool.py | |||
@@ -1247,6 +1247,34 @@ class RecipetoolAppendsrcTests(RecipetoolAppendsrcBase): | |||
1247 | # A more complex test: existing entry in src_uri with different param | 1247 | # A more complex test: existing entry in src_uri with different param |
1248 | self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine') | 1248 | self.test_recipetool_appendsrcfile_existing_in_src_uri_diff_params(machine='mymachine') |
1249 | 1249 | ||
1250 | def test_recipetool_appendsrcfile_update_recipe_basic(self): | ||
1251 | testrecipe = "base-files" | ||
1252 | recipefile = get_bb_var('FILE', testrecipe) | ||
1253 | result = runCmd('bitbake-layers show-layers') | ||
1254 | layerrecipe = None | ||
1255 | for line in result.output.splitlines()[3:]: | ||
1256 | with open("/tmp/juju.txt", "a") as file: | ||
1257 | layer = line.split()[1] | ||
1258 | print(layer, file=file) | ||
1259 | if layer in recipefile: | ||
1260 | layerrecipe = layer | ||
1261 | break | ||
1262 | self.assertTrue(layerrecipe, 'Unable to find the layer containing %s' % testrecipe) | ||
1263 | cmd = 'recipetool appendsrcfile -u %s %s %s' % (layerrecipe, testrecipe, self.testfile) | ||
1264 | result = runCmd(cmd) | ||
1265 | self.assertNotIn('Traceback', result.output) | ||
1266 | self.add_command_to_tearDown('cd %s; rm -f %s/%s; git checkout .' % (os.path.dirname(recipefile), testrecipe, os.path.basename(self.testfile))) | ||
1267 | |||
1268 | expected_status = [(' M', '.*/%s$' % os.path.basename(recipefile)), | ||
1269 | ('??', '.*/%s/%s/%s$' % (testrecipe, testrecipe, os.path.basename(self.testfile)))] | ||
1270 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | ||
1271 | result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile)) | ||
1272 | removelines = [] | ||
1273 | addlines = [ | ||
1274 | 'file://%s \\\\' % os.path.basename(self.testfile), | ||
1275 | ] | ||
1276 | self._check_diff(result.output, addlines, removelines) | ||
1277 | |||
1250 | def test_recipetool_appendsrcfile_replace_file_srcdir(self): | 1278 | def test_recipetool_appendsrcfile_replace_file_srcdir(self): |
1251 | testrecipe = 'bash' | 1279 | testrecipe = 'bash' |
1252 | filepath = 'Makefile.in' | 1280 | filepath = 'Makefile.in' |