diff --git a/xCAT-test/autotest/testcase/httpport/cases0 b/xCAT-test/autotest/testcase/httpport/cases0 index cc6b768d4..dcca66bfb 100644 --- a/xCAT-test/autotest/testcase/httpport/cases0 +++ b/xCAT-test/autotest/testcase/httpport/cases0 @@ -13,9 +13,69 @@ check:rc==0 cmd:lsdef -t site -i httpport -c check:output =~ 8898 check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64le" ]]; then arch=ppc64; else arch=__GETNODEATTR($$CN,arch)__;fi; mknb $arch +cmd:dir="/tftpboot/pxelinux.cfg/p";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:mknb ppc64 check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/httpport/check_wget_files.sh /tftpboot/pxelinux.cfg/p/ 8898 +cmd: #!/bin/bash +# get all filename in specified path +path=/tftpboot/pxelinux.cfg/p/ +files=$(ls $path) +for filename in $files +do + echo "The file is $filename" + grep 8898 $path$filename + if [ $? != 0 ];then + echo "port 8898 does not exist" + exit 1; + fi + links=$(grep 8898 $path$filename|awk -F " " '{print $2}') + for link in $links + do + wget $link + if [ $? != 0 ];then + echo "wget file $link failed" + exit 1; + else + echo "wget file $link succeed" + fi + done +done +check:rc==0 +cmd:dir="/tftpboot/xcat/xnba/nets";if [ -e "${dir}" ];then mv ${dir} ${dir}".bak"; fi +cmd:mknb x86_64 +check:rc==0 +cmd:#!/bin/bash +# get all filename in specified path +path=/tftpboot/xcat/xnba/nets/ +rm -rf $path*.uefi +rm -rf $path*.elilo +files=$(ls $path) +mnip=$(tabdump site |grep -w master |awk -F "," '{print $2}'|sed 's/\"//g') +echo "The mn ip is $mnip" +for filename in $files +do + echo "The file is $filename" + grep 8898 $path$filename + if [ $? != 0 ];then + echo "port 8898 does not exist" + exit 1; + fi + grep "next-server" $path$filename + if [ $? == 0 ];then + sed -i "s/\${next-server}/$mnip/g" $path$filename + fi + links=$(grep 8898 $path$filename|awk -F " " '{print $4}') + for link in $links + do + wget $link + if [ $? != 0 ];then + echo "wget file $link failed" + exit 1; + else + echo "wget file $link succeed" + fi + done +done check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/httpport/change_http_port.sh 8898 80 cmd:netstat -nlp|grep -E "apache2|httpd" @@ -26,4 +86,6 @@ check:rc==0 cmd:lsdef -t site -i httpport -c check:output =~ 80 check:rc==0 +cmd:dir="/tftpboot/pxelinux.cfg/p"; rm -rf $dir; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi +cmd:dir="/tftpboot/xcat/xnba/nets"; rm -rf $dir; if [ -d ${dir}".bak" ];then mv ${dir}".bak" $dir; fi end diff --git a/xCAT-test/autotest/testcase/httpport/check_wget_files.sh b/xCAT-test/autotest/testcase/httpport/check_wget_files.sh deleted file mode 100755 index 6ffd76af7..000000000 --- a/xCAT-test/autotest/testcase/httpport/check_wget_files.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# get all filename in specified path -path=$1 -files=$(ls $path) -for filename in $files -do - echo "The file is $filename" - grep $2 $path$filename - if [ $? != 0 ];then - echo "port $2 does not exist" - exit 1; - fi - links=$(grep $2 $path$filename|awk -F " " '{print $2}') - for link in $links - do - wget $link - if [ $? != 0 ];then - echo "wget file $link failed" - exit 1; - else - echo "wget file $link succeed" - fi - done -done