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 11:58:31 +0100 |
commit | 94057ccc70aa3fe29d774f571a65f56fd1285d4c (patch) | |
tree | 77c2b0a38c01ac7821022a287d9265893ab7cc84 /meta/classes/testimage.bbclass | |
parent | a6967f6e441eca758058ced9982b715984ee9b5b (diff) | |
download | openembedded-core-94057ccc70aa3fe29d774f571a65f56fd1285d4c.tar.gz openembedded-core-94057ccc70aa3fe29d774f571a65f56fd1285d4c.tar.bz2 openembedded-core-94057ccc70aa3fe29d774f571a65f56fd1285d4c.zip |
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.
Signed-off-by: Lucian Musat <george.l.musat@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/testimage.bbclass')
-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): savedata["host_dumper"]["parent_dir"] = tc.host_dumper.parent_dir savedata["host_dumper"]["cmds"] = tc.host_dumper.cmds - with open(os.path.join(exportpath, "testdata.json"), "w") as f: + json_file = os.path.join(exportpath, "testdata.json") + with open(json_file, "w") as f: json.dump(savedata, f, skipkeys=True, indent=4, sort_keys=True) + # Replace absolute path with relative in the file + exclude_path = os.path.join(d.getVar("COREBASE", True),'meta','lib','oeqa') + f1 = open(json_file,'r').read() + f2 = open(json_file,'w') + m = f1.replace(exclude_path,'oeqa') + f2.write(m) + f2.close() + # now start copying files # we'll basically copy everything under meta/lib/oeqa, with these exceptions # - oeqa/targetcontrol.py - not needed |