From: Mikko Rapeli <mikko.rapeli@linaro.org>
To: openembedded-core@lists.openembedded.org
Cc: Mikko Rapeli <mikko.rapeli@linaro.org>
Subject: [PATCH 2/2] oeqa parselogs.py: use get_data() to fetch image specific error list
Date: Thu, 17 Nov 2022 09:12:23 +0200 [thread overview]
Message-ID: <20221117071223.107064-3-mikko.rapeli@linaro.org> (raw)
In-Reply-To: <20221117071223.107064-1-mikko.rapeli@linaro.org>
Runtime oeqa test parselogs.py checks dmesg output for errors. It has
hard coded machine specific exceptions for errors which can be ignored.
To re-use of this test on other machine targets and images, use
get_data() function to get the list of error strings to ignore
"ignore_errors" from image specific "testimage_data.json" file.
The json file stores this data as list under test method name and key
"ignore_errors. For example:
{"test_parselogs":{"ignore_errors":[
"error strings which will be ignored",
"another error strings which will be ignored"
]}}
If the json file does not exist, parselogs.py still falls back to using
the hardcoded defaults.
Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
meta/lib/oeqa/runtime/cases/parselogs.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/meta/lib/oeqa/runtime/cases/parselogs.py b/meta/lib/oeqa/runtime/cases/parselogs.py
index e67d3750da..c1d92db5d6 100644
--- a/meta/lib/oeqa/runtime/cases/parselogs.py
+++ b/meta/lib/oeqa/runtime/cases/parselogs.py
@@ -12,6 +12,7 @@ from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.data import skipIfDataVar
from oeqa.runtime.decorator.package import OEHasPackage
+from oeqa.utils.data import get_data
#in the future these lists could be moved outside of module
errors = ["error", "cannot", "can\'t", "failed"]
@@ -316,10 +317,18 @@ class ParseLogsTest(OERuntimeTestCase):
grepcmd += '" ' + str(log) + " | grep -Eiv \'"
try:
- errorlist = ignore_errors[self.getMachine()]
- except KeyError:
- self.msg += 'No ignore list found for this machine, using default\n'
- errorlist = ignore_errors['default']
+ # get list of strings to ignore from image specific testimage_data.json with format:
+ # {"test_parselogs": {"ignore_errors":["string to ignore", "second string to ignore"]}}
+ errorlist = get_data(self, key = "ignore_errors")
+ except Exception as e:
+ self.logger.debug("%s: Exception e = %s" % (__file__, e))
+ try:
+ errorlist = ignore_errors[self.getMachine()]
+ except KeyError:
+ warning_string = 'No ignore list found for this machine and no valid testimage_data.json, using defaults'
+ self.msg += '%s\n' % (warning_string)
+ self.logger.warn("%s" % (warning_string))
+ errorlist = ignore_errors['default']
for ignore_error in errorlist:
ignore_error = ignore_error.replace('(', r'\(')
--
2.34.1
next prev parent reply other threads:[~2022-11-17 7:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-17 7:12 [PATCH 0/2] image specific configuration with oeqa runtime tests Mikko Rapeli
2022-11-17 7:12 ` [PATCH 1/2] oeqa: add utils/data.py with get_data() function Mikko Rapeli
2022-11-17 7:12 ` Mikko Rapeli [this message]
2022-11-17 14:22 ` [OE-core] [PATCH 0/2] image specific configuration with oeqa runtime tests Alexandre Belloni
2022-11-17 14:28 ` Mikko Rapeli
2022-11-17 15:17 ` Richard Purdie
2022-11-17 15:39 ` Mikko Rapeli
2022-11-17 16:57 ` Richard Purdie
2022-11-18 14:32 ` Mikko Rapeli
2022-11-18 15:04 ` Richard Purdie
2022-11-18 15:57 ` Mikko Rapeli
2022-11-18 16:04 ` Richard Purdie
2022-11-18 16:09 ` Mikko Rapeli
2022-11-18 16:11 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221117071223.107064-3-mikko.rapeli@linaro.org \
--to=mikko.rapeli@linaro.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox