diff --git a/AUTHORS b/AUTHORS index 5f0c14e..17c1a51 100644 --- a/AUTHORS +++ b/AUTHORS @@ -5,3 +5,4 @@ Fabian Arrotin Athmane Madjoudj Steve Barnes Johnny Hughes +Christoph Galuschka diff --git a/tests/0_common/00_qa_repo_config.sh b/tests/0_common/00_qa_repo_config.sh index dbcd609..3122697 100755 --- a/tests/0_common/00_qa_repo_config.sh +++ b/tests/0_common/00_qa_repo_config.sh @@ -17,28 +17,28 @@ cat << EOF > /etc/yum.repos.d/CentOS-QA.repo [QA-base] name=CentOS-\$releasever - OS baseurl=http://repo.centos.qa/srv/CentOS/\$releasever/os/\$basearch/ -gpgcheck=0 +gpgcheck=1 enabled=1 igpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-\$releasever [QA-updates] name=CentOS-\$releasever - Updates baseurl=http://repo.centos.qa/srv/CentOS/\$releasever/updates/\$basearch/ -gpgcheck=0 +gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-\$releasever [QA-extras] name=CentOS-\$releasever - Extras baseurl=http://repo.centos.qa/srv/CentOS/\$releasever/extras/\$basearch/ -gpgcheck=0 +gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-\$releasever [qa-centosplus] name=CentOS-\$releasever - CentOSPlus baseurl=http://repo.centos.qa/srv/CentOS/\$releasever/centosplus/\$basearch/ -gpgcheck=0 +gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-\$releasever diff --git a/tests/p_freeradius/0-install_freeradius.sh b/tests/p_freeradius/0-install_freeradius.sh new file mode 100755 index 0000000..39103ed --- /dev/null +++ b/tests/p_freeradius/0-install_freeradius.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Author: Christoph Galuschka + +# Install freeradius +# On C5 both freeradius and freeradius2 are provided, however only freeradius2-utils are provided as well +# so we will install freeradius2 on C5 and freeradius (being freeradius2) on C6 +if (t_GetPkgRel basesystem | grep -q el6) +then + #Install Freeradius (V2) + t_InstallPackage freeradius +else + #Install Freeradius2 + t_InstallPackage freeradius2 +fi + +# activate at boot +chkconfig radiusd on +# start daemon with default settings +if (t_GetPkgRel basesystem | grep -q el6) +then + t_ServiceControl radiusd start +else + # C5 has an eap-setting in radiusd.conf and 3 "sites-available" which prevent successfull start (probably missing some dep) + # as the basic test works without these, the eap setting 2 sites-available will be removed for the test and later restored + sed -i 's/.*INCLUDE\ eap\.conf/# INCLUDE eap.conf/g' /etc/raddb/radiusd.conf + rm -rf /etc/raddb/sites-enabled/control-socket + rm -rf /etc/raddb/sites-enabled/inner-tunnel + # /etc/raddb/sites-configured will be changed to remove all traces of eap + /bin/cp -a /etc/raddb/sites-available/default /etc/raddb/sites-available/default.orig + head -n 138 /etc/raddb/sites-available/default.orig | grep -v eap > /etc/raddb/sites-available/default + tail -n 416 /etc/raddb/sites-available/default.orig | grep -v eap >> /etc/raddb/sites-available/default + sed -i 's/.*ok\ \=\ return/# ok = return/g' /etc/raddb/sites-available/default + t_ServiceControl radiusd start +fi + diff --git a/tests/p_freeradius/radiusd_test.sh b/tests/p_freeradius/radiusd_test.sh new file mode 100755 index 0000000..c810b2d --- /dev/null +++ b/tests/p_freeradius/radiusd_test.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# Author: Christoph Galuschka +# Athmane Madjodj + +t_Log "Running $0 - freeradius-access test" + +if (t_GetPkgRel basesystem | grep -q el6) + then + t_InstallPackage freeradius-utils +else + t_InstallPackage freeradius2-utils +fi + + # Make Backup of /etc/raddb/users and add testuser steve + /bin/cp /etc/raddb/users /etc/raddb/users.orig + echo 'steve Cleartext-Password := "centos"' >> /etc/raddb/users + echo ' Service-Type = Framed-User,' >> /etc/raddb/users + + # Restart Service + service radiusd restart + + #Run test, treat C6 and C5 differently + +if (t_GetPkgRel basesystem | grep -q el6) + then + t_Log "Running C6-Test" + WORKING=$(radtest -d /etc/raddb -x steve centos 127.0.0.1:1812 1 testing123 |grep -c 'Access-Accept') + if [ $WORKING == 1 ]; then ret_val=0 ; fi +else + t_Log "Running C5-Test" + WORKING=$(radtest steve centos 127.0.0.1:1812 1 testing123 |grep -c 'Access-Accept') + if [ $WORKING == 1 ]; then ret_val=0 ; fi +fi + # Restore settings + /bin/cp /etc/raddb/users.orig /etc/raddb/users + rm -rf /etc/raddb/users.orig + service radiusd restart +if (t_GetPkgRel basesystem | grep -q el5) + then + sed -i 's/#\ INCLUDE\ eap\.conf/\ \ INCLUDE eap.conf/g' /etc/raddb/radiusd.conf + ln -s /etc/raddb/sites-available/control-socket /etc/raddb/sites-enabled/ + ln -s /etc/raddb/sites-available/inner-tunnel /etc/raddb/sites-enabled/ + /bin/cp -a /etc/raddb/sites-available/default.orig /etc/raddb/sites-available/default + rm -rf /etc/raddb/sites-available/default.orig + service radiusd stop +fi + +t_CheckExitStatus $ret_val diff --git a/tests/p_net-snmp/snmp_test.sh b/tests/p_net-snmp/snmp_test.sh deleted file mode 100755 index eb42841..0000000 --- a/tests/p_net-snmp/snmp_test.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Author: Athmane Madjoudj - -t_Log "Running $0 - snmp test" - -t_InstallPackage net-snmp-utils - -snmpwalk -v 1 -c public 127.0.0.1 > /dev/null 2>&1 - -t_CheckExitStatus $? diff --git a/tests/p_net-snmp/snmpv1_test.sh b/tests/p_net-snmp/snmpv1_test.sh new file mode 100755 index 0000000..8931d71 --- /dev/null +++ b/tests/p_net-snmp/snmpv1_test.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# Author: Athmane Madjoudj + +t_Log "Running $0 - snmpv1 test" + +t_InstallPackage net-snmp-utils + +snmpwalk -v 1 -c public 127.0.0.1 > /dev/null 2>&1 + +t_CheckExitStatus $? diff --git a/tests/p_net-snmp/snmpv2c_test.sh b/tests/p_net-snmp/snmpv2c_test.sh new file mode 100755 index 0000000..26b49c5 --- /dev/null +++ b/tests/p_net-snmp/snmpv2c_test.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - snmpv2c test" + +t_InstallPackage net-snmp-utils + +snmpwalk -v 2c -c public 127.0.0.1 > /dev/null 2>&1 + +t_CheckExitStatus $? diff --git a/tests/p_net-snmp/snmpv3_test.sh b/tests/p_net-snmp/snmpv3_test.sh new file mode 100755 index 0000000..1c27351 --- /dev/null +++ b/tests/p_net-snmp/snmpv3_test.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# Author: Athmane Madjoudj +# Author: Christoph Galuschka + +t_Log "Running $0 - snmpv3 test" + +t_InstallPackage net-snmp-utils + +# Make Backup of snmpd.conf and add V3-settings +/bin/cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.orig +echo 'rouser centosro' >> /etc/snmp/snmpd.conf +echo 'createUser centosro MD5 centosro DES centosro' >> /etc/snmp/snmpd.conf + +# Restart Service +service snmpd restart + +#Run test +snmpget -v 3 -u centosro -n "" -l authPriv -a MD5 -A centosro -x DES -X centosro 127.0.0.1 sysUpTime.0 > /dev/null 2>&1 +ret_val=$? + +# Restore settings +/bin/cp /etc/snmp/snmpd.conf.orig /etc/snmp/snmpd.conf +service snmpd restart + +t_CheckExitStatus $ret_val