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