support old style root=dhcp root-path=server-ip:/path
authorHarald Hoyer <harald@redhat.com>
Wed, 17 Jun 2009 18:25:23 +0000 (20:25 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 17 Jun 2009 18:25:23 +0000 (20:25 +0200)
modules.d/95nfs/parse-nfsroot.sh
test/TEST-20-NFS/test.sh

index 0a74288..5413ad5 100755 (executable)
@@ -71,6 +71,12 @@ netroot_to_var() {
 [ -z "$netroot" ] && netroot=$(getarg netroot=)
 [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=)
 
+# Handle old style <server-ip>:/<path
+case "$netroot" in
+    [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*)
+       netroot=nfs:$netroot;;
+esac
+
 # Root takes precedence over netroot
 case "${root%%:*}" in
     nfs|nfs4|/dev/nfs|/dev/nfs4)
index 0f1f36c..05a5deb 100755 (executable)
@@ -101,13 +101,12 @@ test_nfsv3() {
     # NFSv3: last octect starts at 0x00 and works up
     # NFSv4: last octect starts at 0x80 and works up
 
-    # This test must fail: dhcp root-path must have proto:...
-    client_test "NFSv3 netroot=dhcp DHCP path only" 52:54:00:12:34:00 \
-       "netroot=dhcp" 192.168.50.1 -wsize=4096 && return 1
-
-    # This test must fail: dhcp root-path must have proto:...
     client_test "NFSv3 root=dhcp DHCP path only" 52:54:00:12:34:00 \
-       "root=dhcp" 192.168.50.1 -wsize=4096 && return 1
+       "root=dhcp" 192.168.50.1 -wsize=4096 || return 1
+
+    # This test must fail: no root=
+    client_test "NFSv3 netroot=dhcp DHCP path only" 52:54:00:12:34:00 \
+       "netroot=dhcp" 192.168.50.1 -wsize=4096  && return 1
 
     client_test "NFSv3 root=nfs DHCP path only" 52:54:00:12:34:00 \
        "root=nfs" 192.168.50.1 -wsize=4096 || return 1
@@ -171,13 +170,11 @@ test_nfsv3() {
        52:54:00:12:34:04 "root=nfs nfsroot=/nfs/client,wsize=4096" \
        192.168.50.1 wsize=4096 || return 1
 
-    # This test must fail: dhcp root-path must have proto:...
     client_test "NFSv3 root=dhcp DHCP path,options" \
-       52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 && return 1
+       52:54:00:12:34:05 "root=dhcp" 192.168.50.1 wsize=4096 || return 1
 
-    # This test must fail: dhcp root-path must have proto:...
     client_test "NFSv3 root=dhcp DHCP IP:path,options" \
-       52:54:00:12:34:06 "root=dhcp" 192.168.50.2 wsize=4096 && return 1
+       52:54:00:12:34:06 "root=dhcp" 192.168.50.2 wsize=4096 || return 1
 
     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