On Fri, 2021-09-17 at 14:59 +0200, Alexander Kanavin wrote:
> This makes it easier for the AB scripts (particularly, collect-results)
> to access and archive these items, as they can contain useful information
> when ptests or other qemu tests fail.
>
> [YOCTO #14518]
>
> Signed-off-by: Alexander Kanavin <[email protected]>
> ---
> meta/classes/testimage.bbclass | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
> index 3c689aec913..305e26d24d6 100644
> --- a/meta/classes/testimage.bbclass
> +++ b/meta/classes/testimage.bbclass
> @@ -201,6 +201,7 @@ def testimage_main(d):
> import json
> import signal
> import logging
> + import shutil
>
> from bb.utils import export_proxies
> from oeqa.core.utils.misc import updateTestData
> @@ -408,10 +409,17 @@ def testimage_main(d):
> get_testimage_result_id(configuration),
> dump_streams=d.getVar('TESTREPORT_FULLLOGS'))
> results.logSummary(pn)
> +
> + # Copy additional logs to tmp/log/oeqa so it's easier to find them
> + targetdir = os.path.join(get_testimage_json_result_dir(d),
> d.getVar("PN"))
> + os.makedirs(targetdir, exist_ok=True)
> + shutil.copy(bootlog, targetdir)
> + shutil.copy(d.getVar("BB_LOGFILE"), targetdir)
> +
> if not results or not complete:
> - bb.fatal('%s - FAILED - tests were interrupted during execution' %
> pn, forcelog=True)
> + bb.fatal('%s - FAILED - tests were interrupted during execution,
> check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
> if not results.wasSuccessful():
> - bb.fatal('%s - FAILED - check the task log and the ssh log' % pn,
> forcelog=True)
> + bb.fatal('%s - FAILED - also check the logs in %s' % (pn,
> d.getVar("LOG_DIR")), forcelog=True)
>
> def get_runtime_paths(d):
> """
I'm a little torn on this too as I dislike copies of files in multiple places.
Part of me wonders if we should move the files to this location at generation
instead. That would break any existing users though and make it less obvious
when looking at WORKDIR for a given failure and I think having WORKDIR remain as
the place for a given task's execution is important for user expectations.
Symlinking them may be the lesser of several issues. Perhaps they should really
be in ${T} (in WORKDIR) too.
I did wonder about moving and standardising on tmp/log for more logfiles a while
back but came down against as it would undermine the usefulness and user
expectations of WORKDIR.
So symlinking here may be the best option?
Cheers,
Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#156153):
https://lists.openembedded.org/g/openembedded-core/message/156153
Mute This Topic: https://lists.openembedded.org/mt/85675469/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-