From 50b37d4a27d3295a29afca2286f1a5a086142cec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 11:49:46 +0200 Subject: Adding upstream version 3.2.1+dfsg. Signed-off-by: Daniel Baumann --- src/tests/modules/preprocess/all.mk | 3 +++ src/tests/modules/preprocess/hints | 2 ++ src/tests/modules/preprocess/huntgroups | 0 src/tests/modules/preprocess/module.conf | 4 ++++ src/tests/modules/preprocess/xlat.attrs | 12 ++++++++++++ src/tests/modules/preprocess/xlat.unlang | 14 ++++++++++++++ 6 files changed, 35 insertions(+) create mode 100644 src/tests/modules/preprocess/all.mk create mode 100644 src/tests/modules/preprocess/hints create mode 100644 src/tests/modules/preprocess/huntgroups create mode 100644 src/tests/modules/preprocess/module.conf create mode 100644 src/tests/modules/preprocess/xlat.attrs create mode 100644 src/tests/modules/preprocess/xlat.unlang (limited to 'src/tests/modules/preprocess') diff --git a/src/tests/modules/preprocess/all.mk b/src/tests/modules/preprocess/all.mk new file mode 100644 index 0000000..5cfad60 --- /dev/null +++ b/src/tests/modules/preprocess/all.mk @@ -0,0 +1,3 @@ +# +# Test the "preprocess" module +# diff --git a/src/tests/modules/preprocess/hints b/src/tests/modules/preprocess/hints new file mode 100644 index 0000000..14ceafc --- /dev/null +++ b/src/tests/modules/preprocess/hints @@ -0,0 +1,2 @@ +DEFAULT + Calling-Station-Id := "%{User-Name}@%{NAS-IP-Address}" diff --git a/src/tests/modules/preprocess/huntgroups b/src/tests/modules/preprocess/huntgroups new file mode 100644 index 0000000..e69de29 diff --git a/src/tests/modules/preprocess/module.conf b/src/tests/modules/preprocess/module.conf new file mode 100644 index 0000000..7c51fa6 --- /dev/null +++ b/src/tests/modules/preprocess/module.conf @@ -0,0 +1,4 @@ +preprocess { + hints = $ENV{MODULE_TEST_DIR}/hints + huntgroups = $ENV{MODULE_TEST_DIR}/huntgroups +} diff --git a/src/tests/modules/preprocess/xlat.attrs b/src/tests/modules/preprocess/xlat.attrs new file mode 100644 index 0000000..e7170d1 --- /dev/null +++ b/src/tests/modules/preprocess/xlat.attrs @@ -0,0 +1,12 @@ +# +# Input packet +# +User-Name = "bob" +User-Password = "bob" +NAS-IP-Address = 127.0.0.1 + +# +# Expected answer +# +Response-Packet-Type == Access-Accept +Filter-Id == 'success' diff --git a/src/tests/modules/preprocess/xlat.unlang b/src/tests/modules/preprocess/xlat.unlang new file mode 100644 index 0000000..da53982 --- /dev/null +++ b/src/tests/modules/preprocess/xlat.unlang @@ -0,0 +1,14 @@ +# +# Run the preprocess module +# +preprocess + +if (Calling-Station-Id == "bob@127.0.0.1") { + update reply { + Filter-Id := "success" + } +} + +update control { + Cleartext-Password := "%{User-Name}" +} -- cgit v1.2.3