#!/bin/sh # # prepare testing config CONF_USERS=`readlink -f /etc/raddb/users` mv ${CONF_USERS} ${CONF_USERS}_orig echo "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS} cat ${CONF_USERS}_orig >> ${CONF_USERS} # restart radiusd server systemctl restart radiusd || /etc/init.d/radiusd restart || { echo "FAIL: Start radiusd service." exit 1 } # run tests # FIXME: this is from ptest-perl.bbclass and might not be correct for case in `find t -type f -name '*.t'`; do perl $case >$case.output 2>&1 ret=$? cat $case.output if [ $ret -ne 0 ]; then echo "FAIL: ${case%.t}" elif grep -i 'SKIP' $case.output; then echo "SKIP: ${case%.t}" else echo "PASS: ${case%.t}" fi rm -f $case.output done # restore the config and restart mv ${CONF_USERS}_orig ${CONF_USERS} systemctl restart radiusd || /etc/init.d/radiusd restart