diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 09:49:47 +0000 |
commit | b486f33989b6fa5fd31509219f0c1e55a2dc7db3 (patch) | |
tree | 62b4ab75fb48b8aa9472b4ceee53943d2443ffb2 /debian/tests/rlm_python3-test | |
parent | Adding upstream version 3.2.1+dfsg. (diff) | |
download | freeradius-b486f33989b6fa5fd31509219f0c1e55a2dc7db3.tar.xz freeradius-b486f33989b6fa5fd31509219f0c1e55a2dc7db3.zip |
Adding debian version 3.2.1+dfsg-4+deb12u1.debian/3.2.1+dfsg-4+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | debian/tests/rlm_python3-test | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/tests/rlm_python3-test b/debian/tests/rlm_python3-test new file mode 100644 index 0000000..ddf0982 --- /dev/null +++ b/debian/tests/rlm_python3-test @@ -0,0 +1,43 @@ +#!/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 +systemctl restart freeradius.service + +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 |