#!/bin/sh set -e cp debian/tests/rlm_python3-data/python3.mods-available \ /etc/freeradius/3.0/mods-available/python3 cp debian/tests/rlm_python3-data/python3.sites-available \ /etc/freeradius/3.0/sites-available/python3-test cp debian/tests/rlm_python3-data/ubuntu_example.py.mods-config \ /etc/freeradius/3.0/mods-config/python3/ubuntu_example.py # enable our python3 test site ln -sf /etc/freeradius/3.0/sites-available/python3-test \ /etc/freeradius/3.0/sites-enabled # enable the python3 module ln -sf /etc/freeradius/3.0/mods-available/python3 \ /etc/freeradius/3.0/mods-enabled # restart service freeradius restart echo "Test that \"ubuntu\" can login with any password" result=0 output=$(radtest ubuntu anypass$$ 127.0.0.1:1234 0 testing123) || result=$? if [ ${result} -ne 0 ]; then echo "Failed. Output:" echo "${output}" exit 1 else echo "${output}" | grep "Reply-Message" fi echo "Test that any other user won't work" result=0 output=$(radtest otheruser$$ secret$$ 127.0.0.1:1234 0 testing123 2>&1) || result=$? echo "${output}" | grep "Reply-Message" if [ ${result} -eq 0 ]; then echo "This shouldn't have worked..." echo "Output:" echo "${output}" exit 1 fi