From 4a845f066d6d6f76adc752e980b2c10b04c6ce8e Mon Sep 17 00:00:00 2001
From: Harald Hoyer <harald@redhat.com>
Date: Fri, 19 Aug 2016 15:33:59 +0200
Subject: [PATCH] TEST-20-NFS: remove stale pid file

---
 test/TEST-20-NFS/dhcpd.conf     | 340 ++++++++++++++++++++--------------------
 test/TEST-20-NFS/server-init.sh |   2 +
 test/TEST-20-NFS/test.sh        |   2 +-
 3 files changed, 173 insertions(+), 171 deletions(-)

diff --git a/test/TEST-20-NFS/dhcpd.conf b/test/TEST-20-NFS/dhcpd.conf
index a4f7fc18..4ba73019 100644
--- a/test/TEST-20-NFS/dhcpd.conf
+++ b/test/TEST-20-NFS/dhcpd.conf
@@ -3,175 +3,175 @@ 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";
-
-	# 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";
-
-		host nfs3-1 {
-			hardware ethernet 52:54:00:12:34:00;
-			fixed-address 192.168.50.101;
-		}
-	}
-
-	group {
-		# NFSv3 root=dhcp or root={/dev/,}nfs, use given IP
-		option root-path "192.168.50.2:/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.3:/nfs/client";
-
-		host nfs3-3 {
-			hardware ethernet 52:54:00:12:34:02;
-			fixed-address 192.168.50.101;
-		}
-	}
-
-	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:03;
-			fixed-address 192.168.50.101;
-		}
-	}
-
-	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
-
-	group {
-		# NFSv4 root={/dev/,}nfs4, use server-id
-		option root-path "/client";
-
-		host nfs4-1 {
-			hardware ethernet 52:54:00:12:34:80;
-			fixed-address 192.168.50.101;
-		}
-	}
-
-	group {
-		# NFSv4 root={/dev/,}nfs4, use given IP
-		option root-path "192.168.50.2:/client";
-
-		host nfs4-2 {
-			hardware ethernet 52:54:00:12:34:81;
-			fixed-address 192.168.50.101;
-		}
-	}
-
-	group {
-		# NFSv4 root=dhcp, use profocol from root-path
-		option root-path "nfs4:192.168.50.3:/client";
-
-		host nfs4-3 {
-			hardware ethernet 52:54:00:12:34:82;
-			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:83;
-			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;
-		}
-	}
+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";
+
+# 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";
+
+        host nfs3-1 {
+            hardware ethernet 52:54:00:12:34:00;
+                        fixed-address 192.168.50.101;
+                }
+        }
+
+        group {
+                # NFSv3 root=dhcp or root={/dev/,}nfs, use given IP
+                option root-path "192.168.50.2:/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.3:/nfs/client";
+
+                host nfs3-3 {
+                        hardware ethernet 52:54:00:12:34:02;
+                        fixed-address 192.168.50.101;
+                }
+        }
+
+        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:03;
+                        fixed-address 192.168.50.101;
+                }
+        }
+
+        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
+
+        group {
+                # NFSv4 root={/dev/,}nfs4, use server-id
+                option root-path "/client";
+
+                host nfs4-1 {
+                        hardware ethernet 52:54:00:12:34:80;
+                        fixed-address 192.168.50.101;
+                }
+        }
+
+        group {
+                # NFSv4 root={/dev/,}nfs4, use given IP
+                option root-path "192.168.50.2:/client";
+
+                host nfs4-2 {
+                        hardware ethernet 52:54:00:12:34:81;
+                        fixed-address 192.168.50.101;
+                }
+        }
+
+        group {
+                # NFSv4 root=dhcp, use profocol from root-path
+                option root-path "nfs4:192.168.50.3:/client";
+
+                host nfs4-3 {
+                        hardware ethernet 52:54:00:12:34:82;
+                        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:83;
+                        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;
+                }
+        }
 
 }
diff --git a/test/TEST-20-NFS/server-init.sh b/test/TEST-20-NFS/server-init.sh
index 5b6f42f2..aa8af530 100755
--- a/test/TEST-20-NFS/server-init.sh
+++ b/test/TEST-20-NFS/server-init.sh
@@ -46,10 +46,12 @@ rpc.idmapd
 echo > /dev/watchdog
 exportfs -r
 echo > /dev/watchdog
+mkdir -p /var/lib/dhcpd
 >/var/lib/dhcpd/dhcpd.leases
 echo > /dev/watchdog
 chmod 777 /var/lib/dhcpd/dhcpd.leases
 echo > /dev/watchdog
+rm -f /var/run/dhcpd.pid
 dhcpd -d -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases &
 echo "Serving NFS mounts"
 while :; do
diff --git a/test/TEST-20-NFS/test.sh b/test/TEST-20-NFS/test.sh
index 981cd821..039fb61b 100755
--- a/test/TEST-20-NFS/test.sh
+++ b/test/TEST-20-NFS/test.sh
@@ -237,7 +237,7 @@ test_setup() {
         inst_multiple sh ls shutdown poweroff stty cat ps ln ip \
             dmesg mkdir cp ping exportfs \
             modprobe rpc.nfsd rpc.mountd showmount tcpdump \
-            /etc/services sleep mount chmod
+            /etc/services sleep mount chmod rm
         for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do
             [ -f ${_terminfodir}/l/linux ] && break
         done
