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
Christoph Galuschka dc5f9b
  HOST=wiki.centos.org
Christoph Galuschka dc5f9b
  CHECK_FOR="FrontPage - CentOS Wiki"
Christoph Galuschka dc5f9b
else
Christoph Galuschka dc5f9b
  HOST=repo.centos.qa
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}"
Christoph Galuschka dc5f9b
wget -q --output-document=${FILE} http://${HOST}/
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