--- /dev/null
+#
+# Unit tests for the detail file reader.
+#
+
+#
+# Test name
+#
+TEST := test.detail
+FILES := $(subst $(DIR)/,,$(wildcard $(DIR)/*.txt))
+
+$(eval $(call TEST_BOOTSTRAP))
+
+#
+# Run the radclient commands against the radiusd.
+#
+$(OUTPUT)/%: $(DIR)/%
+ $(eval DIR := $(dir $<))
+ ${Q}echo "DETAIL $(notdir $<)"
+ ${Q}cp $< $(dir $@)/detail.txt
+ ${Q}if ! $(TEST_BIN)/radiusd -d $(DIR)/config -D ${top_srcdir}/share/dictionary -X > $@; then \
+ tail $@; \
+ echo "cp $< $(dir $@)/detail.txt; $(TEST_BIN)/radiusd -d $(DIR)/config -D ${top_srcdir}/share/dictionary -X "; \
+ exit 1; \
+ fi
+
+.NO_PARALLEL: $(TEST)
+$(TEST):
+ @touch $(BUILD_DIR)/tests/$@
--- /dev/null
+# -*- text -*-
+#
+# test configuration file. Do not install.
+#
+# $Id$
+#
+
+#
+# Minimal radiusd.conf for testing
+#
+
+output = build/tests/detail
+
+run_dir = ${output}
+raddb = raddb
+pidfile = ${run_dir}/radiusd.pid
+panic_action = "gdb -batch -x src/tests/panic.gdb %e %p > ${run_dir}/gdb.log 2>&1; cat ${run_dir}/gdb.log"
+
+maindir = ${raddb}
+radacctdir = ${run_dir}/radacct
+modconfdir = ${maindir}/mods-config
+certdir = ${maindir}/certs
+cadir = ${maindir}/certs
+
+client localhost {
+ ipaddr = 127.0.0.1
+ secret = testing123
+}
+
+modules {
+ always reject {
+ rcode = reject
+ }
+ always fail {
+ rcode = fail
+ }
+ always ok {
+ rcode = ok
+ }
+ always handled {
+ rcode = handled
+ }
+ always invalid {
+ rcode = invalid
+ }
+ always disallow {
+ rcode = disallow
+ }
+ always notfound {
+ rcode = notfound
+ }
+ always noop {
+ rcode = noop
+ }
+ always updated {
+ rcode = updated
+ }
+}
+
+server default {
+ namespace = radius
+
+ listen detail {
+ type = Accounting-Request
+
+ proto = detail
+
+ exit_when_done = yes
+
+ file {
+ filename = ${output}/detail*
+ immediate = yes
+ }
+
+ work {
+ filename = ${output}/detail.work
+ track = yes
+ }
+
+ }
+
+ recv Accounting-Request {
+ ok
+ }
+
+ send Accounting-Response {
+ }
+
+}
--- /dev/null
+Tue Sep 13 16:24:27 2011
+ User-Name = "bob"
+ NAS-IP-Address = 10.10.0.179
+ NAS-Port = 0
+ NAS-Port-Type = Wireless-802.16
+ Calling-Station-Id = "0123456789"
+ Acct-Unique-Session-Id = "ed8119f6919c6f6f"
+ Timestamp = 1554226681