Skip to contentSkip to conversation

More test suite stuff (and bug fixes)

PATCH In review David Dillow 2 participants 14 messages Jun 8, 2009 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

cover More test suite stuff (and bug fixes)

This add more comprehensive tests to the NFS test suite, such as verifying that we used the right server IP address, and that we added mount options appropriately. It may be a bit too comprehensive, as it takes over 7 minutes to run for me.

Also of note, I addded support for a default NFS path and %s substitution as done by the kernel's nfsroot handling.

This also has the first round of testing for NBD root, and a fix for a bug found by the test suite.

David Dillow (11):
NFS test: verify that we used the right IP to get to the server NFS test: add support for checking mount options used NFS test: renumber MAC addresses to ease adding new test cases NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options]
format
NFS test: add test cases for DHCP/nfsroot=[IP:]/path[,options] NFS test: separate NFSv3 and NFSv4 tests into their own functions NFS root: add support for default root path and %s substitution dracut init: add rdnetdebug to exclude list
NFS test: add test for nfs[4]:srv:/path syntax
NBD: fix parsing of Debian-style nbdroot config
NBD: add test suite

 modules.d/95nbd/parse-nbdroot.sh |    2 +-
 modules.d/95nfs/nfs-netroot.sh   |   17 ++++
 modules.d/95nfs/nfsroot          |   14 +++
 modules.d/99base/init            |    1 +
 test/TEST-20-NFS/client-init     |    6 +-
 test/TEST-20-NFS/dhcpd.conf      |  118 +++++++++++++++++++++++--
 test/TEST-20-NFS/exports         |    3 +
 test/TEST-20-NFS/hosts           |    2 +
 test/TEST-20-NFS/server-init     |    5 +
 test/TEST-20-NFS/test.sh         |  180 ++++++++++++++++++++++++++++++++------
 test/TEST-40-NBD/Makefile        |   10 ++
 test/TEST-40-NBD/client-init     |   10 ++
 test/TEST-40-NBD/dhcpd.conf      |   29 ++++++
 test/TEST-40-NBD/hard-off.sh     |    2 +
 test/TEST-40-NBD/hosts           |    8 ++
 test/TEST-40-NBD/server-init     |   18 ++++
 test/TEST-40-NBD/test.sh         |  179 +++++++++++++++++++++++++++++++++++++
 17 files changed, 569 insertions(+), 35 deletions(-)
 create mode 100644 test/TEST-40-NBD/Makefile
 create mode 100755 test/TEST-40-NBD/client-init
 create mode 100644 test/TEST-40-NBD/dhcpd.conf
 create mode 100755 test/TEST-40-NBD/hard-off.sh
 create mode 100644 test/TEST-40-NBD/hosts
 create mode 100755 test/TEST-40-NBD/server-init
 create mode 100755 test/TEST-40-NBD/test.sh

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): cover.1244435634.git.dave-i1Mk8JYDVaaSihdK6806/[email protected]

#2 lore raw

PATCH 1/11 NFS test: verify that we used the right IP to get to the server

---
 test/TEST-20-NFS/client-init |    6 ++++-
 test/TEST-20-NFS/dhcpd.conf  |    8 +++---
 test/TEST-20-NFS/hosts       |    2 +
 test/TEST-20-NFS/server-init |    2 +
 test/TEST-20-NFS/test.sh     |   46 ++++++++++++++++++++++++++---------------
 5 files changed, 42 insertions(+), 22 deletions(-)
test/TEST-20-NFS/client-init +5 -1
index c0149b9..00fa3c9 100755
@@ -4,6 +4,10 @@ export TERM=linux
 export PS1='initramfs-test:\w\$ '
 stty sane
 echo "made it to the rootfs! Powering down."
+while read dev fs fstype opts rest; do
+    [ "$fstype" != "nfs" -a "$fstype" != "nfs4" ] && continue
+    echo "nfs-OK $dev $fstype $opts" > /dev/sda
+    break
+done < /proc/mounts
 #sh -i
-echo nfs-OK > /dev/sda
 poweroff -f
