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 dc5f9b
if [ $SKIP_QA_HARNESS ]; then
c89712
  URL=http://wiki.centos.org/
Christoph Galuschka dc5f9b
  CHECK_FOR="FrontPage - CentOS Wiki"
Christoph Galuschka dc5f9b
else
c89712
  URL=http://repo.centos.qa/srv/CentOS/
Christoph Galuschka dc5f9b
  # athmane: could you please insert something here that is returned from qa-host
a069bd
  CHECK_FOR="CentOS"
Christoph Galuschka dc5f9b
fi
Christoph Galuschka dc5f9b
Christoph Galuschka dc5f9b
t_Log "Querying http://${HOST}"
c89712
wget -q --output-document=${FILE} http://${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