From dc5f9b270fef092dbbb2976c0e1c88a22cee6762 Mon Sep 17 00:00:00 2001 From: Christoph Galuschka Date: Dec 03 2011 16:16:15 +0000 Subject: new test for wget --- diff --git a/tests/p_php/01_prep.sh b/tests/p_php/01_prep.sh deleted file mode 100755 index d8b2af9..0000000 --- a/tests/p_php/01_prep.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -t_Log "Running $0 - attempting to install php-cli." -t_InstallPackage php-cli - diff --git a/tests/p_rsync/0-install-rsync.sh b/tests/p_rsync/0-install-rsync.sh new file mode 100755 index 0000000..f0efada --- /dev/null +++ b/tests/p_rsync/0-install-rsync.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# Author: Christoph Galuschka + +t_Log "Running $0 - installing rsync and xinetd." +t_InstallPackage xinetd rsync + +# enable rsync in /etc/xinet.d/rsync +sed -i 's/\(disable\s*=\ \)yes/\1no/' /etc/xinetd.d/rsync + +# Restart in case previous tests allready installed xinetd +t_ServiceControl xinetd restart diff --git a/tests/p_rsync/10-rsync-test.sh b/tests/p_rsync/10-rsync-test.sh new file mode 100755 index 0000000..1d8cb64 --- /dev/null +++ b/tests/p_rsync/10-rsync-test.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - rsync function test." + +# Comparing hostname with output of phpinfo() +FILE='/var/tmp/rsync-test' + +cat > $FILE < +# Christoph Galuschka + +t_Log "$0 - installing wget" +t_InstallPackage wget diff --git a/tests/p_wget/wget_test.sh b/tests/p_wget/wget_test.sh new file mode 100755 index 0000000..4edc011 --- /dev/null +++ b/tests/p_wget/wget_test.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Christoph Galuschka + +t_Log "Running $0 - wget can access http-host and download index.html." +SKIP_QA_HARNESS=1 +FILE=/var/tmp/index.html + +if [ $SKIP_QA_HARNESS ]; then + HOST=wiki.centos.org + CHECK_FOR="FrontPage - CentOS Wiki" +else + HOST=repo.centos.qa + # athmane: could you please insert something here that is returned from qa-host + CHECK_FOR="ks_cfg" +fi + +t_Log "Querying http://${HOST}" +wget -q --output-document=${FILE} http://${HOST}/ +grep -q "${CHECK_FOR}" ${FILE} +ret_val=$? + +/bin/rm ${FILE} +t_CheckExitStatus $ret_val