2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-07-01 18:35:36 +00:00

update cases to apply in docker container

This commit is contained in:
litingt
2019-04-17 03:01:59 -04:00
parent 188f9e3e2b
commit 2df0f3f36b
5 changed files with 25 additions and 18 deletions

View File

@ -123,10 +123,9 @@ check:output~=zone "100.100.100.IN-ADDR.ARPA."
cmd:nslookup dnstestnode $$MN
check:output~=Server: $$MN
check:output!~(server can't find dnstestnode)
cmd:rm -f /etc/hosts
check:rc==0
cmd:mv /etc/hosts.testbak /etc/hosts
cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts
check:rc==0
cmd:rm -rf /etc/hosts.testbak
cmd:chtab -d netname=testnetwork networks
check:rc==0
cmd:makedns -n
@ -169,10 +168,9 @@ check:rc==0
check:output~=
cmd:rm -f /tmp/makedns_named_conf.org /tmp/makedns_named_conf.new
check:rc==0
cmd:rm -f /etc/hosts
check:rc==0
cmd:mv /etc/hosts.testbak /etc/hosts
cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts
check:rc==0
cmd:rm -rf /etc/hosts.testbak
cmd:chtab -d netname=testnetwork networks
check:rc==0
cmd:makedns -n

View File

@ -141,7 +141,10 @@ start:makehost_n_r
label:mn_only,dns,wait_fix
descriptions:modify makehosts testcases according to special node name eg:s01 and s01r* . for issue #2717 and #2683
cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest
cmd:sed -i '/s01/d' /etc/hosts
cmd:cp -f /etc/hosts /etc/hosts.bak
cmd:sed -i '/s01/d' /etc/hosts.xcatbakautotest
cmd:sed -i '/s01r1b01/d' /etc/hosts.xcatbakautotest
cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts
cmd:cat /etc/hosts
cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi
check:rc==0
@ -168,7 +171,7 @@ else
exit 1
fi
check:rc==0
cmd:sed -i '/s01/d' /etc/hosts
cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts
cmd:makehosts s01
check:rc==0
cmd:#!/bin/bash
@ -187,7 +190,8 @@ else
exit 1
fi
check:rc==0
cmd:sed -i '/s01/d' /etc/hosts
cmd:cat /etc/hosts
cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts
cmd:makehosts service
check:rc==0
cmd:#!/bin/bash
@ -221,7 +225,7 @@ for i in {1..5}; do
done
exit 1
check:rc==0
cmd:sed -i '/s01/d' /etc/hosts
cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts
cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts
check:rc==0
cmd:grep "s01" /etc/hosts
@ -241,7 +245,7 @@ for i in {1..5}; do
done
exit 1
check:rc==0
cmd:sed -i '/s01/d' /etc/hosts
cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts
cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts
check:rc==0
cmd:grep "s01" /etc/hosts
@ -265,7 +269,8 @@ cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; r
check:rc==0
cmd:if [ -e /tmp/s01r1b01.standa ]; then rmdef s01r1b01; cat /tmp/s01r1b01.standa | mkdef -z; rm -rf /tmp/s01r1b01.standa;else rmdef s01r1b01; fi
check:rc==0
cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts
cmd:yes|cp -rf /etc/hosts.bak /etc/hosts
cmd:rm -rf /etc/hosts.bak /etc/hosts.xcatbakautotest
end
start:makehosts_regex

View File

@ -286,6 +286,7 @@ cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z
cmd:rm -f /tftpboot/petitboot/testnode1
cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99
check:rc==0
cmd:cp -f /etc/hosts /etc/hosts.bak
cmd:cp -f /etc/hosts /etc/hosts.xcattestbak
cmd:echo "10.1.1.200 testnode1" >> /etc/hosts
cmd:makedns -n
@ -311,7 +312,8 @@ check:rc!=0
#check:rc!=0
cmd:chdef -t node -o testnode1 ip=
check:rc==0
cmd:sed -i /testnode1/d /etc/hosts
cmd:sed -i /testnode1/d /etc/hosts.xcattestbak
cmd:yes|cp -rf /etc/hosts.xcattestbak /etc/hosts
cmd:getent hosts testnode1 | grep testnode1
check:rc!=0
cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute
@ -319,8 +321,9 @@ check:rc!=0
cmd:noderm testnode1
cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute"
cmd:rm -rf /install/rhels7.99
cmd:cp -f /etc/hosts.xcattestbak /etc/hosts
cmd:yes|cp -f /etc/hosts.bak /etc/hosts
cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi
cmd:rm -rf /etc/hosts.xcattestbak /etc/hosts.bak
end
start:nodeset_yaboot

View File

@ -235,7 +235,7 @@ check:rc==0
cmd:if grep Ubuntu /etc/*release;then if [ ! -e /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz ]; then copycds $$ISO;mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/;touch /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz;fi;fi
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==0
cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="<user_password>" -v tail="</user_password>" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi
cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="<user_password>" -v tail="</user_password>" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;elif grep "CentOS Linux" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi
#cmd:grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd
check:rc==0
cmd:diff /tmp/tmpcryptedpasswd /tmp/instcryptedpasswd

View File

@ -54,14 +54,15 @@ description: psh -i interface CN 'uptime' in linux
label:others,parallel_cmds
os:Linux
cmd:cp /etc/hosts /etc/hostsBK
cmd:cp /etc/hosts /etc/hosts.bak
check:rc==0
cmd:grep $$CN /etc/hosts
cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hosts';psh -i $interface $$CN 'uptime'
cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hostsBK';yes|cp -rf /etc/hostsBK /etc/hosts;psh -i $interface $$CN 'uptime'
check:output=~$$CN
check:rc==0
cmd:grep $$CN /etc/hosts
cmd:rm -rf /etc/hosts
cmd:cp /etc/hostsBK /etc/hosts
cmd:yes|cp -rf /etc/hosts.bak /etc/hosts
check:rc==0
cmd:rm -rf /etc/hostsBK /etc/hosts.bak
end