From a46a06cf160100df4120387c3aecc44158ee8907 Mon Sep 17 00:00:00 2001 From: amy0701 Date: Wed, 20 Jul 2011 06:19:25 +0000 Subject: [PATCH] update git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10121 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-test/autotest/testcase/makedhcp/cases0 | 91 ++++++++++++++++++--- 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index e4cd23b15..fd241f76b 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -1,4 +1,19 @@ -start:makedhcp_n +start:makedhcp_h +description:help +cmd:makedhcp -h +check:rc==0 +check:output=~Usage +end + +start:makedhcp_help +description:help +cmd:makedhcp -h +check:rc==0 +check:output=~Usage +end + +start:makedhcp_n_linux +description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on os:Linux cmd:mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak cmd:makedhcp -n @@ -10,31 +25,81 @@ check:rc==0 check:output=~dhcpd cmd:mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf end + +start:makedhcp_n_aix +description:Create a new dhcp configuration file with a network statement for each network the dhcp daemon should listen on +os:Aix +cmd:mv -f /etc/dhcpsd.cnf /etc/dhcpsd.conf.bak +cmd:makedhcp -n +check:rc==0 +cmd:ls /etc/dhcpsd.cnf +check:rc==0 +cmd:ps -e | grep dhcpd +check:rc==0 +check:output=~dhcpd +end + start:makedhcp_a +description:Define all nodes to the DHCP server. (Will only add nodes that can be reached, network-wise, by this DHCP server.) The dhcp daemon does not have to be restarted after this. os:Linux -cmd:lsdef -l $$CN -z > /tmp/$$CN.stanza -cmd:chdef -t node -o $$CN mac=11:22:33:44:55:66 +cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64 +cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac" +cmd:lsdef -l testnode1 -z > /tmp/CN.stanza +cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66 +cmd:mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak +cmd:makedhcp -n cmd:makedhcp -a check:rc==0 cmd:cat /var/lib/dhcpd/dhcpd.leases -check:output=~$$CN +check:output=~testnode1 check:output=~11:22:33:44:55:66 -cmd:chdef -t node -o $$CN mac= -cmd:cat /tmp/$$CN.stanza | chdef -z +cmd:cat /tmp/CN.stanza | chdef -z +cmd:rmdef testnode1 +cmd:mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf end + start:makedhcp_a_d os:Linux +cmd:lsdef -t node -l -z > /tmp/all.nodes +cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64 +cmd:mkdef -t node -o testnode2 groups=compute mac=11:22:33:55:66:99 arch=ppc64 +cmd:mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak +cmd:makedhcp -n +cmd:makedhcp -a +check:rc==0 +cmd:cat /var/lib/dhcpd/dhcpd.leases > /tmp/1 cmd:makedhcp -a -d check:rc==0 -cmd:cat /var/lib/dhcpd/dhcpd.leases | grep $$CN -check:output!~$$CN -cmd:makedhcp -a +cmd:cat /var/lib/dhcpd/dhcpd.leases > /tmp/2 +cmd:diff /tmp/1 /tmp/2 +check:output=~testnode1 +check:output=~deleted +check:output=~testnode2 +cmd:cat /tmp/all.nodes | chdef -z +cmd:rmdef testnode1 +cmd:rmdef testnode2 +#cmd:rm -f /tmp/1 /tmp/2 end + start:makedhcp_d +description:Delete all node entries, added by xCAT, in the noderange from the DHCP server configuration. os:Linux -cmd:makedhcp -d $$CN +cmd:mkdef -t node -o testnode1 groups=compute mac=11:22:33:55:66:88 arch=ppc64 +cmd:chdef -t node -o testnode1 netboot=yaboot tftpserver=192.16.10.0 nfsserver=192.16.10.0 monserver=192.16.10.0 xcatmaster=192.16.10.0 installnic="mac" primarynic="mac" +cmd:mv -f /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak +cmd:lsdef -l testnode1 -z > /tmp/CN.stanza +cmd:chdef -t node -o testnode1 mac=11:22:33:44:55:66 +cmd:makedhcp -n +cmd:makedhcp testnode1 +cmd:cat /var/lib/dhcpd/dhcpd.leases > /tmp/1 +cmd:makedhcp -d testnode1 check:rc==0 -cmd:cat /var/lib/dhcpd/dhcpd.leases | grep $$CN -check:output!~$$CN -cmd:makedhcp -a +cmd:cat /var/lib/dhcpd/dhcpd.leases > /tmp/2 +cmd:diff /tmp/1 /tmp/2 +check:output=~testnode1 +check:output=~deleted +cmd:cat /tmp/CN.stanza | chdef -z +cmd:rmdef testnode1 +cmd:mv -f /etc/dhcp/dhcpd.conf.bak /etc/dhcp/dhcpd.conf +cmd:rm -f /tmp/1 /tmp/2 end