All of lore.kernel.org
 help / color / mirror / Atom feed
* [OE-core][PATCH 0/1] oeqa/runtime/cases/ptest: Make output content path absolute
@ 2020-06-22 17:33 Andrej Valek
  2020-06-22 17:33 ` [OE-core][PATCH 1/1] " Andrej Valek
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Valek @ 2020-06-22 17:33 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrej Valek, Peter Marko

Ptests could be executed on any path. So output content should be placed
in workdir and not into current directory. Different path outside of
the builddir should be specified by setting TEST_LOG_DIR.

Isn't it better to use "os.chidir(self.td.get('TOPDIR'))" instead?


 meta/lib/oeqa/runtime/cases/ptest.py | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.11.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [OE-core][PATCH 1/1] oeqa/runtime/cases/ptest: Make output content path absolute
  2020-06-22 17:33 [OE-core][PATCH 0/1] oeqa/runtime/cases/ptest: Make output content path absolute Andrej Valek
@ 2020-06-22 17:33 ` Andrej Valek
  2020-06-22 17:36   ` Khem Raj
  0 siblings, 1 reply; 3+ messages in thread
From: Andrej Valek @ 2020-06-22 17:33 UTC (permalink / raw)
  To: openembedded-core; +Cc: Andrej Valek, Peter Marko

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>
---
 meta/lib/oeqa/runtime/cases/ptest.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/lib/oeqa/runtime/cases/ptest.py b/meta/lib/oeqa/runtime/cases/ptest.py
index 1b1474adcf..919901d465 100644
--- a/meta/lib/oeqa/runtime/cases/ptest.py
+++ b/meta/lib/oeqa/runtime/cases/ptest.py
@@ -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
+        # is 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')
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [OE-core][PATCH 1/1] oeqa/runtime/cases/ptest: Make output content path absolute
  2020-06-22 17:33 ` [OE-core][PATCH 1/1] " Andrej Valek
@ 2020-06-22 17:36   ` Khem Raj
  0 siblings, 0 replies; 3+ messages in thread
From: Khem Raj @ 2020-06-22 17:36 UTC (permalink / raw)
  To: Andrej Valek, openembedded-core; +Cc: Peter Marko



On 6/22/20 10:33 AM, Andrej Valek wrote:
> 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>
> ---
>   meta/lib/oeqa/runtime/cases/ptest.py | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/meta/lib/oeqa/runtime/cases/ptest.py b/meta/lib/oeqa/runtime/cases/ptest.py
> index 1b1474adcf..919901d465 100644
> --- a/meta/lib/oeqa/runtime/cases/ptest.py
> +++ b/meta/lib/oeqa/runtime/cases/ptest.py
> @@ -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
> +        # is created relative to current directory

'is' is not needed in above comment.

> +        if not os.path.isabs(test_log_dir):
> +            test_log_dir = os.path.join(self.td.get('TOPDIR', ''), test_log_dir)

will it expose full paths in final logs ? that may be shared publically ?

>           # 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')
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-06-22 17:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 17:33 [OE-core][PATCH 0/1] oeqa/runtime/cases/ptest: Make output content path absolute Andrej Valek
2020-06-22 17:33 ` [OE-core][PATCH 1/1] " Andrej Valek
2020-06-22 17:36   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.