git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10126 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
amy0701 2011-07-20 09:53:26 +00:00
parent c6c76412e7
commit a4faac7b2b
2 changed files with 114 additions and 0 deletions

View File

@ -0,0 +1,4 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.5.5.5 test
9.114.34.61 hv16s6ap10.ppd.pok.ibm.com hv16s6ap10

View File

@ -0,0 +1,110 @@
start:makehosts_h
description:makehosts -h
cmd:makehosts -h
check:rc==0
check:output=~Usage
end
start:makehosts_help
description:makehosts --help
cmd:makehosts --help
check:rc==0
check:output=~Usage
end
start:makehosts_null
description:makehosts
cmd:cp -f /etc/hosts /etc/hosts.xcatbak
cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|"
check:rc==0
cmd:mkdef -t node -o node01,node02 groups="compute"
check:rc==0
cmd:makehosts
check:rc==0
cmd:cat /etc/hosts
check:output=~1.2.3.2
check:output=~1.2.3.1
check:output=~node01
check:output=~node02
cmd:chtab -d node=compute hosts
cmd:rmdef node01
cmd:rmdef node02
cmd:mv -f /etc/hosts.xcatbak /etc/hosts
end
start:makehosts_l
cmd:cp -f /etc/hosts /etc/hosts.xcatbak
cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|"
check:rc==0
cmd:chdef -t node -o node01,node02 groups="compute"
check:rc==0
cmd:makehosts -l
check:rc==0
cmd:cat /etc/hosts|awk '{print $2}'
check:output=~node01.cluster.net
check:output=~node02.cluster.net
cmd:chtab -d node=compute hosts
cmd:rmdef node01
cmd:rmdef node02
cmd:mv -f /etc/hosts.xcatbak /etc/hosts
end
start:makehosts_d
cmd:cp -f /etc/hosts /etc/hosts.xcatbak
cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|"
check:rc==0
cmd:chdef -t node -o node01 groups="compute"
check:rc==0
cmd:makehosts node01
check:rc==0
cmd:cat /etc/hosts > /tmp/1
cmd:makehosts -d node01
check:rc==0
cmd:cat /etc/hosts > /tmp/2
cmd:diff /tmp/1 /tmp/2
check:output=~node01.cluster.net
cmd:chtab -d node=compute hosts
cmd:rmdef node01
cmd:mv -f /etc/hosts.xcatbak /etc/hosts
cmd:rm -f /tmp/1 /tmp/2
end
start:makehosts_n
cmd:cp -f /etc/hosts /etc/hosts.xcatbak
cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|"
check:rc==0
cmd:chdef -t node -o node01 groups="compute"
check:rc==0
cmd:makehosts -n
check:rc==0
cmd:cat /etc/hosts |wc -l
check:rc==0
check:output==2
cmd:cat /etc/hosts
check:output=~node01.cluster.net
cmd:chtab -d node=compute hosts
cmd:rmdef node01
cmd:mv -f /etc/hosts.xcatbak /etc/hosts
end
start:makehosts_n_noderange
cmd:cp -f /etc/hosts /etc/hosts.xcatbak
cmd:chtab node=compute hosts.ip="|node(\d+)|1.2.3.(\$1+0)|" hosts.hostnames="|(.*)|(\$1).cluster.net|"
check:rc==0
cmd:chdef -t node -o node01 groups="compute"
check:rc==0
cmd:makehosts -n node01
check:rc==0
cmd:cat /etc/hosts |wc -l
check:rc==0
check:output==2
cmd:cat /etc/hosts
check:output=~node01.cluster.net
cmd:chtab -d node=compute hosts
cmd:rmdef node01
cmd:mv -f /etc/hosts.xcatbak /etc/hosts
cmd:cat /etc/hosts| grep -v node01 > /tmp/1
cmd:mv -f /tmp/1 > /etc/hosts
end