bstinson / centos / t_functional

Forked from centos/t_functional 4 years ago
Clone

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
b3e6ea
  CHECK_FOR="CentOS"
Athmane Madjoudj 165bfc
  URL="http://ci.dev.centos.org/cstatic/"
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