xref: /openbmc/openbmc/meta-openembedded/meta-perl/recipes-perl/libauthen/libauthen-radius-perl/run-ptest (revision 15ae2509e522678e761046cdb8693291c09cf78c)
1*15ae2509SBrad Bishop#!/bin/sh
2*15ae2509SBrad Bishop#
3*15ae2509SBrad Bishop
4*15ae2509SBrad Bishop# prepare testing config
5*15ae2509SBrad BishopCONF_USERS=`readlink -f /etc/raddb/users`
6*15ae2509SBrad Bishopmv ${CONF_USERS} ${CONF_USERS}_orig
7*15ae2509SBrad Bishopecho "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS}
8*15ae2509SBrad Bishopcat ${CONF_USERS}_orig >> ${CONF_USERS}
9*15ae2509SBrad Bishop
10*15ae2509SBrad Bishop# restart radiusd server
11*15ae2509SBrad Bishopsystemctl restart radiusd || /etc/init.d/radiusd restart || {
12*15ae2509SBrad Bishop        echo "FAIL: Start radiusd service."
13*15ae2509SBrad Bishop        exit 1
14*15ae2509SBrad Bishop}
15*15ae2509SBrad Bishop
16*15ae2509SBrad Bishop# run teests
17*15ae2509SBrad Bishopperl test.pl
18*15ae2509SBrad Bishop
19*15ae2509SBrad Bishop# restore the config and restart
20*15ae2509SBrad Bishopmv ${CONF_USERS}_orig ${CONF_USERS}
21*15ae2509SBrad Bishopsystemctl restart radiusd || /etc/init.d/radiusd restart
22