]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/runtime/cases/ptest: Make output content path absolute
authorAndrej Valek <andrej.valek@siemens.com>
Mon, 22 Jun 2020 17:33:07 +0000 (19:33 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 23 Jun 2020 11:27:51 +0000 (12:27 +0100)
The output content is created in current directory, because json content
has no defined absolute path to WORKDIR as in bitbake.

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/runtime/cases/ptest.py

index 1b1474adcf10192aebf18ef9f7b5b827bed0eabf..a9572c81f002b1529d7346f6a819b63f5df35d80 100644 (file)
@@ -42,6 +42,10 @@ class PtestRunnerTest(OERuntimeTestCase):
         # testdata.json is generated.
         if not test_log_dir:
             test_log_dir = os.path.join(self.td.get('WORKDIR', ''), 'testimage')
+        # Make the test output path absolute, otherwise the output content will be
+        # created relative to current directory
+        if not os.path.isabs(test_log_dir):
+            test_log_dir = os.path.join(self.td.get('TOPDIR', ''), test_log_dir)
         # Don't use self.td.get('DATETIME'), it's from testdata.json, not
         # up-to-date, and may cause "File exists" when re-reun.
         timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')