From: Alan T. DeKok Date: Wed, 13 Mar 2024 13:52:27 +0000 (-0400) Subject: add docs for coa test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d08065d35e64a262f9200bd03741cd529a303a22;p=thirdparty%2Ffreeradius-server.git add docs for coa test --- diff --git a/src/tests/radclient/coa/README.md b/src/tests/radclient/coa/README.md new file mode 100644 index 00000000000..33d546111d7 --- /dev/null +++ b/src/tests/radclient/coa/README.md @@ -0,0 +1,27 @@ +# Running Receive CoA with radclient + +It's a bit messed up. + +Edit `raddb/sites-enabled/default`, and change the `recv Access-Request` section: + +``` +recv Access-Request { + if (&User-Name == "coa") { + &Reply-Message := %exec('./build/make/jlibtool', '--mode=execute', './build/bin/local/radclient', '-d', 'raddb/', '-D', 'share/dictionary/', '-xx', '-t', '2', '-F', '-f', 'src/tests/radclient/coa/server_coa.txt,src/tests/radclient/exec/server_coa_reply.txt', 'localhost:37990', 'coa', 'testing123') + accept + } + ... +``` + +Then in one terminal window, run the server from the top source directory: + +``` +./scripts/bin/radiusd -sf -xx -l stdout +``` + + +Then in another terminal window, run radclient from the top source directory: + +``` +COA=src/tests/radclient/coa ./scripts/bin/radclient -xx -c 1 -F -o 37990 -A User-Name -f ${COA}/packet.txt,${COA}/reply.txt,${COA}/coa_reply.txt,${COA}/coa.txt localhost auth testing123 +``` \ No newline at end of file diff --git a/src/tests/radclient/coa/coa.txt b/src/tests/radclient/coa/coa.txt new file mode 100644 index 00000000000..77e57631dea --- /dev/null +++ b/src/tests/radclient/coa/coa.txt @@ -0,0 +1 @@ +User-Name == "coa" diff --git a/src/tests/radclient/coa/coa_reply.txt b/src/tests/radclient/coa/coa_reply.txt new file mode 100644 index 00000000000..c3a71977ad0 --- /dev/null +++ b/src/tests/radclient/coa/coa_reply.txt @@ -0,0 +1 @@ +Packet-Type = CoA-ACK diff --git a/src/tests/radclient/coa/packet.txt b/src/tests/radclient/coa/packet.txt new file mode 100644 index 00000000000..798ffc4a834 --- /dev/null +++ b/src/tests/radclient/coa/packet.txt @@ -0,0 +1,3 @@ +Packet-Type = Access-Request +User-Name = "coa", +User-Password = "hello" diff --git a/src/tests/radclient/coa/reply.txt b/src/tests/radclient/coa/reply.txt new file mode 100644 index 00000000000..755497aacdc --- /dev/null +++ b/src/tests/radclient/coa/reply.txt @@ -0,0 +1 @@ +Packet-Type == Access-Accept diff --git a/src/tests/radclient/coa/server_coa.txt b/src/tests/radclient/coa/server_coa.txt new file mode 100644 index 00000000000..446900a552b --- /dev/null +++ b/src/tests/radclient/coa/server_coa.txt @@ -0,0 +1 @@ +User-Name = "coa" diff --git a/src/tests/radclient/coa/server_coa_reply.txt b/src/tests/radclient/coa/server_coa_reply.txt new file mode 100644 index 00000000000..b4ca1e1e9f6 --- /dev/null +++ b/src/tests/radclient/coa/server_coa_reply.txt @@ -0,0 +1 @@ +Packet-Type == CoA-ACK