test.sh revision 32d965851d8cbb39f8ee0eeaf76a89e8f5fc174f
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
TEST_DESCRIPTION="Basic systemd setup"
# Uncomment this to debug failures
#DEBUGFAIL="systemd.unit=multi-user.target"
-m 256M -nographic \
-append "root=/dev/sda1 systemd.log_level=debug raid=noautodetect loglevel=2 init=/usr/lib/systemd/systemd rw console=ttyS0,115200n81 selinux=0 $DEBUGFAIL"
ret=1
return $ret
}
# Create the blank file to use as a root filesystem
LOOPDEV=$(losetup --show -P -f $TESTDIR/rootdisk.img)
[ -b $LOOPDEV ] || return 1
,
EOF
# Create what will eventually be our root filesystem onto an overlay
(
# create the basic filesystem layout
# install compiled files
# install possible missing libraries
inst_libs $i
done
# activate kmsg import
# make a journal directory
# install some basic config files
# we want an empty environment
# set the hostname
# setup the testsuite target
[Unit]
Description=Testsuite target
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes
EOF
# setup the testsuite service
[Unit]
Description=Testsuite service
After=multi-user.target
[Service]
ExecStart=/bin/sh -c 'systemctl --failed --no-legend --no-pager > /failed ; echo OK > /testok'
ExecStartPost=/usr/sbin/poweroff
Type=oneshot
EOF
# make the testsuite the default target
# install basic tools needed
# install libnss_files for login
inst_libdir_file "libnss_files*"
# install dbus and pam
find \
| while read file; do
done
# install dbus socket and service file
# install basic keyboard maps and fonts
for i in \
[[ -f $i ]] || continue
inst $i
done
# some basic terminfo files
[ -f ${_terminfodir}/l/linux ] && break
done
dracut_install -o ${_terminfodir}/l/linux
# softlink mtab
# install any Exec's from the service files
| while read i; do
i=${i##Exec*=}; i=${i##-}
inst $i
done
# install plymouth, if found... else remove plymouth service files
if [ -x /usr/libexec/plymouth/plymouth-populate-initrd ]; then
else
fi
# some helper tools for debugging
# install ld.so.conf* and run ldconfig
cp -a /etc/ld.so.conf* $initdir/etc
)
}
return 0
}
. $TEST_BASE_DIR/test-functions
do_test "$@"