All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: <cip-dev@lists.cip-project.org>
Cc: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
Subject: [isar-cip-core][PATCH v3 2/6] Add dmesg filter needed for lava test result
Date: Thu, 27 Jan 2022 18:12:39 +0100	[thread overview]
Message-ID: <ba98e2dc304e8bb7d8abe1510c6e04bcc4ae3962.1643303563.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1643303563.git.jan.kiszka@siemens.com>

From: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>

KernelCI is using a dmesg filter script for checking dmesg
logs result with lava.
Adding the script to the cip-core-image-kernelci.

Signed-off-by: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
[Jan: restore actual installation]
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../kernelci-customizations/files/dmesg.sh    | 23 +++++++++++++++++++
 .../kernelci-customizations.bb                |  4 ++++
 2 files changed, 27 insertions(+)
 create mode 100644 recipes-core/kernelci-customizations/files/dmesg.sh

diff --git a/recipes-core/kernelci-customizations/files/dmesg.sh b/recipes-core/kernelci-customizations/files/dmesg.sh
new file mode 100644
index 0000000..3b096e1
--- /dev/null
+++ b/recipes-core/kernelci-customizations/files/dmesg.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -e
+
+if [ "$KERNELCI_LAVA" = "y" ]; then
+    alias test-result='lava-test-case'
+else
+    alias test-result='echo'
+fi
+
+for level in crit alert emerg; do
+    dmesg --level=$level --notime -x -k > dmesg.$level
+    test -s dmesg.$level && res=fail || res=pass
+    count=$(cat dmesg.$level | wc -l)
+    cat dmesg.$level
+    test-result \
+        $level \
+        --result $res \
+        --measurement $count \
+        --units lines
+done
+
+exit 0
diff --git a/recipes-core/kernelci-customizations/kernelci-customizations.bb b/recipes-core/kernelci-customizations/kernelci-customizations.bb
index dca0891..df4257c 100644
--- a/recipes-core/kernelci-customizations/kernelci-customizations.bb
+++ b/recipes-core/kernelci-customizations/kernelci-customizations.bb
@@ -18,6 +18,7 @@ DESCRIPTION = "CIP Core image demo & customizations"
 SRC_URI = " \
     file://postinst \
     file://ethernet \
+    file://dmesg.sh \
     file://99-silent-printk.conf"
 
 DEPENDS += "sshd-regen-keys"
@@ -31,4 +32,7 @@ do_install() {
 
   install -v -d ${D}/etc/sysctl.d
   install -v -m 644 ${WORKDIR}/99-silent-printk.conf ${D}/etc/sysctl.d/
+
+  install -v -d ${D}/opt/kernelci
+  install -v -m 744 ${WORKDIR}/dmesg.sh ${D}/opt/kernelci/
 }
-- 
2.31.1



  parent reply	other threads:[~2022-01-27 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 17:12 [isar-cip-core][PATCH v3 0/6] Add cip-core-image-kernelci building and uploading system Jan Kiszka
2022-01-27 17:12 ` [isar-cip-core][PATCH v3 1/6] Add cip-core-image-kernelci Jan Kiszka
2022-01-27 17:12 ` Jan Kiszka [this message]
2022-01-27 17:12 ` [isar-cip-core][PATCH v3 3/6] Add script deploy-kernelci.py for upload the cip-core-image-kernelci Jan Kiszka
2022-09-01 10:54   ` Jan Kiszka
2022-09-02 15:27     ` Alice Ferrazzi
     [not found]     ` <1711151143769181.21591@lists.cip-project.org>
2022-09-03  7:59       ` [cip-dev] " Alice Ferrazzi
2022-01-27 17:12 ` [isar-cip-core][PATCH v3 4/6] enable cip-core-image-kernelci Jan Kiszka
2022-01-27 17:12 ` [isar-cip-core][PATCH v3 5/6] customizations: Factor out a common.inc Jan Kiszka
2022-01-27 17:12 ` [isar-cip-core][PATCH v3 6/6] kernelci-customizations: Reuse common customizations Jan Kiszka

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=ba98e2dc304e8bb7d8abe1510c6e04bcc4ae3962.1643303563.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=alice.ferrazzi@miraclelinux.com \
    --cc=cip-dev@lists.cip-project.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 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.