diff options
author | Lucian Musat <george.l.musat@intel.com> | 2015-09-24 12:14:44 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-28 12:00:30 +0100 |
commit | 994915b0afc0421a99ec1b8be59a826cdaab1a16 (patch) | |
tree | f473221b95fb668f5b4648579284e9f492fbb2f6 /meta/classes | |
parent | f8da3b616c9ec3f27514bd28b540c4043a5efd6a (diff) | |
download | poky-994915b0afc0421a99ec1b8be59a826cdaab1a16.tar.gz |
oeqa/testimage: Remove absolute path to oeqa from json
In the json file the whole datastore is serialized which contains
absolute path to the oeqa folder. This breaks the functionality
when trying to run the tests from other machines.
(From OE-Core rev: 94057ccc70aa3fe29d774f571a65f56fd1285d4c)
Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/testimage.bbclass | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index c62e391ec2..2efab29d2b 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -198,9 +198,18 @@ def exportTests(d,tc): | |||
198 | savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir | 198 | savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir |
199 | savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds | 199 | savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds |
200 | 200 | ||
201 | with open(os.path.join(exportpath, "testdata.json"), "w") as f: | 201 | json_file = os.path.join(exportpath, "testdata.json") |
202 | with open(json_file, "w") as f: | ||
202 | json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True) | 203 | json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True) |
203 | 204 | ||
205 | # Replace absolute path with relative in the file | ||
206 | exclude_path = os.path.join(d.getVar("COREBASE", True),'meta','lib','oeqa') | ||
207 | f1 = open(json_file,'r').read() | ||
208 | f2 = open(json_file,'w') | ||
209 | m = f1.replace(exclude_path,'oeqa') | ||
210 | f2.write(m) | ||
211 | f2.close() | ||
212 | |||
204 | # now start copying files | 213 | # now start copying files |
205 | # we'll basically copy everything under meta/lib/oeqa, with these exceptions | 214 | # we'll basically copy everything under meta/lib/oeqa, with these exceptions |
206 | # - oeqa/targetcontrol.py - not needed | 215 | # - oeqa/targetcontrol.py - not needed |