2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-31 10:06:39 +00:00

update confignetwork cases according to comments

This commit is contained in:
litingt@cn.ibm.com 2017-06-21 04:35:47 -04:00
parent fac7d28f3f
commit dad84e8820

View File

@ -1,5 +1,5 @@
start: confignetwork_s_installnic_diskful
description: this case is to test confignetwork -s could config installnic successfully in diskful provision.
description: this case is to test confignetwork -s could configure installnic successfully in diskful provision.
cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi
cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN
check:rc==0
@ -16,16 +16,12 @@ cmd:makedhcp -n
check:rc==0
cmd:makedhcp -a
check:rc==0
cmd:sleep 10
cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done
cmd:copycds $$ISO
check:rc==0
cmd:chdef $$CN postscripts="confignetwork -s"
check:rc==0
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==0
cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
check:rc==0
cmd:sleep 300
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done
@ -44,7 +40,7 @@ check:rc==0
end
start:confignetwork_s_installnic_diskless
description: this case is to test confignetwork -s could config installnic successfully in diskless provision.
description: this case is to test confignetwork -s could configure installnic successfully in diskless provision.
cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN
check:rc==0
cmd:chdef -t node -o $$CN postbootscripts="confignetwork -s"
@ -74,7 +70,7 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput
check:rc==0
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
check:rc==0
cmd:sleep 900
cmd:sleep 180
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done
cmd:ping $$CN -c 3
check:rc==0
@ -86,7 +82,7 @@ cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{pr
check:rc==0
check:output=~__GETNODEATTR($$CN,ip)__
check:output!~dhcp
cmd:chdef -m -t node $$CN postscripts="confignetwork -s"
cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s"
check:rc==0
cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi
end
@ -126,7 +122,7 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput
check:rc==0
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
check:rc==0
cmd:sleep 900
cmd:sleep 180
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done
cmd:ping $$CN -c 3
check:rc==0
@ -142,18 +138,23 @@ cmd:secondarynic=`xdsh $$CN ip addr |grep 100.1.0.100|awk -F " " '{print $NF}'`;
check:rc==0
check:output=~100.1.0.100
check:output!~dhcp
cmd:chdef -m -t node $$CN postscripts="confignetwork -s"
cmd:chdef -m -t node $$CN postbootscripts="confignetwork -s"
check:rc==0
cmd:if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi
cmd:rmdef -t network -o 100_1_0_0-255_255_0_0
cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC=
check:rc==0
end
start:confignetwork_secondarynic_updatenode
description: this case is to test confignetwork could config secondarynic successfully with updatenode.
description: this case is to test confignetwork could configure secondarynic successfully with updatenode.
cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi
check:rc==0
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1501
cmd:xdsh $$CN "mkdir -p /tmp/backupnet/"
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1496
check:rc==0
cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0
check:rc==0
@ -161,20 +162,28 @@ cmd:chdef -t node -o $$CN postscripts="confignetwork"
check:rc==0
cmd:updatenode $$CN -P confignetwork
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces";else echo "Sorry,this is not supported os"; fi
cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi
check:output=~11.1.0.100
check:output=~MTU=1501
check:output=~MTU=1496
cmd:rmdef -t network -o 11_1_0_0-255_255_0_0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/backupnet/"
check:rc==0
end
start: confignetwork_secondarynic_nicaliases_updatenode
description: this case is to test confignetwork could config secondarynic nicaliases successfully with updatenode.
cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi
check:rc==0
cmd:xdsh $$CN "mkdir -p /tmp/backupnet/"
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:cp -f /etc/hosts /etc/hosts.bak
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC
check:rc==0
@ -202,18 +211,26 @@ check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:mv -f /etc/hosts.bak /etc/hosts
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/backupnet/"
check:rc==0
end
start:confignetwork_secondarynic_nicextraparams_updatenode
description: this case is to test confignetwork could config secondarynic nicextraparams successfully with updatenode.
description: this case is to test confignetwork could configure secondarynic nicextraparams successfully with updatenode.
cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi
check:rc==0
cmd:xdsh $$CN "mkdir -p /tmp/backupnet/"
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:cp -f /etc/hosts /etc/hosts.bak
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC
check:rc==0
cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC
check:rc==0
cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2"
cmd:chdef $$CN nicips.$$SECONDNIC="11.1.0.100|12.1.0.100" nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0" nichostnamesuffixes.$$SECONDNIC="-$$SECONDNIC-1|-$$SECONDNIC-2" nicextraparams.$$SECONDNIC="CONNECTED_MODE=yes"
check:rc==0
cmd:makehosts $$CN
check:rc==0
@ -227,6 +244,7 @@ check:output=~11.1.0.100
check:output!~dhcp
cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi
check:output=~12.1.0.100
check:output=~CONNECTED_MODE=yes
check:output!~dhcp
cmd:rmdef -t network -o 11_1_0_0-255_255_0_0
cmd:rmdef -t network -o 12_1_0_0-255_255_0_0
@ -235,6 +253,10 @@ check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:mv -f /etc/hosts.bak /etc/hosts
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/backupnet/"
check:rc==0
end
start:confignetwork_secondarynic_nicnetworks_updatenode_false
@ -312,8 +334,6 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0
check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:chtab node=$$CN nics.disable=0
check:rc==0
end
start:confignetwork_disable_set_to_1
@ -336,8 +356,6 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0
check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:chtab node=$$CN nics.disable=0
check:rc==0
end
start:confignetwork_niccustomscripts
@ -350,7 +368,7 @@ cmd:chmod a+x /tmp/script1
check:rc==0
cmd:cp /tmp/script1 /install/postscripts
check:rc==0
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mut=1501
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC mut=1496
check:rc==0
cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicnetworks.$$SECONDNIC=11_1_0_0-255_255_0_0 niccustomscripts.$$SECONDNIC=script1
check:rc==0
@ -360,7 +378,7 @@ cmd:updatenode $$CN -P confignetwork
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi
check:output=~11.1.0.100
check:output=~MTU=1501
check:output=~MTU=1496
check:output!~dhcp
cmd:xdsh $$CN "cat /tmp/confignetwork_niccustomscript"
check:rc==0
@ -378,6 +396,10 @@ start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode
description:this case is to verify if confignetwork could config serveral nics' multiple value at the same time.
cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi
check:rc==0
cmd:xdsh $$CN "mkdir -p /tmp/backupnet/"
check:rc==0
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC
check:rc==0
cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC
@ -426,6 +448,10 @@ check:rc==0
cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi
check:rc==0
cmd:mv -f /etc/hosts.bak /etc/hosts
cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi
check:rc==0
cmd:xdsh $$CN "rm -rf /tmp/backupnet/"
check:rc==0
end
start:confignetwork_help
@ -436,11 +462,3 @@ check:rc==0
cmd:confignetworks --help
check:rc==0
#TODO help information is printed
end