fixed-address 192.168.50.101;
}
}
+
+ group {
+ # NFSv3 root=dhcp or root={/dev/,}nfs, use given IP
+ option root-path "192.168.50.1:/nfs/client";
+
+ host nfs3-2 {
+ hardware ethernet 52:54:00:12:34:01;
+ fixed-address 192.168.50.101;
+ }
+ }
+
+ group {
+ # NFSv3 root=dhcp, use protocol from root-path
+ option root-path "nfs:192.168.50.1:/nfs/client";
+
+ host nfs3-3 {
+ hardware ethernet 52:54:00:12:34:02;
+ fixed-address 192.168.50.101;
+ }
+ }
+
+ group {
+ # NFSv4 root={/dev/,}nfs4, use server-id
+ option root-path "/client";
+
+ host nfs4-1 {
+ hardware ethernet 52:54:00:12:34:03;
+ fixed-address 192.168.50.101;
+ }
+ }
+
+ group {
+ # NFSv4 root={/dev/,}nfs4, use given IP
+ option root-path "192.168.50.1:/client";
+
+ host nfs4-2 {
+ hardware ethernet 52:54:00:12:34:04;
+ fixed-address 192.168.50.101;
+ }
+ }
+
+ group {
+ # NFSv4 root=dhcp, use profocol from root-path
+ option root-path "nfs4:192.168.50.1:/client";
+
+ host nfs4-3 {
+ hardware ethernet 52:54:00:12:34:05;
+ fixed-address 192.168.50.101;
+ }
+ }
}
KVERSION=${KVERSION-$(uname -r)}
+# Uncomment this to debug failures
+#DEBUGFAIL="rdinitdebug rdnetdebug"
+
run_server() {
# Start server first
echo "NFS TEST SETUP: Starting DHCP/NFS server"
-net nic,macaddr=$mac,model=e1000 \
-net socket,mcast=230.0.0.1:1234 \
-kernel /boot/vmlinuz-$KVERSION \
- -append "$cmdline rw quiet console=ttyS0,115200n81" \
+ -append "$cmdline $DEBUGFAIL ro quiet console=ttyS0,115200n81" \
-initrd initramfs.testing
if [[ $? -eq 0 ]] && grep -m 1 -q nfs-OK client.img; then
return 1
fi
- client_test "NFSv3 root=dhcp" 52:54:00:12:34:00 "root=dhcp" || return 1
+ client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
+ "root=dhcp" || return 1
+
+ client_test "NFSv3 root=nfs DHCP path only" 52:54:00:12:34:00 \
+ "root=nfs" || return 1
+
+ client_test "NFSv3 root=/dev/nfs DHCP path only" 52:54:00:12:34:00 \
+ "root=/dev/nfs" || return 1
+
+ client_test "NFSv3 root=dhcp DHCP IP:path" 52:54:00:12:34:01 \
+ "root=dhcp" || return 1
+
+ client_test "NFSv3 root=nfs DHCP IP:path" 52:54:00:12:34:01 \
+ "root=nfs" || return 1
+
+ client_test "NFSv3 root=/dev/nfs DHCP IP:path" 52:54:00:12:34:01 \
+ "root=/dev/nfs" || return 1
+
+ client_test "NFSv3 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:02 \
+ "root=dhcp" || return 1
+
+ # There is a mandatory 90 second recovery when starting the NFSv4
+ # server, so put these later in the list to avoid a pause when doing
+ # switch_root
+
+ client_test "NFSv4 root=nfs4 DHCP path only" 52:54:00:12:34:03 \
+ "root=nfs4" || return 1
+
+ client_test "NFSv4 root=/dev/nfs4 DHCP path only" 52:54:00:12:34:03 \
+ "root=/dev/nfs4" || return 1
+
+ client_test "NFSv4 root=nfs4 DHCP IP:path" 52:54:00:12:34:04 \
+ "root=nfs4" || return 1
+
+ client_test "NFSv4 root=/dev/nfs4 DHCP IP:path" 52:54:00:12:34:04 \
+ "root=/dev/nfs4" || return 1
+
+ client_test "NFSv4 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:05 \
+ "root=dhcp" || return 1
}
test_setup() {
# Make server root
- dd if=/dev/zero of=server.ext2 bs=1M count=20
+ dd if=/dev/zero of=server.ext2 bs=1M count=30
mke2fs -F server.ext2
mkdir mnt
sudo mount -o loop server.ext2 mnt
dracut_install sh ls shutdown poweroff stty cat ps ln ip \
/lib/terminfo/l/linux dmesg mkdir cp ping exportfs \
rpcbind modprobe rpc.nfsd rpc.mountd dhcpd showmount tcpdump \
- /etc/netconfig /etc/services sleep
+ /etc/netconfig /etc/services sleep mount
instmods nfsd sunrpc
inst ./server-init /sbin/init
inst ./hosts /etc/hosts
inst ./dhcpd.conf /etc/dhcpd.conf
(
cd "$initdir";
- mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind,nfs}
- mkdir -p var/lib/nfs/v4recovery
+ mkdir -p dev sys proc etc var/run tmp var/lib/{dhcpd,rpcbind}
+ mkdir -p var/lib/nfs/{v4recovery,rpc_pipefs}
chmod 777 var/lib/rpcbind var/lib/nfs
)
inst /etc/nsswitch.conf /etc/nsswitch.conf
inst /etc/passwd /etc/passwd
inst /etc/group /etc/group
- for i in /lib*/libnss_files*;do
+ for i in /lib*/libnss_files**;do
inst_library $i
done