diff --git a/tests/p_freeradius/radiusd_test.sh b/tests/p_freeradius/radiusd_test.sh index fd1487b..057933c 100755 --- a/tests/p_freeradius/radiusd_test.sh +++ b/tests/p_freeradius/radiusd_test.sh @@ -21,9 +21,9 @@ service radiusd restart #Run test - t_Log "Running Test" - echo "User-Name=steve,Password=centos " | radclient -x localhost:1812 auth testing123 |grep -qc 'Access-Accept' - ret_val=$? +t_Log "Running Test" +echo "User-Name=steve,Password=centos " | radclient -x localhost:1812 auth testing123 |grep -qc 'Access-Accept' +ret_val=$? # Restore settings /bin/cp /etc/raddb/users.orig /etc/raddb/users 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_php/0_install_php-cli.sh b/tests/p_php/0_install_php-cli.sh new file mode 100755 index 0000000..24a93ff --- /dev/null +++ b/tests/p_php/0_install_php-cli.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# Author: Christoph Galuschka <christoph.galuschka@chello.at> + +t_Log "Running $0 - attempting to install php-cli." +t_InstallPackage php-cli + diff --git a/tests/p_php/20-php-mysql-test.sh b/tests/p_php/20-php-mysql-test.sh index 9f6510f..55d5c11 100755 --- a/tests/p_php/20-php-mysql-test.sh +++ b/tests/p_php/20-php-mysql-test.sh @@ -16,6 +16,7 @@ t_ServiceControl mysqld start >/dev/null 2>&1 CREATE='/var/tmp/mysql-php-QA.sql' cat >$CREATE <<EOF +drop database if exists phptests; create database phptests; use phptests; create table tests (name varchar(20)) ; 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 <christoph.galuschka@chello.at> + +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..9da8039 --- /dev/null +++ b/tests/p_rsync/10-rsync-test.sh @@ -0,0 +1,42 @@ +#!/bin/sh +# Author: Athmane Madjoudj <athmanem@gmail.com> +# Author: Christoph Galuschka <christoph.galuschka@chello.at> + +t_Log "Running $0 - rsyncd can rsync from/to local machine." + +# create settings to run test + +PATH2FILE='/var/tmp' +FILE='rsync-test' +cat > $PATH2FILE/$FILE <<EOF +Testing rsync +EOF + +cat > /etc/rsyncd.conf <<EOF +gid = root +uid = root +read only = true +use chroot = true +log file = /var/log/rsyncd.log +pid file = /var/run/rsyncd.pid +hosts allow = 127.0.0.1 +[centos-test] + path = $PATH2FILE + list = yes + exclude = * + include = $FILE +EOF + +t_ServiceControl xinetd restart + +# Trying to rsync +rsync --recursive --verbose --include=$FILE --exclude=* rsync://127.0.0.1/centos-test /var/log/ + +t_CheckExitStatus $? + +#reversing changes +/bin/rm $PATH2FILE/$FILE +/bin/rm /etc/rsyncd.conf +/bin/rm /var/log/$FILE + +t_ServiceControl xinetd restart diff --git a/tests/p_tcpdump/tcpdump_eth0.sh b/tests/p_tcpdump/tcpdump_eth0.sh index 5c01c91..3ed6dc7 100755 --- a/tests/p_tcpdump/tcpdump_eth0.sh +++ b/tests/p_tcpdump/tcpdump_eth0.sh @@ -32,7 +32,7 @@ if [[ $IP =~ $regex ]] ret_val=1 fi else - t_Log "Found Default-GW - skiping test" + t_Log "No Default-GW found - skiping test" ret_val=0 fi # Remove file afterwards diff --git a/tests/p_tcpdump/tcpdump_lo_ipv6.sh b/tests/p_tcpdump/tcpdump_lo_ipv6.sh index 29aa4f3..25be92e 100755 --- a/tests/p_tcpdump/tcpdump_lo_ipv6.sh +++ b/tests/p_tcpdump/tcpdump_lo_ipv6.sh @@ -4,7 +4,7 @@ t_Log "Running $0 - TCPdump test IPv6 to lo" -# Grabing IPv6 address of lo to checl if IPv6 is enabled +# Grabing IPv6 address of lo to check if IPv6 is enabled IP=$(ip addr list lo | grep 'inet6 ') regex='\t*inet6\ (.*)\/.*' if [[ $IP =~ $regex ]] diff --git a/tests/p_wget/0-install_wget.sh b/tests/p_wget/0-install_wget.sh new file mode 100755 index 0000000..1bd8eea --- /dev/null +++ b/tests/p_wget/0-install_wget.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Author: Athmane Madjoudj <athmanem@gmail.com> +# Christoph Galuschka <christoph.galuschka@chello.at> + +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 <athmanem@gmail.com> +# Christoph Galuschka <christoph.galuschka@chello.at> + +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