From 6daf8d4a1bfc3d81c1bdb9d054ee9da356dff803 Mon Sep 17 00:00:00 2001 From: root Date: Jul 22 2012 12:18:09 +0000 Subject: LFTP test committed --- diff --git a/tests/p_0-lftp/0_install_lftp.sh b/tests/p_0-lftp/0_install_lftp.sh new file mode 100755 index 0000000..1ad1b27 --- /dev/null +++ b/tests/p_0-lftp/0_install_lftp.sh @@ -0,0 +1,2 @@ +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 new file mode 100755 index 0000000..40d7b0e --- /dev/null +++ b/tests/p_0-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_0-lftp/20_lftp_ftp.sh b/tests/p_0-lftp/20_lftp_ftp.sh new file mode 100755 index 0000000..e7ce4a0 --- /dev/null +++ b/tests/p_0-lftp/20_lftp_ftp.sh @@ -0,0 +1,22 @@ +#!/bin/sh +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