|
Harald Hoyer |
a66b47 |
From 3d115217e4db6fc54c9cda87088f3fb212285158 Mon Sep 17 00:00:00 2001
|
|
Harald Hoyer |
a66b47 |
From: Harald Hoyer <harald@redhat.com>
|
|
Harald Hoyer |
a66b47 |
Date: Thu, 12 Jul 2012 08:59:43 +0200
|
|
Harald Hoyer |
a66b47 |
Subject: [PATCH] test/TEST-04-FULL-SYSTEMD: default to basic.target and
|
|
Harald Hoyer |
a66b47 |
output more debug
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
---
|
|
Harald Hoyer |
a66b47 |
test/TEST-04-FULL-SYSTEMD/test-init.sh | 13 ++++++++++++-
|
|
Harald Hoyer |
a66b47 |
test/TEST-04-FULL-SYSTEMD/test.sh | 19 ++++++++++++-------
|
|
Harald Hoyer |
a66b47 |
2 files changed, 24 insertions(+), 8 deletions(-)
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
diff --git a/test/TEST-04-FULL-SYSTEMD/test-init.sh b/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
|
Harald Hoyer |
a66b47 |
index cc26017..d41f0b0 100755
|
|
Harald Hoyer |
a66b47 |
--- a/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
|
Harald Hoyer |
a66b47 |
+++ b/test/TEST-04-FULL-SYSTEMD/test-init.sh
|
|
Harald Hoyer |
a66b47 |
@@ -13,9 +13,19 @@ ismounted() {
|
|
Harald Hoyer |
a66b47 |
return 1
|
|
Harald Hoyer |
a66b47 |
}
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
-if ismounted /usr; then
|
|
Harald Hoyer |
a66b47 |
+systemctl --failed --no-legend --no-pager > /failed
|
|
Harald Hoyer |
a66b47 |
+
|
|
Harald Hoyer |
a66b47 |
+if ismounted /usr && [ -f /run/systemd/system/initrd-switch-root.service ] && [ ! -s /failed ]; then
|
|
Harald Hoyer |
a66b47 |
echo "dracut-root-block-success" >/dev/sdc
|
|
Harald Hoyer |
a66b47 |
fi
|
|
Harald Hoyer |
a66b47 |
+
|
|
Harald Hoyer |
a66b47 |
+set -x
|
|
Harald Hoyer |
a66b47 |
+ cat /proc/mounts
|
|
Harald Hoyer |
a66b47 |
+ tree /run
|
|
Harald Hoyer |
a66b47 |
+ dmesg
|
|
Harald Hoyer |
a66b47 |
+ cat /failed
|
|
Harald Hoyer |
a66b47 |
+set +x
|
|
Harald Hoyer |
a66b47 |
+
|
|
Harald Hoyer |
a66b47 |
export TERM=linux
|
|
Harald Hoyer |
a66b47 |
export PS1='initramfs-test:\w\$ '
|
|
Harald Hoyer |
a66b47 |
[ -f /etc/mtab ] || ln -sfn /proc/mounts /etc/mtab
|
|
Harald Hoyer |
a66b47 |
@@ -23,6 +33,7 @@ export PS1='initramfs-test:\w\$ '
|
|
Harald Hoyer |
a66b47 |
stty sane
|
|
Harald Hoyer |
a66b47 |
echo "made it to the rootfs!"
|
|
Harald Hoyer |
a66b47 |
if strstr "$CMDLINE" "rd.shell"; then
|
|
Harald Hoyer |
a66b47 |
+# while sleep 1; do sleep 1;done
|
|
Harald Hoyer |
a66b47 |
strstr "$(setsid --help)" "control" && CTTY="-c"
|
|
Harald Hoyer |
a66b47 |
setsid $CTTY sh -i
|
|
Harald Hoyer |
a66b47 |
fi
|
|
Harald Hoyer |
a66b47 |
diff --git a/test/TEST-04-FULL-SYSTEMD/test.sh b/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
Harald Hoyer |
a66b47 |
index 921189f..9a679a7 100755
|
|
Harald Hoyer |
a66b47 |
--- a/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
Harald Hoyer |
a66b47 |
+++ b/test/TEST-04-FULL-SYSTEMD/test.sh
|
|
Harald Hoyer |
a66b47 |
@@ -6,7 +6,9 @@ KVERSION=${KVERSION-$(uname -r)}
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
# Uncomment this to debug failures
|
|
Harald Hoyer |
a66b47 |
#DEBUGFAIL="rd.shell rd.break"
|
|
Harald Hoyer |
a66b47 |
-
|
|
Harald Hoyer |
a66b47 |
+#DEBUGFAIL="rd.shell"
|
|
Harald Hoyer |
a66b47 |
+#DEBUGOUT="quiet systemd.log_level=debug systemd.log_target=console loglevel=77 rd.info rd.debug"
|
|
Harald Hoyer |
a66b47 |
+DEBUGOUT="loglevel=0 systemd.log_level=debug systemd.log_target=kmsg"
|
|
Harald Hoyer |
a66b47 |
client_run() {
|
|
Harald Hoyer |
a66b47 |
local test_name="$1"; shift
|
|
Harald Hoyer |
a66b47 |
local client_opts="$*"
|
|
Harald Hoyer |
a66b47 |
@@ -20,7 +22,7 @@ client_run() {
|
|
Harald Hoyer |
a66b47 |
-hdc $TESTDIR/result \
|
|
Harald Hoyer |
a66b47 |
-m 256M -nographic \
|
|
Harald Hoyer |
a66b47 |
-net none -kernel /boot/vmlinuz-$KVERSION \
|
|
Harald Hoyer |
a66b47 |
- -append "root=LABEL=dracut $client_opts quiet systemd.log_level=debug systemd.log_target=console loglevel=77 rd.retry=3 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL" \
|
|
Harald Hoyer |
a66b47 |
+ -append "root=LABEL=dracut $client_opts rd.retry=3 console=ttyS0,115200n81 selinux=0 $DEBUGOUT $DEBUGFAIL" \
|
|
Harald Hoyer |
a66b47 |
-initrd $TESTDIR/initramfs.testing
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
if (($? != 0)); then
|
|
Harald Hoyer |
a66b47 |
@@ -57,7 +59,7 @@ test_setup() {
|
|
Harald Hoyer |
a66b47 |
mkdir -p $initdir
|
|
Harald Hoyer |
a66b47 |
. $basedir/dracut-functions.sh
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
- for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run run/lock run/initramfs; do
|
|
Harald Hoyer |
a66b47 |
+ for d in usr/bin usr/sbin bin etc lib "$libdir" sbin tmp usr var var/log dev proc sys sysroot root run; do
|
|
Harald Hoyer |
a66b47 |
if [ -L "/$d" ]; then
|
|
Harald Hoyer |
a66b47 |
inst_symlink "/$d"
|
|
Harald Hoyer |
a66b47 |
else
|
|
Harald Hoyer |
a66b47 |
@@ -70,7 +72,8 @@ test_setup() {
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip route \
|
|
Harald Hoyer |
a66b47 |
mount dmesg ifconfig dhclient mkdir cp ping dhclient \
|
|
Harald Hoyer |
a66b47 |
- umount strace less setsid
|
|
Harald Hoyer |
a66b47 |
+ umount strace less setsid tree systemctl
|
|
Harald Hoyer |
a66b47 |
+
|
|
Harald Hoyer |
a66b47 |
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
|
Harald Hoyer |
a66b47 |
[ -f ${_terminfodir}/l/linux ] && break
|
|
Harald Hoyer |
a66b47 |
done
|
|
Harald Hoyer |
a66b47 |
@@ -112,8 +115,8 @@ test_setup() {
|
|
Harald Hoyer |
a66b47 |
cat >$initdir/etc/systemd/system/testsuite.target <
|
|
Harald Hoyer |
a66b47 |
[Unit]
|
|
Harald Hoyer |
a66b47 |
Description=Testsuite target
|
|
Harald Hoyer |
a66b47 |
-Requires=multi-user.target
|
|
Harald Hoyer |
a66b47 |
-After=multi-user.target
|
|
Harald Hoyer |
a66b47 |
+Requires=basic.target
|
|
Harald Hoyer |
a66b47 |
+After=basic.target
|
|
Harald Hoyer |
a66b47 |
Conflicts=rescue.target
|
|
Harald Hoyer |
a66b47 |
AllowIsolate=yes
|
|
Harald Hoyer |
a66b47 |
EOF
|
|
Harald Hoyer |
a66b47 |
@@ -124,12 +127,14 @@ EOF
|
|
Harald Hoyer |
a66b47 |
cat >$initdir/etc/systemd/system/testsuite.service <
|
|
Harald Hoyer |
a66b47 |
[Unit]
|
|
Harald Hoyer |
a66b47 |
Description=Testsuite service
|
|
Harald Hoyer |
a66b47 |
-After=multi-user.target
|
|
Harald Hoyer |
a66b47 |
+After=basic.target
|
|
Harald Hoyer |
a66b47 |
|
|
Harald Hoyer |
a66b47 |
[Service]
|
|
Harald Hoyer |
a66b47 |
ExecStart=/sbin/test-init
|
|
Harald Hoyer |
a66b47 |
ExecStopPost=/usr/bin/systemctl poweroff
|
|
Harald Hoyer |
a66b47 |
Type=oneshot
|
|
Harald Hoyer |
a66b47 |
+StandardInput=tty
|
|
Harald Hoyer |
a66b47 |
+StandardOutput=tty
|
|
Harald Hoyer |
a66b47 |
EOF
|
|
Harald Hoyer |
a66b47 |
mkdir -p $initdir/etc/systemd/system/testsuite.target.wants
|
|
Harald Hoyer |
a66b47 |
ln -fs ../testsuite.service $initdir/etc/systemd/system/testsuite.target.wants/testsuite.service
|