test/TEST-20-NFS/dhcpd.conf +4 -4
index 14fee3e..a756195 100644
@@ -23,7 +23,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 
 	group {
 		# NFSv3 root=dhcp or root={/dev/,}nfs, use given IP
-		option root-path "192.168.50.1:/nfs/client";
+		option root-path "192.168.50.2:/nfs/client";
 
 		host nfs3-2 {
 			hardware ethernet 52:54:00:12:34:01;
@@ -33,7 +33,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 
 	group {
 		# NFSv3 root=dhcp, use protocol from root-path
-		option root-path "nfs:192.168.50.1:/nfs/client";
+		option root-path "nfs:192.168.50.3:/nfs/client";
 
 		host nfs3-3 {
 			hardware ethernet 52:54:00:12:34:02;
@@ -53,7 +53,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 
 	group {
 		# NFSv4 root={/dev/,}nfs4, use given IP
-		option root-path "192.168.50.1:/client";
+		option root-path "192.168.50.2:/client";
 
 		host nfs4-2 {
 			hardware ethernet 52:54:00:12:34:04;
@@ -63,7 +63,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 
 	group {
 		# NFSv4 root=dhcp, use profocol from root-path
-		option root-path "nfs4:192.168.50.1:/client";
+		option root-path "nfs4:192.168.50.3:/client";
 
 		host nfs4-3 {
 			hardware ethernet 52:54:00:12:34:05;
test/TEST-20-NFS/hosts +2 -0
index 5aca4ed..f8c18b6 100644
@@ -1,5 +1,7 @@
 127.0.0.1	localhost
 192.168.50.1	server
+192.168.50.2	server-ip
+192.168.50.3	server-proto-ip
 192.168.50.100	workstation1
 192.168.50.101	workstation2
 192.168.50.102	workstation3
test/TEST-20-NFS/server-init +2 -0
index f6d3891..67af8fa 100755
@@ -7,6 +7,8 @@ echo server > /proc/sys/kernel/hostname
 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 addr add 192.168.50.2/24 dev eth0
+ip addr add 192.168.50.3/24 dev eth0
 ip link set eth0 up
 modprobe sunrpc
 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
test/TEST-20-NFS/test.sh +29 -17

92 lines not on this page · raw message

Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/11 NFS test: add support for checking mount options used

In reply to a message not in the archive
---
 test/TEST-20-NFS/dhcpd.conf |   20 +++++++++++++
 test/TEST-20-NFS/test.sh    |   65 +++++++++++++++++++++++++++++++++----------
 2 files changed, 70 insertions(+), 15 deletions(-)
test/TEST-20-NFS/dhcpd.conf +20 -0
index a756195..7d76180 100644
@@ -42,6 +42,16 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 	}
 
 	group {
+		# NFSv3 root=dhcp, use protocol, options from root-path
+		option root-path "nfs:192.168.50.3:/nfs/client:wsize=4096";
+
+		host nfs3-4 {
+			hardware ethernet 52:54:00:12:34:06;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
 		# NFSv4 root={/dev/,}nfs4, use server-id
 		option root-path "/client";
 
@@ -70,4 +80,14 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 			fixed-address 192.168.50.101;
 		}
 	}
+
+	group {
+		# NFSv4 root=dhcp, use profocol, options from root-path
+		option root-path "nfs4:192.168.50.3:/client:wsize=4096";
+
+		host nfs4-4 {
+			hardware ethernet 52:54:00:12:34:07;
+			fixed-address 192.168.50.101;
+		}
+	}
 }
test/TEST-20-NFS/test.sh +50 -15

113 lines not on this page · raw message

Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw

PATCH 3/11 NFS test: renumber MAC addresses to ease adding new test cases

In reply to a message not in the archive
---
 test/TEST-20-NFS/dhcpd.conf |   16 +++++++++++-----
 test/TEST-20-NFS/test.sh    |   18 +++++++++++-------
 2 files changed, 22 insertions(+), 12 deletions(-)
test/TEST-20-NFS/dhcpd.conf +11 -5
index 7d76180..3c6f17d 100644
@@ -11,6 +11,9 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 	option domain-search "example.com";
 	option domain-name "other.com";
 
+	# MAC numbering scheme:
+	# NFSv3: last octect starts at 0x00 and works up
+
 	group {
 		# NFSv3 root=dhcp or root={/dev/,}nfs, use server-id
 		option root-path "/nfs/client";
@@ -46,17 +49,20 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 		option root-path "nfs:192.168.50.3:/nfs/client:wsize=4096";
 
 		host nfs3-4 {
-			hardware ethernet 52:54:00:12:34:06;
+			hardware ethernet 52:54:00:12:34:03;
 			fixed-address 192.168.50.101;
 		}
 	}
 
+	# MAC numbering scheme:
+	# NFSv4: last octect starts at 0x80 and works up
+
 	group {
 		# NFSv4 root={/dev/,}nfs4, use server-id
 		option root-path "/client";
 
 		host nfs4-1 {
-			hardware ethernet 52:54:00:12:34:03;
+			hardware ethernet 52:54:00:12:34:80;
 			fixed-address 192.168.50.101;
 		}
 	}
@@ -66,7 +72,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 		option root-path "192.168.50.2:/client";
 
 		host nfs4-2 {
-			hardware ethernet 52:54:00:12:34:04;
+			hardware ethernet 52:54:00:12:34:81;
 			fixed-address 192.168.50.101;
 		}
 	}
@@ -76,7 +82,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 		option root-path "nfs4:192.168.50.3:/client";
 
 		host nfs4-3 {
-			hardware ethernet 52:54:00:12:34:05;
+			hardware ethernet 52:54:00:12:34:82;
 			fixed-address 192.168.50.101;
 		}
 	}
@@ -86,7 +92,7 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 		option root-path "nfs4:192.168.50.3:/client:wsize=4096";
 
 		host nfs4-4 {
-			hardware ethernet 52:54:00:12:34:07;
+			hardware ethernet 52:54:00:12:34:83;
 			fixed-address 192.168.50.101;
 		}
 	}
test/TEST-20-NFS/test.sh +11 -7
index eb46ad1..8adfdbb 100755
@@ -102,6 +102,10 @@ test_run() {
 	return 1
     fi
 
+    # MAC numbering scheme:
+    # NFSv3: last octect starts at 0x00 and works up
+    # NFSv4: last octect starts at 0x80 and works up
+    
     client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
 	"root=dhcp" 192.168.50.1 -wsize=4096 || return 1
 
@@ -123,29 +127,29 @@ test_run() {
     client_test "NFSv3 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:02 \
 	"root=dhcp" 192.168.50.3 -wsize=4096 || return 1
 
-    client_test "NFSv3 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:06 \
+    client_test "NFSv3 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:03 \
 	"root=dhcp" 192.168.50.3 wsize=4096 || 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 \
+    client_test "NFSv4 root=nfs4 DHCP path only" 52:54:00:12:34:80 \
 	"root=nfs4" 192.168.50.1 -wsize=4096 || return 1
 
-    client_test "NFSv4 root=/dev/nfs4 DHCP path only" 52:54:00:12:34:03 \
+    client_test "NFSv4 root=/dev/nfs4 DHCP path only" 52:54:00:12:34:80 \
 	"root=/dev/nfs4" 192.168.50.1 -wsize=4096 || return 1
 
-    client_test "NFSv4 root=nfs4 DHCP IP:path" 52:54:00:12:34:04 \
+    client_test "NFSv4 root=nfs4 DHCP IP:path" 52:54:00:12:34:81 \
 	"root=nfs4" 192.168.50.2 -wsize=4096 || return 1
 
-    client_test "NFSv4 root=/dev/nfs4 DHCP IP:path" 52:54:00:12:34:04 \
+    client_test "NFSv4 root=/dev/nfs4 DHCP IP:path" 52:54:00:12:34:81 \
 	"root=/dev/nfs4" 192.168.50.2 -wsize=4096 || return 1
 
-    client_test "NFSv4 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:05 \
+    client_test "NFSv4 root=dhcp DHCP proto:IP:path" 52:54:00:12:34:82 \
 	"root=dhcp" 192.168.50.3 -wsize=4096 || return 1
 
-    client_test "NFSv4 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:07 \
+    client_test "NFSv4 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:83 \
 	"root=dhcp" 192.168.50.3 wsize=4096 || return 1
 }
 
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH 4/11 NFS root: add missing DHCP root-path/nfsroot=[IP:]/path[,options] format

In reply to a message not in the archive
---
 modules.d/95nfs/nfs-netroot.sh |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
modules.d/95nfs/nfs-netroot.sh +16 -0
index 0591a31..8d552e9 100755
@@ -14,6 +14,10 @@ if [ "$root" = "dhcp" -o "$root" = "nfs" -o "$root" = "nfs4" ]; then
 	if check_occurances "$new_root_path" ':' 2; then
 	    root="$nfsver:$new_root_path"
 	fi ;;
+    *:/*,*)
+	if check_occurances "$new_root_path" ':' 1; then
+	    root="$nfsver:$new_root_path"
+	fi ;;
     *:/*)
 	if check_occurances "$new_root_path" ':' 1; then
 	    root="$nfsver:$new_root_path:"
@@ -22,6 +26,10 @@ if [ "$root" = "dhcp" -o "$root" = "nfs" -o "$root" = "nfs4" ]; then
 	if check_occurances "$new_root_path" ':' 1; then
 	    root="$nfsver::$new_root_path"
 	fi ;;
+    /*,*)
+	if check_occurances "$new_root_path" ':' 0; then
+	    root="$nfsver::$new_root_path"
+	fi ;;
     /*)
 	if check_occurances "$new_root_path" ':' 0; then
 	    root="$nfsver::$new_root_path:"
@@ -40,6 +48,14 @@ if [ -z "${root%%nfs:*}" -o -z "${root%%nfs4:*}" ]; then
     if [ -z "$nfsserver" -o "$nfsserver" = "$nfspath" ]; then
 	nfsserver=$new_dhcp_server_identifier
     fi
+
+    # Handle alternate syntax of path,options
+    if [ "$nfsflags" = "$nfspath" -a "${root#*,}" != "$root" ]; then
+	nfspath=${root%%,*}
+	nfsflags=${root#*,}
+    fi
+
+    # Catch the case when no additional flags are set
     if [ "$nfspath" = "$nfsflags" ]; then
 	unset nfsflags
     fi
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

PATCH 5/11 NFS test: add test cases for DHCP/nfsroot=[IP:]/path[,options]

In reply to a message not in the archive
---
 test/TEST-20-NFS/dhcpd.conf |   78 +++++++++++++++++++++++++++++++++++++++++++
 test/TEST-20-NFS/test.sh    |   45 +++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 0 deletions(-)
test/TEST-20-NFS/dhcpd.conf +78 -0
index 3c6f17d..a4f7fc1 100644
@@ -54,6 +54,45 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 		}
 	}
 
+	group {
+		# NFSv3 root=dhcp, nfsroot=/path and nfsroot=IP:/path testing
+
+		host nfs3-5 {
+			hardware ethernet 52:54:00:12:34:04;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv3 root=dhcp, use path, comma-separated options
+		option root-path "/nfs/client,wsize=4096";
+
+		host nfs3-6 {
+			hardware ethernet 52:54:00:12:34:05;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv3 root=dhcp, use IP, path, comma-separated options
+		option root-path "192.168.50.2:/nfs/client,wsize=4096";
+
+		host nfs3-7 {
+			hardware ethernet 52:54:00:12:34:06;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv3 root=dhcp, use proto, IP, path, comma-separated options
+		option root-path "nfs:192.168.50.3:/nfs/client,wsize=4096";
+
+		host nfs3-8 {
+			hardware ethernet 52:54:00:12:34:07;
+			fixed-address 192.168.50.101;
+		}
+	}
+
 	# MAC numbering scheme:
 	# NFSv4: last octect starts at 0x80 and works up
 
@@ -96,4 +135,43 @@ subnet 192.168.50.0 netmask 255.255.255.0 {
 			fixed-address 192.168.50.101;
 		}
 	}
+
+	group {
+		# NFSv3 root=nfs4, nfsroot=/path and nfsroot=IP:/path testing
+		host nfs4-5 {
+			hardware ethernet 52:54:00:12:34:84;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv4 root={/dev/,}nfs4, use server-id, comma-separated opts
+		option root-path "/client,wsize=4096";
+
+		host nfs4-6 {
+			hardware ethernet 52:54:00:12:34:85;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv4 root={/dev/,}nfs4, use given IP, comma-separated opts
+		option root-path "192.168.50.2:/client,wsize=4096";
+
+		host nfs4-7 {
+			hardware ethernet 52:54:00:12:34:86;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		# NFSv4 root=dhcp, use comma-separated opts
+		option root-path "nfs4:192.168.50.3:/client,wsize=4096";
+
+		host nfs4-8 {
+			hardware ethernet 52:54:00:12:34:87;
+			fixed-address 192.168.50.101;
+		}
+	}
+
 }
test/TEST-20-NFS/test.sh +45 -0

57 lines not on this page · raw message

Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

PATCH 6/11 NFS test: separate NFSv3 and NFSv4 tests into their own functions

In reply to a message not in the archive

The full tests take over 6 minutes to run, and commenting out unneeded ones is time consuming -- this change lets me comment out one line to temporarily avoid an entire class of tests.

---
 test/TEST-20-NFS/test.sh |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
test/TEST-20-NFS/test.sh +13 -6
index 5888fdc..4a997c4 100755
@@ -96,12 +96,7 @@ client_test() {
     return 0
 }
 
-test_run() {
-    if ! run_server; then
-	echo "Failed to start server" 1>&2
-	return 1
-    fi
-
+test_nfsv3() {
     # MAC numbering scheme:
     # NFSv3: last octect starts at 0x00 and works up
     # NFSv4: last octect starts at 0x80 and works up
@@ -154,7 +149,9 @@ test_run() {
 
     client_test "NFSv3 root=dhcp DHCP proto:IP:path,options" \
 	52:54:00:12:34:07 "root=dhcp" 192.168.50.3 wsize=4096 || return 1
+}
 
+test_nfsv4() {
     # 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
@@ -198,6 +195,16 @@ test_run() {
 	52:54:00:12:34:87 "root=dhcp" 192.168.50.3 wsize=4096 || return 1
 }
 
+test_run() {
+    if ! run_server; then
+	echo "Failed to start server" 1>&2
+	return 1
+    fi
+
+    test_nfsv3 || return 1
+    test_nfsv4
+}
+
 test_setup() {
     # Make server root
     dd if=/dev/zero of=server.ext2 bs=1M count=30
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#8 lore raw

PATCH 7/11 NFS root: add support for default root path and %s substitution

In reply to a message not in the archive

This implements a default path of /tftpboot/%s if no path is provided, and adds host name substitution for %s, with a fall back to the IP address, as provided by the kernel's nfsroot handling.

The test suite is updated to test this functionality.

---
 modules.d/95nfs/nfs-netroot.sh |    1 +
 modules.d/95nfs/nfsroot        |   14 ++++++++++++++
 test/TEST-20-NFS/exports       |    3 +++
 test/TEST-20-NFS/server-init   |    3 +++
 test/TEST-20-NFS/test.sh       |   18 ++++++++++++++++++
 5 files changed, 39 insertions(+), 0 deletions(-)
modules.d/95nfs/nfs-netroot.sh +1 -0
index 8d552e9..365d394 100755
@@ -34,6 +34,7 @@ if [ "$root" = "dhcp" -o "$root" = "nfs" -o "$root" = "nfs4" ]; then
 	if check_occurances "$new_root_path" ':' 0; then
 	    root="$nfsver::$new_root_path:"
 	fi ;;
+    '') root="$nfsver:::" ;;
     esac
 fi
 
modules.d/95nfs/nfsroot +14 -0
index da002c5..cd3bc7c 100755
@@ -21,6 +21,20 @@ nfsserver=${root%%:*}; root=${root#*:}
 nfspath=${root%%:*}
 flags=${root#*:}
 
+[ -z "$nfspath" ] && nfspath=/tftpboot/%s
+
+# Kernel replaces first %s with host name, and falls back to the ip address
+# if it isn't set. Only the first %s is substituted.
+#
+if [ "${nfspath#*%s}" != "$nfspath" ]; then
+    ip=$(ip -o -f inet addr show $netif)
+    ip=${ip%%/*}
+    ip=${ip##* }
+    read node < /proc/sys/kernel/hostname
+    [ "$node" = "(none)" ] && node=$ip
+    nfspath=${nfspath%%%s*}$node${nfspath#*%s}
+fi
+
 # look through the flags and see if any are overridden by the command line
 # Append a , so we know we terminate
 flags=${flags},
test/TEST-20-NFS/exports +3 -0
index 2701877..95619e7 100644
@@ -1,2 +1,5 @@
 /nfs		192.168.50.0/24(ro,fsid=0,insecure,no_subtree_check,no_root_squash)
 /nfs/client	192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash)
+/nfs/nfs3-5	192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash,nohide)
+/nfs/ip/192.168.50.101	192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash,nohide)
+/nfs/tftpboot/nfs4-5	192.168.50.0/24(ro,insecure,no_subtree_check,no_root_squash,nohide)
test/TEST-20-NFS/server-init +3 -0
index 67af8fa..ed7e43e 100755
@@ -10,6 +10,9 @@ ip addr add 192.168.50.1/24 dev eth0
 ip addr add 192.168.50.2/24 dev eth0
 ip addr add 192.168.50.3/24 dev eth0
 ip link set eth0 up
+mount --bind /nfs/client /nfs/nfs3-5
+mount --bind /nfs/client /nfs/ip/192.168.50.101
+mount --bind /nfs/client /nfs/tftpboot/nfs4-5
 modprobe sunrpc
 mount -t rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
 rpcbind
test/TEST-20-NFS/test.sh +18 -0
index 4a997c4..6583366 100755
@@ -137,6 +137,15 @@ test_nfsv3() {
     client_test "NFSv3 root=nfs nfsroot=/nfs/client" 52:54:00:12:34:04 \
 	"root=nfs nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 || return 1
 
+    client_test "NFSv3 root=nfs nfsroot=/nfs/%s" 52:54:00:12:34:04 \
+	"root=nfs nfsroot=/nfs/%s" 192.168.50.1 -wsize=4096 || return 1
+
+    client_test "NFSv3 root=nfs nfsroot=/nfs/ip/%s no host name (use IP)" \
+	52:54:00:12:34:7f \
+	"root=nfs nfsroot=/nfs/ip/%s \
+		ip=192.168.50.101:192.168.50.1::255.255.255.0::eth0:static" \
+	192.168.50.1 -wsize=4096 || return 1
+
     client_test "NFSv3 root=nfs nfsroot=/nfs/client,wsize=4096" \
 	52:54:00:12:34:04 "root=nfs nfsroot=/nfs/client,wsize=4096" \
 	192.168.50.1 wsize=4096 || return 1
@@ -185,6 +194,11 @@ test_nfsv4() {
 	52:54:00:12:34:84 "root=nfs4 nfsroot=/client,wsize=4096" \
 	192.168.50.1 wsize=4096 || return 1
 
+    # This one only works with NFSv4 in the test suite -- NFSv3 needs
+    # a /nfs prefix due to our server configuration
+    client_test "NFSv4 root=nfs4" 52:54:00:12:34:84 \
+	"root=nfs4" 192.168.50.1 -wsize=4096 || return 1
+
     client_test "NFSv4 root=nfs4 DHCP path,options" \
 	52:54:00:12:34:85 "root=nfs4" 192.168.50.1 wsize=4096 || return 1
 
@@ -267,6 +281,10 @@ test_setup() {
 	ldconfig -n -r "$initdir" /lib* /usr/lib*
     )
 
+    mkdir -p mnt/nfs/nfs3-5
+    mkdir -p mnt/nfs/ip/192.168.50.101
+    mkdir -p mnt/nfs/tftpboot/nfs4-5
+
     sudo umount mnt
     rm -fr mnt
 
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#9 lore raw

PATCH 8/11 dracut init: add rdnetdebug to exclude list

In reply to a message not in the archive
---
 modules.d/99base/init |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
modules.d/99base/init +1 -0
index 53e28ef..b1115e1 100755
@@ -133,6 +133,7 @@ for x in "$@"; do
     [ "${x%%=*}" = "rdinitdebug" ] && continue
     [ "${x%%=*}" = "rdudevinfo" ] && continue
     [ "${x%%=*}" = "rdudevdebug" ] && continue
+    [ "${x%%=*}" = "rdnetdebug" ] && continue
     initargs="$initargs $x"
 done
 exec switch_root "$NEWROOT" "$INIT" $initargs || {
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#10 lore raw

PATCH 9/11 NFS test: add test for nfs[4]:srv:/path syntax

In reply to a message not in the archive
---
 test/TEST-20-NFS/test.sh |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
test/TEST-20-NFS/test.sh +7 -0
index 6583366..e66d288 100755
@@ -125,6 +125,9 @@ test_nfsv3() {
     client_test "NFSv3 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:03 \
 	"root=dhcp" 192.168.50.3 wsize=4096 || return 1
 
+    client_test "NFSv3 root=nfs:..." 52:54:00:12:34:04 \
+	"root=nfs:192.168.50.1:/nfs/client" 192.168.50.1 -wsize=4096 || return 1
+
     client_test "NFSv3 nfsroot=/nfs/client" 52:54:00:12:34:04 \
 	"nfsroot=/nfs/client" 192.168.50.1 -wsize=4096 || return 1
 
@@ -183,6 +186,10 @@ test_nfsv4() {
     client_test "NFSv4 root=dhcp DHCP proto:IP:path:options" 52:54:00:12:34:83 \
 	"root=dhcp" 192.168.50.3 wsize=4096 || return 1
 
+    client_test "NFSv4 root=nfs4:..." 52:54:00:12:34:84 \
+	"root=nfs4:192.168.50.1:/client" 192.168.50.1 \
+	-wsize=4096 || return 1
+
     client_test "NFSv4 root=nfs4 nfsroot=/client" 52:54:00:12:34:84 \
 	"root=nfs4 nfsroot=/client" 192.168.50.1 -wsize=4096 || return 1
 
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

PATCH 10/11 NBD: fix parsing of Debian-style nbdroot config

In reply to a message not in the archive
---
 modules.d/95nbd/parse-nbdroot.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
modules.d/95nbd/parse-nbdroot.sh +1 -1
index 84d1c23..ba40207 100755
@@ -34,7 +34,7 @@ case "$root" in
     nbd:*,*)
 	if check_occurances "$root" ',' 1 && check_occurances "$root" ':' 1;
 	then
-	    root=${root%*,}:${root#*,}
+	    root=${root%,*}:${root#*,}
 	fi
 	;;
 esac
Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

PATCH 11/11 NBD: add test suite

In reply to a message not in the archive

This is an initial test suite for the NBD root. It does the basics, and needs to be extended to check more parts of the configuration.

---
 test/TEST-40-NBD/Makefile    |   10 +++
 test/TEST-40-NBD/client-init |   10 +++
 test/TEST-40-NBD/dhcpd.conf  |   29 +++++++
 test/TEST-40-NBD/hard-off.sh |    2 +
 test/TEST-40-NBD/hosts       |    8 ++
 test/TEST-40-NBD/server-init |   18 ++++
 test/TEST-40-NBD/test.sh     |  179 ++++++++++++++++++++++++++++++++++++++++++
 7 files changed, 256 insertions(+), 0 deletions(-)
 create mode 100644 test/TEST-40-NBD/Makefile
 create mode 100755 test/TEST-40-NBD/client-init
 create mode 100644 test/TEST-40-NBD/dhcpd.conf
 create mode 100755 test/TEST-40-NBD/hard-off.sh
 create mode 100644 test/TEST-40-NBD/hosts
 create mode 100755 test/TEST-40-NBD/server-init
 create mode 100755 test/TEST-40-NBD/test.sh
test/TEST-40-NBD/Makefile new file +10 -0
new file mode 100644
index 0000000..bc0ddb6
@@ -0,0 +1,10 @@
+all:
+	@make -s --no-print-directory -C ../.. all
+	@basedir=../.. testdir=../ ./test.sh --all
+setup:
+	@make --no-print-directory -C ../.. all
+	@basedir=../.. testdir=../ ./test.sh --setup
+clean:
+	@basedir=../.. testdir=../ ./test.sh --clean
+run:
+	@basedir=../.. testdir=../ ./test.sh --run
test/TEST-40-NBD/client-init new file +10 -0
new file mode 100755
index 0000000..dde5c16
@@ -0,0 +1,10 @@
+#!/bin/sh
+exec >/dev/console 2>&1
+echo "nbd-OK" >/dev/sda
+export TERM=linux
+export PS1='nbdclient-test:\w\$ '
+stty sane
+echo "made it to the rootfs! Powering down."
+#sh -i
+mount -n -o remount,ro / &> /dev/null
+poweroff -f
test/TEST-40-NBD/dhcpd.conf new file +29 -0
new file mode 100644
index 0000000..e7d5a08
@@ -0,0 +1,29 @@
+ddns-update-style none;
+
+use-host-decl-names true;
+
+subnet 192.168.50.0 netmask 255.255.255.0 {
+	option subnet-mask      255.255.255.0;
+	option routers          192.168.50.1;
+	next-server             192.168.50.1;
+	server-identifier       192.168.50.1;
+	option domain-name-servers 192.168.50.1;
+	option domain-search "example.com";
+	option domain-name "other.com";
+
+	group {
+		host nbd-1 {
+			hardware ethernet 52:54:00:12:34:00;
+			fixed-address 192.168.50.101;
+		}
+	}
+
+	group {
+		host nbd-2 {
+			option root-path "nbd:192.168.50.1:2000";
+
+			hardware ethernet 52:54:00:12:34:01;
+			fixed-address 192.168.50.101;
+		}
+	}
+}
test/TEST-40-NBD/hard-off.sh new file +2 -0
new file mode 100755
index 0000000..85fd849
@@ -0,0 +1,2 @@
+#!/bin/sh
+getarg rdinitdebug || poweroff -f
test/TEST-40-NBD/hosts new file +8 -0
new file mode 100644
index 0000000..f8c18b6
@@ -0,0 +1,8 @@
+127.0.0.1	localhost
+192.168.50.1	server
+192.168.50.2	server-ip
+192.168.50.3	server-proto-ip
+192.168.50.100	workstation1
+192.168.50.101	workstation2
+192.168.50.102	workstation3
+192.168.50.103	workstation4
test/TEST-40-NBD/server-init new file +18 -0
new file mode 100755
index 0000000..1bdc4cc
@@ -0,0 +1,18 @@
+#!/bin/sh 
+export TERM=linux
+export PS1='nbdtest-server:\w\$ '
+stty sane
+echo "made it to the rootfs!"
+echo server > /proc/sys/kernel/hostname
+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
+nbd-server 2000 /dev/sdb -C /dev/null
+>/var/lib/dhcpd/dhcpd.leases
+dhcpd
+sh -i
+# Wait forever for the VM to die
+while sleep 60; do sleep 60; done
+mount -n -o remount,ro /
+poweroff -f
test/TEST-40-NBD/test.sh new file +179 -0

179 lines not on this page · raw message

Signature · 6 lines
1.6.0.6

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#13 lore raw
In reply to a message not in the archive
Quoted 10 lines · David Dillow

This add more comprehensive tests to the NFS test suite, such as verifying that we used the right server IP address, and that we added mount options appropriately. It may be a bit too comprehensive, as it takes over 7 minutes to run for me.

Also of note, I addded support for a default NFS path and %s substitution as done by the kernel's nfsroot handling.

This also has the first round of testing for NBD root, and a fix for a bug found by the test suite.

Of course, I forgot to mention that this series is based on the one I posted Saturday morning.

You can get all of the changes at http://thedillows.org/dracut.git

--
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1244436164.23139.8.camel-1q1vX8mYZiGLUyTwlgNVppKKF0rrzTr+@public.gmane.org

#15 lore raw
Quoted 9 lines · David Dillow
Quoted 8 lines · David Dillow

This add more comprehensive tests to the NFS test suite, such as verifying that we used the right server IP address, and that we added mount options appropriately. It may be a bit too comprehensive, as it takes over 7 minutes to run for me.

Also of note, I addded support for a default NFS path and %s substitution as done by the kernel's nfsroot handling.

Quoted 8 lines
Quoted 2 lines

This also has the first round of testing for NBD root, and a fix for a bug found by the test suite.

Of course, I forgot to mention that this series is based on the one I posted Saturday morning.

You can get all of the changes at http://thedillows.org/dracut.git

Excellent! Thank you very much!

Pulled and merged into main repo, though I had to make some changes to make it pass on Fedora 11.

It seems NFS4 mount only works on Fedora 11, if the ipv6 module is loaded. --
To unsubscribe from this list: send the line "unsubscribe initramfs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html