* [make-initrd] [PATCH v6 13/22] bootchain-core: introduces new parameter bc_test
@ 2021-10-24 17:21 Leonid Krivoshein
0 siblings, 0 replies; only message in thread
From: Leonid Krivoshein @ 2021-10-24 17:21 UTC (permalink / raw)
To: make-initrd
Enabling the bc_test option allows the boot log to be saved to the stage2
even when extended debugging has not been enabled. It will be possible to
examine the contents of the boot log without additional debugging messages.
Signed-off-by: Leonid Krivoshein <klark.devel@gmail.com>
---
features/bootchain-core/README.md | 4 ++++
.../data/etc/initrd/cmdline.d/bootchain-core | 1 +
features/bootchain-core/data/sbin/chaind | 8 +++++++-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/features/bootchain-core/README.md b/features/bootchain-core/README.md
index cea2d84..14db55f 100644
--- a/features/bootchain-core/README.md
+++ b/features/bootchain-core/README.md
@@ -108,6 +108,10 @@ own needs.
- `overlayfs=list` - defines the list of elements to combine.
- `bc_debug` - a boolean parameter that enables advanced debugging and forces
if the daemon completes successfully, copy boot log to the stage2.
+- `bc_test=name` - defines the name of the current test case in the process of
+ fully automated self-testing, forcing in case of successful after completing
+ the daemon, copy the boot log to the stage2 and next to it create a
+ `BC-TEST.passed` file with the specified name of the test case.
## bootchain-sh-functions extended API
diff --git a/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core b/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
index 4151a8d..d397f86 100644
--- a/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
+++ b/features/bootchain-core/data/etc/initrd/cmdline.d/bootchain-core
@@ -1,5 +1,6 @@
register_parameter string BOOTCHAIN
register_alias BOOTCHAIN PIPELINE
+register_parameter string BC_TEST
register_parameter bool BC_DEBUG
register_array string MOUNTFS
register_array string OVERLAYFS
diff --git a/features/bootchain-core/data/sbin/chaind b/features/bootchain-core/data/sbin/chaind
index ec4458e..c1b2451 100755
--- a/features/bootchain-core/data/sbin/chaind
+++ b/features/bootchain-core/data/sbin/chaind
@@ -115,12 +115,18 @@ else
debug "last step finished with exit code $rc"
fi
-if [ -f "$BC_LOGFILE" ] && [ -n "$BC_DEBUG" ]; then
+if [ -f "$BC_LOGFILE" ] && [ -n "${BC_DEBUG}${BC_TEST-}" ]; then
if [ -d "$rootmnt/var/log" ]; then
destdir="$rootmnt/var/log"
else
run mkdir -p -- "$mntdir"
destdir="$mntdir"
fi
+
+ if [ -n "${BC_TEST-}" ]; then
+ debug "test '$BC_TEST' in the stage1 passed"
+ echo "$BC_TEST" >"$destdir"/BC-TEST.passed
+ fi
+
run cp -Lf -- "$BC_LOGFILE" "$destdir/"
fi
--
2.24.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-10-24 17:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-24 17:21 [make-initrd] [PATCH v6 13/22] bootchain-core: introduces new parameter bc_test Leonid Krivoshein
Make-initrd development discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/make-initrd/0 make-initrd/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 make-initrd make-initrd/ http://lore.altlinux.org/make-initrd \
make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com
public-inbox-index make-initrd
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.make-initrd
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git