Blame tests/p_lftp/10_lftp_http_test.sh

root 6daf8d
#!/bin/sh
root 6daf8d
# Author: Piyush Kumar <piykumar@gmail.com>
root 6daf8d
# Author: Munish Kumar <munishktotech@gmail.com>
root 6daf8d
# Author: Ayush Gupta <ayush.001@gmail.com>
root 6daf8d
# Author: Konark Modi <modi.konark@gmail.com>
root 6daf8d
root 6daf8d
t_Log "Running $0 - lftp: HTTP test"
root 6daf8d
if [ $SKIP_QA_HARNESS ]; then
root 6daf8d
CHECK_FOR="UTC"
root 6daf8d
URL="http://mirror.centos.org/centos//timestamp.txt"
root 6daf8d
else
root 6daf8d
CHECK_FOR="UTC"
root 6daf8d
URL="http://mirror.centos.org/centos//timestamp.txt"
root 6daf8d
fi
root 6daf8d
root 6daf8d
t_Log "Querying ${URL}"
root 6daf8d
root 6daf8d
lftp << EOF
root 6daf8d
pget -n 5 ${URL}
root 6daf8d
bye
root 6daf8d
EOF
root 6daf8d
root 6daf8d
grep -q "${CHECK_FOR}" timestamp.txt
root 6daf8d
ret_val=$?
root 6daf8d
rm timestamp.txt
root 6daf8d
t_CheckExitStatus $ret_val