]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Update detail reader test to verify enumerated attributes are read
authorNick Porter <nick@portercomputing.co.uk>
Fri, 1 Mar 2024 12:25:33 +0000 (12:25 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 1 Mar 2024 12:25:33 +0000 (12:25 +0000)
src/tests/detail/all.mk
src/tests/detail/config/radiusd.conf
src/tests/detail/one.txt

index 53b4db40d9465fa8f394a0f290c44caaea7e5618..9057fd154f7885e3b2dc064775a2fce35a50273f 100644 (file)
@@ -19,11 +19,17 @@ $(OUTPUT)/%: $(DIR)/% $(addprefix ${BUILD_DIR}/lib/,proto_detail.la proto_detail
        $(eval DIR := $(dir $<))
        ${Q}echo "DETAIL $(notdir $<)"
        ${Q}cp $< $(dir $@)/detail.txt
+       ${Q}rm -f $(dir $@)/processed
        ${Q}if ! $(TEST_BIN)/radiusd -d $(DIR)/config -D ${top_srcdir}/share/dictionary -X > $@.log; then \
                tail $@.log; \
                echo "cp $< $(dir $@)/detail.txt; $(TEST_BIN)/radiusd -d $(DIR)/config -D ${top_srcdir}/share/dictionary -X "; \
                exit 1; \
        fi
+       ${Q}if [ ! -e $(dir $@)/processed ] ; then \
+               tail $@.log; \
+               echo "Processing $< failed to produce expected output $(dir $@)/processed"; \
+               exit 1; \
+       fi
        ${Q}touch $@
 
 .NO_PARALLEL: $(TEST)
index 7522602f22a3f71ceb6d44918e83f51ce30f21f4..e32291b9b4823dbda6916e2456531a4885256f11 100644 (file)
@@ -55,6 +55,10 @@ modules {
        always updated {
                rcode = updated
        }
+
+       detail {
+               filename = ${output}/processed
+       }
 }
 
 server default {
@@ -80,6 +84,9 @@ server default {
        }
 
        recv Accounting-Request {
+               if (&Acct-Status-Type == Start) {
+                       detail
+               }
                ok
        }
 
index ab1f25f693de8b6519dc6b71534ca3a99ddecb8e..f955bcbc1d8efb4f969990a7d9f8f0141b88a179 100644 (file)
@@ -5,4 +5,5 @@ Tue Sep 13 16:24:27 2011
        NAS-Port-Type = Wireless-802.16
        Calling-Station-Id = "0123456789"
        Acct-Unique-Session-Id = "ed8119f6919c6f6f"
+       Acct-Status-Type = Start
        Timestamp = 1554226681