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>
Christoph Galuschka 89571c
# 	  Christoph Galuschka <christoph.galuschka@chello.at>
root 6daf8d
root 6daf8d
t_Log "Running $0 - lftp: HTTP test"
Christoph Galuschka 917e7a
Karanbir Singh 23b6ba
if [ $SKIP_QA_HARNESS -eq 1 ]; then
Christoph Galuschka 89571c
  CHECK_FOR="UTC"
Christoph Galuschka 89571c
  URL="http://mirror.centos.org/"
Christoph Galuschka 89571c
  FILE="timestamp.txt"
root 6daf8d
else
Christoph Galuschka 89571c
  CHECK_FOR="CentOS"
Christoph Galuschka 756218
  ARCH=$(t_GetArch)
Christoph Galuschka 917e7a
  if [ $ARCH == "i686" ]; then
Christoph Galuschka 917e7a
    URL="http://repo.centos.qa/srv/CentOS/6/os/i386/"
Christoph Galuschka 917e7a
  else
Christoph Galuschka 917e7a
    URL="http://repo.centos.qa/srv/CentOS/6/os/x86_64/"
Christoph Galuschka 917e7a
  fi
Christoph Galuschka 89571c
  FILE="RELEASE-NOTES-en-US.html"
root 6daf8d
fi
root 6daf8d
Christoph Galuschka 89571c
t_Log "Querying ${URL}${FILE}"
root 6daf8d
Christoph Galuschka 89571c
lftp <
Christoph Galuschka 89571c
pget -n 5 ${URL}${FILE}
root 6daf8d
bye
root 6daf8d
EOF
root 6daf8d
Christoph Galuschka 89571c
grep -q "${CHECK_FOR}" ${FILE}
Christoph Galuschka 89571c
t_CheckExitStatus $?
Christoph Galuschka 89571c
Christoph Galuschka 89571c
/bin/rm ${FILE}