TEST: Add dhcpd support for debian based distros
authorPhilippe Seewer <philippe.seewer@bfh.ch>
Tue, 16 Jun 2009 08:06:21 +0000 (10:06 +0200)
committerPhilippe Seewer <philippe.seewer@bfh.ch>
Wed, 17 Jun 2009 06:37:38 +0000 (08:37 +0200)
Debian based distros use dhcpd3 instead of just dhcpd. Accordingly
paths to lease files etc are different as well. This patch ensures
that the test-suite can run with either dhcpd or dhcpd3.

test/TEST-20-NFS/server-init
test/TEST-20-NFS/test.sh
test/TEST-40-NBD/server-init
test/TEST-40-NBD/test.sh

index 44ee193..9921071 100755 (executable)
@@ -25,7 +25,8 @@ rpc.mountd
 rpc.idmapd
 exportfs -r
 >/var/lib/dhcpd/dhcpd.leases
-dhcpd -cf /etc/dhcpd.conf
+chmod 777 /var/lib/dhcpd/dhcpd.leases
+dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
 #sh -i
 # Wait forever for the VM to die
 echo "Serving NFS mounts"
index 5e64850..00bdc0d 100755 (executable)
@@ -272,11 +272,13 @@ test_setup() {
        . $basedir/dracut-functions
        dracut_install sh ls shutdown poweroff stty cat ps ln ip \
            /lib/terminfo/l/linux dmesg mkdir cp ping exportfs \
-           modprobe rpc.nfsd rpc.mountd dhcpd showmount tcpdump \
-           /etc/services sleep mount
+           modprobe rpc.nfsd rpc.mountd showmount tcpdump \
+           /etc/services sleep mount chmod
        which portmap >/dev/null 2>&1 && dracut_install portmap
        which rpcbind >/dev/null 2>&1 && dracut_install rpcbind
        [ -f /etc/netconfig ] && dracut_install /etc/netconfig 
+       which dhcpd >/dev/null 2>&1 && dracut_install dhcpd
+       [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
        instmods nfsd sunrpc ipv6
        inst ./server-init /sbin/init
        inst ./hosts /etc/hosts
index 1df2801..a9bbab6 100755 (executable)
@@ -11,7 +11,8 @@ ip link set eth0 up
 nbd-server 2000 /dev/sdb -C /dev/null
 nbd-server 2001 /dev/sdc -C /dev/null
 >/var/lib/dhcpd/dhcpd.leases
-dhcpd -cf /etc/dhcpd.conf
+chmod 777 /var/lib/dhcpd/dhcpd.leases
+dhcpd -cf /etc/dhcpd.conf -lf /var/lib/dhcpd/dhcpd.leases
 #sh -i
 # Wait forever for the VM to die
 while sleep 60; do sleep 60; done
index 286cbbe..e806d6d 100755 (executable)
@@ -255,8 +255,10 @@ make_server_root() {
        initdir=mnt
        . $basedir/dracut-functions
        dracut_install sh ls shutdown poweroff stty cat ps ln ip \
-           /lib/terminfo/l/linux dmesg mkdir cp ping grep dhcpd \
-           sleep nbd-server
+           /lib/terminfo/l/linux dmesg mkdir cp ping grep \
+           sleep nbd-server chmod
+       which dhcpd >/dev/null 2>&1 && dracut_install dhcpd
+       [ -x /usr/sbin/dhcpd3 ] && inst /usr/sbin/dhcpd3 /usr/sbin/dhcpd
        inst ./server-init /sbin/init
        inst ./hosts /etc/hosts
        inst ./dhcpd.conf /etc/dhcpd.conf