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
CHECK_FOR="CentOS"
Christoph Galuschka cb7ef3
Christoph Galuschka dc5f9b
if [ $SKIP_QA_HARNESS ]; then
db9377
  URL="http://wiki.centos.org/"
Christoph Galuschka dc5f9b
else
db9377
  URL="http://repo.centos.qa/srv/CentOS/"
Christoph Galuschka dc5f9b
fi
Christoph Galuschka dc5f9b
Christoph Galuschka dc5f9b
t_Log "Querying http://${HOST}"
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