Blame tests/p_freeradius/radiusd_test.sh
|
Christoph Galuschka |
d240c8 |
#!/bin/sh
|
|
Christoph Galuschka |
d240c8 |
# Author: Christoph Galuschka <christoph.galuschka@tiwag.at>
|
|
Athmane Madjoudj |
6284d9 |
# Athmane Madjodj <athmanem@gmail.com>
|
|
Christoph Galuschka |
d240c8 |
|
|
Christoph Galuschka |
d240c8 |
t_Log "Running $0 - freeradius-access test"
|
|
Christoph Galuschka |
d240c8 |
|
|
Christoph Galuschka |
d240c8 |
t_InstallPackage freeradius-utils
|
|
Christoph Galuschka |
d240c8 |
|
|
Athmane Madjoudj |
6284d9 |
if (t_GetPkgRel basesystem | grep -q el6)
|
|
Athmane Madjoudj |
6284d9 |
then
|
|
Athmane Madjoudj |
6284d9 |
# Make Backup of /etc/raddb/users and add testuser steve
|
|
Athmane Madjoudj |
6284d9 |
/bin/cp /etc/raddb/users /etc/raddb/users.orig
|
|
Athmane Madjoudj |
6284d9 |
echo 'steve Cleartext-Password := "centos"' >> /etc/raddb/users
|
|
Athmane Madjoudj |
6284d9 |
echo ' Service-Type = Framed-User,' >> /etc/raddb/users
|
|
Christoph Galuschka |
d240c8 |
|
|
Athmane Madjoudj |
6284d9 |
# Restart Service
|
|
Athmane Madjoudj |
6284d9 |
service radiusd restart
|
|
Christoph Galuschka |
d240c8 |
|
|
Athmane Madjoudj |
6284d9 |
#Run test
|
|
Athmane Madjoudj |
6284d9 |
WORKING=$(radtest -d /etc/raddb -x steve centos 127.0.0.1:1812 1 testing123 |grep -c 'Access-Accept')
|
|
Athmane Madjoudj |
6284d9 |
if [ $WORKING == 1 ]; then ret_val=0 ; fi
|
|
Christoph Galuschka |
d240c8 |
|
|
Athmane Madjoudj |
6284d9 |
# Restore settings
|
|
Athmane Madjoudj |
6284d9 |
/bin/cp /etc/raddb/users.orig /etc/raddb/users
|
|
Christoph Galuschka |
d240c8 |
service radiusd restart
|
|
Christoph Galuschka |
d240c8 |
|
|
Athmane Madjoudj |
6284d9 |
t_CheckExitStatus $ret_val
|
|
Athmane Madjoudj |
6284d9 |
else
|
|
Athmane Madjoudj |
6284d9 |
# TODO: fix the test on C5
|
|
Athmane Madjoudj |
6284d9 |
t_Log "Test skipped on CentOS 5"
|
|
Athmane Madjoudj |
6284d9 |
t_CheckExitStatus 0
|
|
Athmane Madjoudj |
6284d9 |
fi
|