From f55ba5c860de8c8981cbece3c53115cc76658f30 Mon Sep 17 00:00:00 2001 From: caomengmeng Date: Mon, 13 Jun 2016 05:24:20 -0400 Subject: [PATCH] updated --- ...{fresh_install_test => fresh_install_disk} | 1 + .../testcase/get_install_disk/reinstall_disk | 93 +++++++++++++++++++ 2 files changed, 94 insertions(+) rename xCAT-test/autotest/testcase/get_install_disk/{fresh_install_test => fresh_install_disk} (96%) create mode 100644 xCAT-test/autotest/testcase/get_install_disk/reinstall_disk diff --git a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_test b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk similarity index 96% rename from xCAT-test/autotest/testcase/get_install_disk/fresh_install_test rename to xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk index 8112af7aa..888e8fece 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_test +++ b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk @@ -1,5 +1,6 @@ start:fresh_install_disk os:Linux +description:check fresh install disk, usded for x86 multi disk only, and not check RH7.2 for RH os wwn isue. 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" diff --git a/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk new file mode 100644 index 000000000..b9fb12825 --- /dev/null +++ b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk @@ -0,0 +1,93 @@ +start:reinstall_disk +os:Linux +description:check reinstall disk, usded for x86 multi disk only, and not check RH7.2 for RH os wwn isue. + +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: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:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted + +cmd:xdsh $$CN "scp /var/log/xcat/xcat.log root@$$MN:/tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_before_re_$$NO" +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "by sorting wwn and DRIVER" +check:output=~sdb + +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: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:lsdef -l $$CN | grep status +check:rc==0 +check:output=~booted + +md:ping $$CN -c 3 +check:rc==0 +check:output=~64 bytes from $$CN +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:xdsh $$CN "cat /proc/partitions" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__re_log_$$NO +cmd:xdsh $$CN "cat /etc/*release" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__re_log_$$NO +cmd:xdsh $$CN "cat /var/log/xcat/xcat.log | grep get_install_disk" >> /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__re_log_$$NO +cmd:xdsh $$CN "scp /var/log/xcat/xcat.log root@$$MN:/tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__re_$$NO" + +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "partition" +check:output=~Check the partition sdb1 +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "The disks which have kernel" +check:output=~The disks which have kernel +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "The disk sdb information" +check:output=~The disk sdb information +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "disk_wwn=" +check:output=~0x500a0751036d9c24 +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "into wwn" +check:output=~sdb 0x500a0751036d9c24 into wwn +cmd:cat /tmp/__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__fr_$$NO | grep "by sorting wwn and DRIVER" +check:output=~sdb + +end