testsuite fixup
parent
ca36b9b8f8
commit
83691c413f
|
|
@ -1,2 +1,2 @@
|
|||
/dev/sda2 / btrfs defaults 0 0
|
||||
/dev/sdb2 /usr btrfs subvol=usr,ro 0 0
|
||||
LABEL=dracut / btrfs subvol=root 0 0
|
||||
LABEL=dracutusr /usr btrfs subvol=usr,ro 0 0
|
||||
|
|
|
|||
|
|
@ -15,16 +15,19 @@ ismounted() {
|
|||
|
||||
systemctl --failed --no-legend --no-pager > /failed
|
||||
|
||||
if ismounted /usr && [ -f /run/systemd/system/initrd-switch-root.service ] && [ ! -s /failed ]; then
|
||||
if ismounted /usr && [ ! -s /failed ]; then
|
||||
echo "dracut-root-block-success" >/dev/sdc
|
||||
fi
|
||||
|
||||
set -x
|
||||
cat /proc/mounts
|
||||
tree /run
|
||||
dmesg
|
||||
journalctl --full --no-pager -o short-monotonic
|
||||
|
||||
if [ -s /failed ]; then
|
||||
echo "**************************FAILED**************************"
|
||||
cat /failed
|
||||
set +x
|
||||
echo "**************************FAILED**************************"
|
||||
fi
|
||||
|
||||
ls -al /run/systemd/system
|
||||
|
||||
export TERM=linux
|
||||
export PS1='initramfs-test:\w\$ '
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ export KVERSION=${KVERSION-$(uname -r)}
|
|||
#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"
|
||||
DEBUGOUT="loglevel=0 systemd.log_level=debug"
|
||||
client_run() {
|
||||
local test_name="$1"; shift
|
||||
local client_opts="$*"
|
||||
|
|
@ -83,10 +83,10 @@ test_setup() {
|
|||
dracut_install grep
|
||||
inst_simple ./fstab /etc/fstab
|
||||
rpm -ql systemd | xargs -r $DRACUT_INSTALL ${initdir+-D "$initdir"} -o -a -l
|
||||
inst /lib/systemd/system/systemd-remount-fs.service
|
||||
inst /lib/systemd/systemd-remount-fs
|
||||
inst /lib/systemd/system/systemd-journal-flush.service
|
||||
inst /etc/sysconfig/init
|
||||
# activate kmsg import
|
||||
echo 'ImportKernel=yes' >> $initdir/etc/systemd/journald.conf
|
||||
|
||||
# make a journal directory
|
||||
mkdir -p $initdir/var/log/journal
|
||||
|
|
@ -262,8 +262,8 @@ EOF
|
|||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-a "debug watchdog systemd" \
|
||||
-o "network" \
|
||||
-a "debug systemd" \
|
||||
-o "dash network plymouth lvm mdraid resume crypt i18n caps dm terminfo usrmount" \
|
||||
-d "piix ide-gd_mod ata_piix btrfs sd_mod i6300esb ib700wdt" \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ test_setup() {
|
|||
inst "$basedir/modules.d/40network/dhclient-script.sh" "/sbin/dhclient-script"
|
||||
inst "$basedir/modules.d/40network/ifup.sh" "/sbin/ifup"
|
||||
dracut_install grep
|
||||
dracut_install /lib/systemd/systemd-shutdown
|
||||
dracut_install -o /lib/systemd/systemd-shutdown
|
||||
find_binary plymouth >/dev/null && dracut_install plymouth
|
||||
cp -a /etc/ld.so.conf* $initdir/etc
|
||||
sudo ldconfig -r "$initdir"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ client_run() {
|
|||
-hdc $TESTDIR/disk2.img.new \
|
||||
-hdd $TESTDIR/disk3.img.new \
|
||||
-net none -kernel /boot/vmlinuz-$KVERSION \
|
||||
-append "$* root=LABEL=root rw rd.retry=20 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \
|
||||
-append "$* root=LABEL=root rw rd.retry=10 rd.info console=ttyS0,115200n81 selinux=0 rd.debug $DEBUGFAIL " \
|
||||
-initrd $TESTDIR/initramfs.testing
|
||||
if ! grep -m 1 -q dracut-root-block-success $TESTDIR/root.ext2; then
|
||||
echo "CLIENT TEST END: $@ [FAIL]"
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ test_setup() {
|
|||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
)
|
||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||
-o "plymouth dmraid" \
|
||||
-o "dash plymouth dmraid" \
|
||||
-a "debug" \
|
||||
-d "af_packet piix ide-gd_mod ata_piix ext3 sd_mod" \
|
||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||
|
|
|
|||
|
|
@ -52,13 +52,15 @@ client_test() {
|
|||
echo "Unable to make client sda image" 1>&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
$testdir/run-qemu \
|
||||
-hda $TESTDIR/flag.img \
|
||||
-m 256M -nographic \
|
||||
-m 512M \
|
||||
-nographic \
|
||||
-net nic,macaddr=$mac,model=e1000 \
|
||||
-net socket,connect=127.0.0.1:12340 \
|
||||
-kernel /boot/vmlinuz-$KVERSION \
|
||||
-append "$cmdline $DEBUGFAIL rd.debug rd.auto rd.info rd.retry=10 ro quiet console=ttyS0,115200n81 selinux=0" \
|
||||
-append "$cmdline $DEBUGFAIL rd.auto rd.info rd.retry=10 ro console=ttyS0,115200n81 selinux=0 " \
|
||||
-initrd $TESTDIR/initramfs.testing
|
||||
|
||||
if [[ $? -ne 0 ]] || ! grep -m 1 -q nbd-OK $TESTDIR/flag.img; then
|
||||
|
|
@ -70,7 +72,7 @@ client_test() {
|
|||
nbdinfo=($(awk '{print $2, $3; exit}' $TESTDIR/flag.img))
|
||||
|
||||
if [[ "${nbdinfo[0]}" != "$fstype" ]]; then
|
||||
echo "CLIENT TEST END: $test_name [FAILED - WRONG FS TYPE]"
|
||||
echo "CLIENT TEST END: $test_name [FAILED - WRONG FS TYPE] \"${nbdinfo[0]}\" != \"$fstype\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
@ -84,7 +86,7 @@ client_test() {
|
|||
done
|
||||
|
||||
if [[ ! $found ]]; then
|
||||
echo "CLIENT TEST END: $test_name [FAILED - BAD FS OPTS]"
|
||||
echo "CLIENT TEST END: $test_name [FAILED - BAD FS OPTS] \"${nbdinfo[1]}\" != \"$fsopt\""
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
|
@ -101,78 +103,79 @@ test_run() {
|
|||
}
|
||||
|
||||
client_run() {
|
||||
|
||||
# The default is ext3,errors=continue so use that to determine
|
||||
# if our options were parsed and used
|
||||
client_test "NBD root=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000" || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2" ext2 || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port::fsopts" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000::errors=panic" \
|
||||
"root=nbd:192.168.50.1:2000::errors=panic rd.luks=0" \
|
||||
ext3 errors=panic || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000 rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2 rd.luks=0" ext2 || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic" \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
client_test "NBD Bridge root=nbd:IP:port:fstype:fsopts" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic bridge" \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic bridge rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
# There doesn't seem to be a good way to validate the NBD options, so
|
||||
# just check that we don't screw up the other options
|
||||
|
||||
client_test "NBD root=nbd:IP:port:::NBD opts" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:::bs=2048" || return 1
|
||||
"root=nbd:192.168.50.1:2000:::bs=2048 rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype::NBD opts" 52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2::bs=2048" ext2 || return 1
|
||||
"root=nbd:192.168.50.1:2000:ext2::bs=2048 rd.luks=0" ext2 || return 1
|
||||
|
||||
client_test "NBD root=nbd:IP:port:fstype:fsopts:NBD opts" \
|
||||
52:54:00:12:34:00 \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic:bs=2048" \
|
||||
"root=nbd:192.168.50.1:2000:ext2:errors=panic:bs=2048 rd.luks=0" \
|
||||
ext2 errors=panic || return 1
|
||||
|
||||
# DHCP root-path parsing
|
||||
|
||||
client_test "NBD root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
|
||||
"root=dhcp" || return 1
|
||||
"root=dhcp rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD Bridge root=dhcp DHCP root-path nbd:srv:port" 52:54:00:12:34:01 \
|
||||
"root=dhcp bridge" || return 1
|
||||
"root=dhcp bridge rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype" \
|
||||
52:54:00:12:34:02 "root=dhcp" ext2 || return 1
|
||||
52:54:00:12:34:02 "root=dhcp rd.luks=0" ext2 || return 1
|
||||
|
||||
client_test "NBD root=dhcp DHCP root-path nbd:srv:port::fsopts" \
|
||||
52:54:00:12:34:03 "root=dhcp" ext3 errors=panic || return 1
|
||||
52:54:00:12:34:03 "root=dhcp rd.luks=0" ext3 errors=panic || return 1
|
||||
|
||||
client_test "NBD root=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
|
||||
52:54:00:12:34:04 "root=dhcp" ext2 errors=panic || return 1
|
||||
52:54:00:12:34:04 "root=dhcp rd.luks=0" ext2 errors=panic || return 1
|
||||
|
||||
# netroot handling
|
||||
|
||||
client_test "NBD netroot=nbd:IP:port" 52:54:00:12:34:00 \
|
||||
"netroot=nbd:192.168.50.1:2000" || return 1
|
||||
"netroot=nbd:192.168.50.1:2000 rd.luks=0" || return 1
|
||||
|
||||
client_test "NBD netroot=dhcp DHCP root-path nbd:srv:port:fstype:fsopts" \
|
||||
52:54:00:12:34:04 "netroot=dhcp" ext2 errors=panic || return 1
|
||||
52:54:00:12:34:04 "netroot=dhcp rd.luks=0" ext2 errors=panic || return 1
|
||||
|
||||
# Encrypted root handling via LVM/LUKS over NBD
|
||||
|
||||
. $TESTDIR/luks.uuid
|
||||
|
||||
client_test "NBD root=/dev/dracut/root netroot=nbd:IP:port" \
|
||||
52:54:00:12:34:00 \
|
||||
"root=/dev/dracut/root netroot=nbd:192.168.50.1:2001" || return 1
|
||||
"root=/dev/dracut/root rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=nbd:192.168.50.1:2001" || return 1
|
||||
|
||||
# XXX This should be ext2,errors=panic but that doesn't currently
|
||||
# XXX work when you have a real root= line in addition to netroot=
|
||||
# XXX How we should work here needs clarification
|
||||
client_test "NBD root=/dev/dracut/root netroot=dhcp (w/ fstype and opts)" \
|
||||
52:54:00:12:34:05 \
|
||||
"root=/dev/dracut/root netroot=dhcp" || return 1
|
||||
"root=/dev/dracut/root rd.luks.uuid=$ID_FS_UUID rd.lv.vg=dracut netroot=dhcp" || return 1
|
||||
|
||||
if [[ -s server.pid ]]; then
|
||||
sudo kill -TERM $(cat $TESTDIR/server.pid)
|
||||
|
|
@ -331,6 +334,11 @@ test_setup() {
|
|||
inst_hook emergency 000 ./hard-off.sh
|
||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||
inst ./cryptroot-ask.sh /sbin/cryptroot-ask
|
||||
|
||||
# inst ./debug-shell.service /lib/systemd/system/debug-shell.service
|
||||
# mkdir -p "${initdir}/lib/systemd/system/sysinit.target.wants"
|
||||
# ln -fs ../debug-shell.service "${initdir}/lib/systemd/system/sysinit.target.wants/debug-shell.service"
|
||||
|
||||
. $TESTDIR/luks.uuid
|
||||
mkdir -p $initdir/etc
|
||||
echo "luks-$ID_FS_UUID /dev/nbd0 /etc/key" > $initdir/etc/crypttab
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ run_server() {
|
|||
-serial $SERIAL \
|
||||
-watchdog i6300esb -watchdog-action poweroff \
|
||||
-kernel /boot/vmlinuz-$KVERSION \
|
||||
-append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
|
||||
-append "loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
|
||||
-initrd $TESTDIR/initramfs.server \
|
||||
-pidfile $TESTDIR/server.pid -daemonize || return 1
|
||||
sudo chmod 644 $TESTDIR/server.pid || return 1
|
||||
|
|
@ -61,7 +61,7 @@ client_test() {
|
|||
-net nic,netdev=net2,macaddr=52:54:00:12:34:$mac3,model=e1000 \
|
||||
-watchdog i6300esb -watchdog-action poweroff \
|
||||
-kernel /boot/vmlinuz-$KVERSION \
|
||||
-append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro rd.systemd.log_level=debug console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \
|
||||
-append "$cmdline $DEBUGFAIL rd.retry=5 rd.info ro rd.systemd.log_level=debug console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \
|
||||
-initrd $TESTDIR/initramfs.testing
|
||||
|
||||
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
|
||||
|
|
|
|||
Loading…
Reference in New Issue