]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
check that unit_test_module can send CoA-Request packets
authorAlan T. DeKok <aland@freeradius.org>
Sat, 30 May 2020 15:15:30 +0000 (11:15 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 30 May 2020 15:33:38 +0000 (11:33 -0400)
src/tests/bin/unit_test_module
src/tests/bin/unit_test_module.conf [new file with mode: 0644]

index d856057b6e883fcdb943a2926681d96ec457d9dc..ef5b47b9b9fa395610f39111f4069264745cb9dd 100755 (executable)
@@ -3,3 +3,16 @@
 . src/tests/bin/lib.sh
 
 do_test $TESTBIN/unit_test_module -h
+
+do_test $TESTBIN/unit_test_module -d src/tests/bin/ -D $DICT_DIR -xx -i - <<EOF
+User-Name = bob
+
+Packet-Type = Access-Accept
+EOF
+
+do_test $TESTBIN/unit_test_module -d src/tests/bin/ -D $DICT_DIR -xx -i - <<EOF
+Packet-Type = CoA-Request,
+User-Name = bob
+
+Packet-Type = CoA-ACK
+EOF
diff --git a/src/tests/bin/unit_test_module.conf b/src/tests/bin/unit_test_module.conf
new file mode 100644 (file)
index 0000000..a734581
--- /dev/null
@@ -0,0 +1,27 @@
+#
+#  This is a minimal configuration for RADIUS
+#
+modules {
+       always ok {
+               rcode = ok
+       }
+}
+
+server default {
+       namespace = radius
+
+       listen {
+               type = Access-Request
+               type = CoA-Request
+       }
+
+       recv Access-Request {
+               update control {
+                       &Auth-Type := accept
+               }
+       }
+
+       recv CoA-Request {
+               ok
+       }
+}