Skip to content
Snippets Groups Projects
Verified Commit 2697f7cc authored by Philip Hands's avatar Philip Hands
Browse files

add a podman test for syslogd

This is probably not a very good idea in general, because of the
introduction of a build dependency on podman, but it does make it easier
to track down #1039710
parent 02e0f90c
No related branches found
No related tags found
No related merge requests found
Pipeline #561570 failed
......@@ -7,6 +7,9 @@ Uploaders:
Christoph Biedl <debian.axhn@manchmal.in-ulm.de>,
Michael Tokarev <mjt@tls.msk.ru>,
Build-Depends: debhelper-compat (= 13),
podman <!nocheck>,
uidmap <!nocheck>,
slirp4netns <!nocheck>,
zip <!nocheck>
Standards-Version: 4.6.2
Vcs-Git: https://salsa.debian.org/installer-team/busybox.git
......
From: Philip Hands <phil@hands.com>
Date: Mon, 7 Aug 2023 16:16:26 +0200
Subject: add a podman test for syslogd
This is probably not a very good idea in general, because of the
introduction of a build dependency on podman, but it does make it easier
to track down #1039710
---
scripts/test-log-to-syslogd.sh | 28 ++++++++++++++++++++++++++++
testsuite/syslogd/syslogd-works | 5 +++++
2 files changed, 33 insertions(+)
create mode 100755 scripts/test-log-to-syslogd.sh
create mode 100755 testsuite/syslogd/syslogd-works
diff --git a/scripts/test-log-to-syslogd.sh b/scripts/test-log-to-syslogd.sh
new file mode 100755
index 0000000..976ca06
--- /dev/null
+++ b/scripts/test-log-to-syslogd.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# this can be run (in a tree where the build's just finished) with:
+#
+# podman run -v $PWD:/busybox docker.io/library/debian:latest /busybox/debian/test-log-to-syslogd.sh
+# or
+# ( cd b/deb/testsuite; SKIP_KNOWN_BUGS=y LANG=C.UTF-8 LC_ALL=C.UTF-8 SKIP_INTERNET_TESTS=y SHELL='/bin/sh -e' ECHO=/bin/echo ./runtest -v syslogd )
+
+TESTSTRING="Testing, Testing, 1 2 3"
+
+/busybox/b/deb/busybox syslogd
+# allow time for /dev/log to appear
+sleep 2
+
+if ! [ -e /dev/log ]; then
+ echo "ERROR -- /dev/log does not exist after starting syslogd"
+ exit 1
+fi
+
+/busybox/b/deb/busybox logger $TESTSTRING
+
+if grep -q "$TESTSTRING" /var/log/messages; then
+ echo "SUCCESS -- found test string in log file"
+else
+ echo "FAILURE -- test string was not found in log file:"
+ head -v /var/log/messages
+ exit 1
+fi
diff --git a/testsuite/syslogd/syslogd-works b/testsuite/syslogd/syslogd-works
new file mode 100755
index 0000000..f054462
--- /dev/null
+++ b/testsuite/syslogd/syslogd-works
@@ -0,0 +1,5 @@
+# check if something gets logged (uses podman, which is quite probably not a sane thing to do)
+
+TOPDIR=${PWD%/b/*}
+
+podman run -v $TOPDIR:/busybox docker.io/library/debian:latest /busybox/scripts/test-log-to-syslogd.sh
......@@ -17,3 +17,4 @@ fix-non-linux-build.patch
syslogd-decrease-stack-usage-50-bytes.patch
syslogd-daemonize-after-init-make-errs-visible.patch
syslogd-avoid-nulling-devlog.patch
0015-add-a-podman-test-for-syslogd.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment