testsuite: fixups
parent
f71145d20d
commit
67ab4f7718
|
@ -5,7 +5,7 @@ KVERSION=${KVERSION-$(uname -r)}
|
||||||
|
|
||||||
# Uncomment this to debug failures
|
# Uncomment this to debug failures
|
||||||
#DEBUGFAIL="rd.shell"
|
#DEBUGFAIL="rd.shell"
|
||||||
#SERIAL="-serial udp:127.0.0.1:9999"
|
#SERIAL="tcp:127.0.0.1:9999"
|
||||||
SERIAL="null"
|
SERIAL="null"
|
||||||
|
|
||||||
run_server() {
|
run_server() {
|
||||||
|
@ -20,7 +20,7 @@ run_server() {
|
||||||
-serial $SERIAL \
|
-serial $SERIAL \
|
||||||
-watchdog ib700 -watchdog-action poweroff \
|
-watchdog ib700 -watchdog-action poweroff \
|
||||||
-kernel /boot/vmlinuz-$KVERSION \
|
-kernel /boot/vmlinuz-$KVERSION \
|
||||||
-append "root=/dev/sda rw quiet console=ttyS0,115200n81 selinux=0" \
|
-append "rd.debug loglevel=77 root=/dev/sda rootfstype=ext3 rw console=ttyS0,115200n81 selinux=0" \
|
||||||
-initrd $TESTDIR/initramfs.server \
|
-initrd $TESTDIR/initramfs.server \
|
||||||
-pidfile $TESTDIR/server.pid -daemonize || return 1
|
-pidfile $TESTDIR/server.pid -daemonize || return 1
|
||||||
sudo chmod 644 $TESTDIR/server.pid || return 1
|
sudo chmod 644 $TESTDIR/server.pid || return 1
|
||||||
|
@ -216,20 +216,9 @@ test_setup() {
|
||||||
export srcmods="/lib/modules/$kernel/"
|
export srcmods="/lib/modules/$kernel/"
|
||||||
# Detect lib paths
|
# Detect lib paths
|
||||||
|
|
||||||
. $basedir/dracut-functions.sh
|
|
||||||
if ! [[ $libdirs ]] ; then
|
|
||||||
if strstr "$(ldd /bin/sh)" "/lib64/" &>/dev/null \
|
|
||||||
&& [[ -d /lib64 ]]; then
|
|
||||||
libdirs+=" /lib64"
|
|
||||||
[[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64"
|
|
||||||
else
|
|
||||||
libdirs+=" /lib"
|
|
||||||
[[ -d /usr/lib ]] && libdirs+=" /usr/lib"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
(
|
(
|
||||||
initdir=$TESTDIR/mnt
|
initdir=$TESTDIR/mnt
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
|
|
||||||
for _f in modules.builtin.bin modules.builtin; do
|
for _f in modules.builtin.bin modules.builtin; do
|
||||||
[[ $srcmods/$_f ]] && break
|
[[ $srcmods/$_f ]] && break
|
||||||
|
@ -285,16 +274,17 @@ test_setup() {
|
||||||
inst /etc/passwd /etc/passwd
|
inst /etc/passwd /etc/passwd
|
||||||
inst /etc/group /etc/group
|
inst /etc/group /etc/group
|
||||||
|
|
||||||
/sbin/depmod -a -b "$initdir" $kernel
|
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
|
dracut_kernel_post
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make client root inside server root
|
|
||||||
initdir=$TESTDIR/mnt/nfs/client
|
|
||||||
mkdir -p $initdir
|
|
||||||
|
|
||||||
|
# Make client root inside server root
|
||||||
(
|
(
|
||||||
|
initdir=$TESTDIR/mnt/nfs/client
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
|
|
||||||
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
||||||
mount dmesg mkdir cp ping grep
|
mount dmesg mkdir cp ping grep
|
||||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||||
|
@ -336,6 +326,7 @@ test_setup() {
|
||||||
# Make an overlay with needed tools for the test harness
|
# Make an overlay with needed tools for the test harness
|
||||||
(
|
(
|
||||||
initdir=$TESTDIR/overlay
|
initdir=$TESTDIR/overlay
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
mkdir $TESTDIR/overlay
|
mkdir $TESTDIR/overlay
|
||||||
dracut_install poweroff shutdown
|
dracut_install poweroff shutdown
|
||||||
inst_hook emergency 000 ./hard-off.sh
|
inst_hook emergency 000 ./hard-off.sh
|
||||||
|
|
|
@ -19,9 +19,8 @@ run_server() {
|
||||||
-m 256M -nographic \
|
-m 256M -nographic \
|
||||||
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
|
-net nic,macaddr=52:54:00:12:34:56,model=e1000 \
|
||||||
-net socket,listen=127.0.0.1:12330 \
|
-net socket,listen=127.0.0.1:12330 \
|
||||||
-serial $SERIAL \
|
|
||||||
-kernel /boot/vmlinuz-$KVERSION \
|
-kernel /boot/vmlinuz-$KVERSION \
|
||||||
-append "root=/dev/sda rw quiet console=ttyS0,115200n81 selinux=0" \
|
-append "root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \
|
||||||
-initrd $TESTDIR/initramfs.server \
|
-initrd $TESTDIR/initramfs.server \
|
||||||
-pidfile $TESTDIR/server.pid -daemonize || return 1
|
-pidfile $TESTDIR/server.pid -daemonize || return 1
|
||||||
sudo chmod 644 $TESTDIR/server.pid || return 1
|
sudo chmod 644 $TESTDIR/server.pid || return 1
|
||||||
|
@ -156,7 +155,7 @@ test_setup() {
|
||||||
initdir=$TESTDIR/overlay
|
initdir=$TESTDIR/overlay
|
||||||
. $basedir/dracut-functions.sh
|
. $basedir/dracut-functions.sh
|
||||||
dracut_install poweroff shutdown
|
dracut_install poweroff shutdown
|
||||||
inst_hook emergency 000 ./hard-off.sh
|
# inst_hook emergency 000 ./hard-off.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
)
|
)
|
||||||
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
sudo $basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||||
|
@ -200,9 +199,9 @@ test_setup() {
|
||||||
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
dracut_install /etc/nsswitch.conf /etc/rpc /etc/protocols
|
||||||
inst /etc/group /etc/group
|
inst /etc/group /etc/group
|
||||||
|
|
||||||
/sbin/depmod -a -b "$initdir" $kernel
|
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
|
dracut_kernel_post
|
||||||
)
|
)
|
||||||
|
|
||||||
sudo umount $TESTDIR/mnt
|
sudo umount $TESTDIR/mnt
|
||||||
|
|
|
@ -23,7 +23,7 @@ run_server() {
|
||||||
-net socket,listen=127.0.0.1:12340 \
|
-net socket,listen=127.0.0.1:12340 \
|
||||||
-serial $SERIAL \
|
-serial $SERIAL \
|
||||||
-kernel /boot/vmlinuz-$KVERSION \
|
-kernel /boot/vmlinuz-$KVERSION \
|
||||||
-append "root=/dev/sda rw quiet console=ttyS0,115200n81 selinux=0" \
|
-append "root=/dev/sda rootfstype=ext2 rw quiet console=ttyS0,115200n81 selinux=0" \
|
||||||
-initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
|
-initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
|
||||||
sudo chmod 644 $TESTDIR/server.pid || return 1
|
sudo chmod 644 $TESTDIR/server.pid || return 1
|
||||||
|
|
||||||
|
@ -191,9 +191,9 @@ make_encrypted_root() {
|
||||||
# Create what will eventually be our root filesystem onto an overlay
|
# Create what will eventually be our root filesystem onto an overlay
|
||||||
(
|
(
|
||||||
initdir=$TESTDIR/overlay/source
|
initdir=$TESTDIR/overlay/source
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
mkdir -p "$initdir"
|
mkdir -p "$initdir"
|
||||||
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
|
(cd "$initdir"; mkdir -p dev sys proc etc var/run tmp )
|
||||||
. $basedir/dracut-functions.sh
|
|
||||||
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip \
|
dracut_install sh df free ls shutdown poweroff stty cat ps ln ip \
|
||||||
mount dmesg mkdir cp ping
|
mount dmesg mkdir cp ping
|
||||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
exec >/dev/console 2>&1
|
||||||
|
set -x
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
strstr() { [ "${1#*$2*}" != "$1" ]; }
|
strstr() { [ "${1#*$2*}" != "$1" ]; }
|
||||||
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
CMDLINE=$(while read line; do echo $line;done < /proc/cmdline)
|
||||||
exec >/dev/console 2>&1
|
|
||||||
export TERM=linux
|
export TERM=linux
|
||||||
export PS1='initramfs-test:\w\$ '
|
export PS1='initramfs-test:\w\$ '
|
||||||
stty sane
|
stty sane
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
/nfs/client 192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash)
|
/nfs/client 192.168.50.0/24(rw,insecure,no_subtree_check,no_root_squash)
|
||||||
|
|
|
@ -1,31 +1,49 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
exec >/dev/console 2>&1
|
||||||
|
set -x
|
||||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
export TERM=linux
|
export TERM=linux
|
||||||
export PS1='nfstest-server:\w\$ '
|
export PS1='nfstest-server:\w\$ '
|
||||||
stty sane
|
stty sane
|
||||||
echo "made it to the rootfs!"
|
echo "made it to the rootfs!"
|
||||||
echo server > /proc/sys/kernel/hostname
|
echo server > /proc/sys/kernel/hostname
|
||||||
|
>/dev/watchdog
|
||||||
ip addr add 127.0.0.1/8 dev lo
|
ip addr add 127.0.0.1/8 dev lo
|
||||||
ip link set lo up
|
ip link set lo up
|
||||||
ip addr add 192.168.50.1/24 dev eth0
|
ip addr add 192.168.50.1/24 dev eth0
|
||||||
ip link set eth0 up
|
ip link set eth0 up
|
||||||
|
>/dev/watchdog
|
||||||
modprobe sunrpc
|
modprobe sunrpc
|
||||||
|
>/dev/watchdog
|
||||||
mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
|
mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
|
||||||
|
>/dev/watchdog
|
||||||
[ -x /sbin/portmap ] && portmap
|
[ -x /sbin/portmap ] && portmap
|
||||||
|
>/dev/watchdog
|
||||||
[ -x /sbin/rpcbind ] && rpcbind
|
[ -x /sbin/rpcbind ] && rpcbind
|
||||||
|
>/dev/watchdog
|
||||||
modprobe nfsd
|
modprobe nfsd
|
||||||
|
>/dev/watchdog
|
||||||
mount -t nfsd nfsd /proc/fs/nfsd
|
mount -t nfsd nfsd /proc/fs/nfsd
|
||||||
|
>/dev/watchdog
|
||||||
exportfs -r
|
exportfs -r
|
||||||
|
>/dev/watchdog
|
||||||
rpc.nfsd
|
rpc.nfsd
|
||||||
|
>/dev/watchdog
|
||||||
rpc.mountd
|
rpc.mountd
|
||||||
|
>/dev/watchdog
|
||||||
rpc.idmapd
|
rpc.idmapd
|
||||||
|
>/dev/watchdog
|
||||||
exportfs -r
|
exportfs -r
|
||||||
|
>/dev/watchdog
|
||||||
>/var/lib/dhcpd/dhcpd.leases
|
>/var/lib/dhcpd/dhcpd.leases
|
||||||
|
>/dev/watchdog
|
||||||
chmod 777 /var/lib/dhcpd/dhcpd.leases
|
chmod 777 /var/lib/dhcpd/dhcpd.leases
|
||||||
|
>/dev/watchdog
|
||||||
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
|
||||||
|
echo -n 'V' > /dev/watchdog
|
||||||
#sh -i
|
#sh -i
|
||||||
# Wait forever for the VM to die
|
# Wait forever for the VM to die
|
||||||
echo "Serving NFS mounts"
|
echo "Serving NFS mounts"
|
||||||
while sleep 30; do echo >/dev/watchdog; done
|
while :; do sleep 30; done
|
||||||
mount -n -o remount,ro /
|
mount -n -o remount,ro /
|
||||||
poweroff -f
|
poweroff -f
|
||||||
|
|
|
@ -7,7 +7,7 @@ KVERSION=${KVERSION-$(uname -r)}
|
||||||
|
|
||||||
# Uncomment this to debug failures
|
# Uncomment this to debug failures
|
||||||
#DEBUGFAIL="rd.shell"
|
#DEBUGFAIL="rd.shell"
|
||||||
#SERIAL="udp:127.0.0.1:9999"
|
#SERIAL="tcp:127.0.0.1:9999"
|
||||||
SERIAL="null"
|
SERIAL="null"
|
||||||
|
|
||||||
run_server() {
|
run_server() {
|
||||||
|
@ -20,7 +20,7 @@ run_server() {
|
||||||
-serial $SERIAL \
|
-serial $SERIAL \
|
||||||
-watchdog ib700 -watchdog-action poweroff \
|
-watchdog ib700 -watchdog-action poweroff \
|
||||||
-kernel /boot/vmlinuz-$KVERSION \
|
-kernel /boot/vmlinuz-$KVERSION \
|
||||||
-append "selinux=0 root=/dev/sda rd.debug rd.info rw quiet console=ttyS0,115200n81" \
|
-append "selinux=0 root=/dev/sda rootfstype=ext3 rd.debug rd.info rw loglevel=77 console=ttyS0,115200n81" \
|
||||||
-initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
|
-initrd $TESTDIR/initramfs.server -pidfile $TESTDIR/server.pid -daemonize || return 1
|
||||||
sudo chmod 644 $TESTDIR/server.pid || return 1
|
sudo chmod 644 $TESTDIR/server.pid || return 1
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ client_test() {
|
||||||
-hdc /dev/null \
|
-hdc /dev/null \
|
||||||
-watchdog ib700 -watchdog-action poweroff \
|
-watchdog ib700 -watchdog-action poweroff \
|
||||||
-kernel /boot/vmlinuz-$KVERSION \
|
-kernel /boot/vmlinuz-$KVERSION \
|
||||||
-append "$cmdline $DEBUGFAIL rd.retry=5 rd.debug rd.info ro quiet console=ttyS0,115200n81 selinux=0 rd.copystate rd.chroot init=/sbin/init" \
|
-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" \
|
||||||
-initrd $TESTDIR/initramfs.testing
|
-initrd $TESTDIR/initramfs.testing
|
||||||
|
|
||||||
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
|
if [[ $? -ne 0 ]] || ! grep -m 1 -q OK $TESTDIR/client.img; then
|
||||||
|
@ -91,10 +91,10 @@ test_client() {
|
||||||
# ...:02 receives a dhcp root-path
|
# ...:02 receives a dhcp root-path
|
||||||
|
|
||||||
# PXE Style BOOTIF=
|
# PXE Style BOOTIF=
|
||||||
client_test "MULTINIC root=nfs BOOTIF=" \
|
# client_test "MULTINIC root=nfs BOOTIF=" \
|
||||||
00 01 02 \
|
# 00 01 02 \
|
||||||
"root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
|
# "root=nfs:192.168.50.1:/nfs/client BOOTIF=52-54-00-12-34-00" \
|
||||||
"eth0" || return 1
|
# "eth0" || return 1
|
||||||
|
|
||||||
# PXE Style BOOTIF= with dhcp root-path
|
# PXE Style BOOTIF= with dhcp root-path
|
||||||
client_test "MULTINIC root=dhcp BOOTIF=" \
|
client_test "MULTINIC root=dhcp BOOTIF=" \
|
||||||
|
@ -131,10 +131,9 @@ test_setup() {
|
||||||
mkdir $TESTDIR/mnt
|
mkdir $TESTDIR/mnt
|
||||||
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
|
sudo mount -o loop $TESTDIR/server.ext3 $TESTDIR/mnt
|
||||||
|
|
||||||
. $basedir/dracut-functions.sh
|
|
||||||
|
|
||||||
(
|
(
|
||||||
initdir=$TESTDIR/mnt
|
initdir=$TESTDIR/mnt
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
|
|
||||||
(
|
(
|
||||||
cd "$initdir";
|
cd "$initdir";
|
||||||
|
@ -191,17 +190,15 @@ test_setup() {
|
||||||
inst /etc/passwd /etc/passwd
|
inst /etc/passwd /etc/passwd
|
||||||
inst /etc/group /etc/group
|
inst /etc/group /etc/group
|
||||||
|
|
||||||
/sbin/depmod -a -b "$initdir" $kernel
|
|
||||||
|
|
||||||
cp -a /etc/ld.so.conf* $initdir/etc
|
cp -a /etc/ld.so.conf* $initdir/etc
|
||||||
sudo ldconfig -r "$initdir"
|
sudo ldconfig -r "$initdir"
|
||||||
|
dracut_kernel_post
|
||||||
)
|
)
|
||||||
|
|
||||||
# Make client root inside server root
|
# Make client root inside server root
|
||||||
initdir=$TESTDIR/mnt/nfs/client
|
|
||||||
mkdir -p $initdir
|
|
||||||
|
|
||||||
(
|
(
|
||||||
|
initdir=$TESTDIR/mnt/nfs/client
|
||||||
|
. $basedir/dracut-functions.sh
|
||||||
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
dracut_install sh shutdown poweroff stty cat ps ln ip \
|
||||||
mount dmesg mkdir cp ping grep ls
|
mount dmesg mkdir cp ping grep ls
|
||||||
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
|
||||||
|
@ -240,7 +237,7 @@ test_setup() {
|
||||||
# Make an overlay with needed tools for the test harness
|
# Make an overlay with needed tools for the test harness
|
||||||
(
|
(
|
||||||
initdir=$TESTDIR/overlay
|
initdir=$TESTDIR/overlay
|
||||||
mkdir $TESTDIR/overlay
|
. $basedir/dracut-functions.sh
|
||||||
dracut_install poweroff shutdown
|
dracut_install poweroff shutdown
|
||||||
inst_hook emergency 000 ./hard-off.sh
|
inst_hook emergency 000 ./hard-off.sh
|
||||||
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
inst_simple ./99-idesymlinks.rules /etc/udev/rules.d/99-idesymlinks.rules
|
||||||
|
@ -255,7 +252,7 @@ test_setup() {
|
||||||
# Make client's dracut image
|
# Make client's dracut image
|
||||||
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
$basedir/dracut.sh -l -i $TESTDIR/overlay / \
|
||||||
-o "plymouth" \
|
-o "plymouth" \
|
||||||
-a "debug watchdog" \
|
-a "debug" \
|
||||||
-d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc ib700wdt" \
|
-d "piix sd_mod sr_mod ata_piix ide-gd_mod e1000 nfs sunrpc ib700wdt" \
|
||||||
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
-f $TESTDIR/initramfs.testing $KVERSION || return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue