Blame tests/p_wget/wget_test.sh

Christoph Galuschka dc5f9b
#!/bin/sh
Christoph Galuschka dc5f9b
# Author: Athmane Madjoudj <athmanem@gmail.com>
Christoph Galuschka dc5f9b
# Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka dc5f9b
Christoph Galuschka dc5f9b
t_Log "Running $0 - wget can access http-host and download index.html."
Christoph Galuschka dc5f9b
FILE=/var/tmp/index.html
Christoph Galuschka dc5f9b
Christoph Galuschka cb7ef3
Karanbir Singh 23b6ba
if [ $SKIP_QA_HARNESS -eq 1 ]; then
2789f9
  CHECK_FOR="timestamp"
d05719
  URL="http://mirror.centos.org/"
Christoph Galuschka dc5f9b
else
b3e6ea
  CHECK_FOR="CentOS"
db9377
  URL="http://repo.centos.qa/srv/CentOS/"
Christoph Galuschka dc5f9b
fi
Christoph Galuschka dc5f9b
avij ea49f9
t_Log "Querying ${URL}"
db9377
wget -q --output-document=${FILE} ${URL}
Christoph Galuschka dc5f9b
grep -q "${CHECK_FOR}" ${FILE}
Christoph Galuschka dc5f9b
ret_val=$?
Christoph Galuschka dc5f9b
Christoph Galuschka dc5f9b
/bin/rm ${FILE}
Christoph Galuschka dc5f9b
t_CheckExitStatus $ret_val