3 ## Makefile -- Build and run tests for the server.
5 ## http://www.freeradius.org/
11 TESTS = user_password chap mschapv1 digest-auth-MD5 digest-auth-int \
12 digest-auth-noalgo digest-md5-sess digest-auth-MD5_Sess \
13 digest-auth_int-MD5 digest-auth_int-MD5_Sess digest-auth_int-noalgo
17 # example.com stripped.example.com
19 EAPOL_TEST = eapol_test
21 EAP_TLS_TESTS = eap-ttls-pap.conf eap-ttls-mschapv2.conf peap-mschapv2.conf
25 .PHONY: all eap dictionary clean
28 # Build the directory for testing the server
33 @rm -f ../../raddb/test.conf test.conf dictionary
36 @echo "# test dictionary not install. Delete at any time." > dictionary
37 @echo '$$INCLUDE ' $(top_builddir)/share/dictionary >> dictionary
38 @echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> dictionary
41 @echo "# test configuration file. Do not install. Delete at any time." > test.conf
42 @echo "libdir =" $(top_builddir)/src/modules/lib >> test.conf
43 @echo "testdir =" $(top_builddir)/src/tests/ >> test.conf
44 @echo 'dictionary = $${testdir}' >> test.conf
45 @echo 'logdir = $${testdir}' >> test.conf
46 @echo 'pidfile = $${testdir}/radiusd.pid' >> test.conf
47 @echo '$$INCLUDE radiusd.conf' >> test.conf
48 @echo '$$INCLUDE $${testdir}/config/' >> test.conf
50 radiusd.pid: test.conf
51 @../main/radiusd -md ../../raddb/ -n test -i 127.0.0.1 -p $(PORT)
53 # We can't make this depend on radiusd.pid, because then make will create
54 # radiusd.pid when we make radiusd.kill, which we don't want.
57 @if [ -f radiusd.pid ]; then \
58 (kill -TERM `cat radiusd.pid` >/dev/null 2>&1) || exit 0; \
62 # Link from the main database directory to here
63 ../../raddb/test.conf: test.conf
64 @[ -f ../../raddb/test.conf ] || ln -s ../src/tests/test.conf ../../raddb/
66 # kill the server (if it's running)
70 # remove the changes to raddb/
71 tests: ../../raddb/test.conf radiusd.kill radiusd.pid
72 @chmod a+x runtests.sh
74 @./runtests.sh $(TESTS)
76 @rm -f ../../raddb/test.conf
79 $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET)
80 $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET)
81 $(EAPOL_TEST) -c eap-ttls-mschapv2.conf -s $(SECRET)
84 $(EAPOL_TEST) -c eap-md5.conf -s $(SECRET)
87 $(EAPOL_TEST) -c eap-ttls-tls.conf -s $(SECRET)
90 $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET)
93 $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET)
96 $(EAPOL_TEST) -c leap.conf -s $(SECRET)