From f29110e24e097c8d722555abf429162b87d9510e Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Fri, 20 May 2016 05:28:58 -0400 Subject: [PATCH] complete --- .../get_install_disk/fresh_install_test | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 xCAT-test/autotest/testcase/get_install_disk/fresh_install_test diff --git a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_test b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_test new file mode 100644 index 000000000..8112af7aa --- /dev/null +++ b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_test @@ -0,0 +1,72 @@ +start:fresh_install_disk +os:Linux + +cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" +cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi +check:rc=0 +cmd:makedns -n +check:rc==0 +cmd:makeconservercf +check:rc==0 +cmd:cat /etc/conserver.cf | grep $$CN +check:output=~$$CN +cmd:sleep 20 +cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:makedhcp -a +check:rc==0 +cmd:sleep 10 +cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.leases|grep $$CN;elif cat /etc/*release |grep "Red Hat" >/dev/null;then cat /var/lib/dhcpd/dhcpd.leases|grep $$CN;fi +check:output=~$$CN + +cmd:if cat /etc/*release |grep "7.2" |grep "Red Hat">/dev/null;then mkdef $$STATELITE -u profile=compute provmethod=statelite osvers=rhels7.2;else mkdef $$STATELITE -u profile=compute provmethod=statelite; fi +cmd:chdef $$CN status= +check:rc==0 +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:lsdef $$CN |grep provmethod +check:rc==0 +check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +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 +check:rc==0 + +cmd:sleep 600 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 30;((a++));if [ $a -gt 100 ];then break;fi done + +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted +cmd:xdsh $$CN date +check:rc==0 +check:output=~\d\d:\d\d:\d\d +cmd:xdsh $$CN mount +check:rc==0 +cmd:sleep 120 +cmd:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +cmd:xdsh $$CN "cat /proc/partitions" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_log_$$NO +cmd:xdsh $$CN "cat /etc/*release" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_log_$$NO +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log | grep get_install_disk" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_log_$$NO +cmd:xdsh $$CN "scp /var/log/xcat/xcat.log root@$$MN:/tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO" +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "disk_wwn=" +check:output=~0x500a0751036d9e61 +check:output=~0x500a0751036d9e83 +check:output=~0x500a0751036d9e7a +check:output=~0x500a0751036d9c24 +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "into wwn secondchoicedisks" +check:output=~sda 0x500a0751036d9e61 +check:output=~sdb 0x500a0751036d9c24 +check:output=~sdc 0x500a0751036d9e7a +check:output=~sdd 0x500a0751036d9e83 +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "by sorting wwn and DRIVER" +check:output=~sdb +end