Better test harness using virtual servers
[freeradius.git] / src / tests / Makefile
1 include ../../Make.inc
2
3 TESTS   = user_password chap mschapv1 digest-auth-MD5 digest-auth-int \
4         digest-auth-noalgo digest-md5-sess digest-auth-MD5_Sess \
5         digest-auth_int-MD5 digest-auth_int-MD5_Sess digest-auth_int-noalgo
6
7 #       example.com stripped.example.com
8
9 EAPOL_TEST = ~/src/wpa_supplicant-0.5.8/eapol_test
10
11 EAP_TLS_TESTS = eap-ttls-pap.conf eap-ttls-mschapv2.conf peap-mschapv2.conf
12
13 SECRET  = testing123
14
15 .PHONY: all eap test.conf dictionary clean
16
17 #
18 #       Build the directory for testing the server
19 #
20 all: tests
21
22 clean:
23         @rm -f ../../raddb/test.conf test.conf dictionary
24
25 test.conf:
26         @echo "# test configuration file.  Do not install.  Delete at any time." > test.conf
27         @echo "libdir =" $(top_builddir)/src/modules/lib >> test.conf
28         @echo "dictionary =" $(top_builddir)/src/tests/ >> test.conf
29         @echo "testdir =" $(top_builddir)/src/tests/ >> test.conf
30         @echo '$$INCLUDE radiusd.conf' >> test.conf
31         @echo '$$INCLUDE $${testdir}/config/' >> test.conf
32         @[ -f ../../raddb/test.conf ] || ln -s ../src/tests/test.conf ../../raddb/
33
34 dictionary:
35         @echo '$$INCLUDE ' $(top_builddir)/share/dictionary > dictionary
36         @echo '$$INCLUDE ' $(top_builddir)/src/tests/dictionary.test >> dictionary
37
38 tests: test.conf dictionary
39         @chmod a+x runtests.sh
40         ./runtests.sh $(TESTS)
41
42 eap: $(EAP_TLS_TESTS)
43         $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET) 
44         $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET)
45         $(EAPOL_TEST) -c eap-ttls-mschapv2.conf -s $(SECRET)
46
47 md5:
48         $(EAPOL_TEST) -c eap-md5.conf -s $(SECRET) 
49
50
51 tls:
52         $(EAPOL_TEST) -c eap-ttls-tls.conf -s $(SECRET)
53
54 ttls:
55         $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET)
56
57 peap:
58         $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET)
59
60 leap:
61         $(EAPOL_TEST) -c leap.conf -s $(SECRET)
62
63
64 10k:
65         ../main/radclient -qc 10000 -d ../../share -f user_password localhost auth testing123
66
67 one:
68         ../main/radclient -xxxxc 1 -d ../../share -f user_password localhost:32000 auth testing123