From: Arran Cudbard-Bell Date: Wed, 20 Jan 2021 18:31:00 +0000 (+0000) Subject: Add DHCPv6 test server X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=314ac1c1fabbcf275dd788857df53ac6fde4547c;p=thirdparty%2Ffreeradius-server.git Add DHCPv6 test server --- diff --git a/src/tests/keywords/dhcpv6.conf b/src/tests/keywords/dhcpv6.conf new file mode 100644 index 00000000000..07a12bc97c7 --- /dev/null +++ b/src/tests/keywords/dhcpv6.conf @@ -0,0 +1,117 @@ + +modules { + $INCLUDE ${raddb}/mods-enabled/always + + $INCLUDE ${raddb}/mods-enabled/expr + + $INCLUDE ${raddb}/mods-enabled/escape + + delay reschedule { + force_reschedule = yes + } + + delay delay_10s { + delay = 10 + } + + unpack { + + } + +} + +policy { + # + # Outputs the contents of the control list in debugging (-X) mode + # + debug_control { + if("%{debug_attr:control[*]}" == '') { + noop + } + } + + # + # Outputs the contents of the request list in debugging (-X) mode + # + debug_request { + if("%{debug_attr:request[*]}" == '') { + noop + } + } + + # + # Outputs the contents of the reply list in debugging (-X) mode + # + debug_reply { + if("%{debug_attr:reply[*]}" == '') { + noop + } + } + + # + # Outputs the contents of the main lists in debugging (-X) mode + # + debug_all { + debug_control + debug_request + debug_reply + } + + # + # Set the test to successful, but only if there are no failures. + # + success { + if (!&reply.Result-Status) { + update reply { + &Result-Status := "success" + } + } + + if (&parent.request.User-Name && !&parent.reply.Result-Status) { + update parent.reply { + &Result-Status := "success" + } + } + } + + test_fail { + update reply { + &Result-Status += "Failure in test at line %{interpreter:...line}" + } + + if (&parent.request.User-Name) { + update parent.reply { + &Result-Status += "Failure in test at line %{interpreter:...line}" + } + } + } +} + +instantiate { + # + # Just check that this can be referred to as "virtual_instantiate.post-auth" + # + load-balance virtual_instantiate { + ok + ok + } +} + +# +# Virtual server for the DHCPv6 protocol. +# +server default { + namespace = dhcpv6 + + listen { + type = Solicit + } + + recv Solicit { + # + # Include the test file specified by the + # KEYWORD environment variable. + # + $INCLUDE ${keyword}/$ENV{KEYWORD} + } +}