]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
test/TEST-04-FULL-SYSTEMD: default to basic.target and output more debug
authorHarald Hoyer <harald@redhat.com>
Thu, 12 Jul 2012 06:59:43 +0000 (08:59 +0200)
committerHarald Hoyer <harald@redhat.com>
Thu, 12 Jul 2012 06:59:43 +0000 (08:59 +0200)
test/TEST-04-FULL-SYSTEMD/test-init.sh
test/TEST-04-FULL-SYSTEMD/test.sh

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