From e521ad12d3dc67ed3f50d431ffc99eb17ff23ccb Mon Sep 17 00:00:00 2001 From: Karanbir Singh Date: Jul 22 2012 14:52:44 +0000 Subject: move lftp tests into place --- diff --git a/tests/p_0-lftp/0_install_lftp.sh b/tests/p_0-lftp/0_install_lftp.sh deleted file mode 100755 index 724e4bf..0000000 --- a/tests/p_0-lftp/0_install_lftp.sh +++ /dev/null @@ -1,7 +0,0 @@ -# Author: Piyush Kumar -# Author: Munish Kumar -# Author: Ayush Gupta -# Author: Konark Modi - -t_Log "Running $0 -installing lftp." -t_InstallPackage lftp diff --git a/tests/p_0-lftp/10_lftp_http_test.sh b/tests/p_0-lftp/10_lftp_http_test.sh deleted file mode 100755 index 40d7b0e..0000000 --- a/tests/p_0-lftp/10_lftp_http_test.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Author: Piyush Kumar -# Author: Munish Kumar -# Author: Ayush Gupta -# Author: Konark Modi - -t_Log "Running $0 - lftp: HTTP test" -if [ $SKIP_QA_HARNESS ]; then -CHECK_FOR="UTC" -URL="http://mirror.centos.org/centos//timestamp.txt" -else -CHECK_FOR="UTC" -URL="http://mirror.centos.org/centos//timestamp.txt" -fi - -t_Log "Querying ${URL}" - -lftp << EOF -pget -n 5 ${URL} -bye -EOF - -grep -q "${CHECK_FOR}" timestamp.txt -ret_val=$? -rm timestamp.txt -t_CheckExitStatus $ret_val diff --git a/tests/p_0-lftp/20_lftp_ftp.sh b/tests/p_0-lftp/20_lftp_ftp.sh deleted file mode 100755 index eedce86..0000000 --- a/tests/p_0-lftp/20_lftp_ftp.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# Author: Piyush Kumar -# Author: Munish Kumar -# Author: Ayush Gupta -# Author: Konark Modi -FILE=/tmp/test_lftp_ftp.txt - -if [ $SKIP_QA_HARNESS ]; then -URL="ftp://ftp.freebsd.org/pub/FreeBSD/" -else -URL="ftp://ftp.freebsd.org/pub/FreeBSD/" -fi - - -lftp -e 'set net:timeout 10; get README.TXT -o $FILE; bye' $URL > /dev/null 2>&1 -t_Log "Running $0 - lftp test with FTP test." -if [ -f $FILE ] - then - grep -ci 'konark' $FILE - ret_val=$? - else - t_Log "FTP test for lftp failed" - ret_val=$? -fi -rm -f $FILE -t_CheckExitStatus $ret_val diff --git a/tests/p_lftp/0_install_lftp.sh b/tests/p_lftp/0_install_lftp.sh new file mode 100755 index 0000000..724e4bf --- /dev/null +++ b/tests/p_lftp/0_install_lftp.sh @@ -0,0 +1,7 @@ +# Author: Piyush Kumar +# Author: Munish Kumar +# Author: Ayush Gupta +# Author: Konark Modi + +t_Log "Running $0 -installing lftp." +t_InstallPackage lftp diff --git a/tests/p_lftp/10_lftp_http_test.sh b/tests/p_lftp/10_lftp_http_test.sh new file mode 100755 index 0000000..40d7b0e --- /dev/null +++ b/tests/p_lftp/10_lftp_http_test.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Author: Piyush Kumar +# Author: Munish Kumar +# Author: Ayush Gupta +# Author: Konark Modi + +t_Log "Running $0 - lftp: HTTP test" +if [ $SKIP_QA_HARNESS ]; then +CHECK_FOR="UTC" +URL="http://mirror.centos.org/centos//timestamp.txt" +else +CHECK_FOR="UTC" +URL="http://mirror.centos.org/centos//timestamp.txt" +fi + +t_Log "Querying ${URL}" + +lftp << EOF +pget -n 5 ${URL} +bye +EOF + +grep -q "${CHECK_FOR}" timestamp.txt +ret_val=$? +rm timestamp.txt +t_CheckExitStatus $ret_val diff --git a/tests/p_lftp/20_lftp_ftp.sh b/tests/p_lftp/20_lftp_ftp.sh new file mode 100755 index 0000000..eedce86 --- /dev/null +++ b/tests/p_lftp/20_lftp_ftp.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# Author: Piyush Kumar +# Author: Munish Kumar +# Author: Ayush Gupta +# Author: Konark Modi +FILE=/tmp/test_lftp_ftp.txt + +if [ $SKIP_QA_HARNESS ]; then +URL="ftp://ftp.freebsd.org/pub/FreeBSD/" +else +URL="ftp://ftp.freebsd.org/pub/FreeBSD/" +fi + + +lftp -e 'set net:timeout 10; get README.TXT -o $FILE; bye' $URL > /dev/null 2>&1 +t_Log "Running $0 - lftp test with FTP test." +if [ -f $FILE ] + then + grep -ci 'konark' $FILE + ret_val=$? + else + t_Log "FTP test for lftp failed" + ret_val=$? +fi +rm -f $FILE +t_CheckExitStatus $ret_val