From: Alan T. DeKok Date: Fri, 6 May 2011 12:32:12 +0000 (+0200) Subject: Add EAP tests to automated test suite X-Git-Tag: release_2_1_11~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dbd8df166a60ad44fb6a149cdaf28a8e6b711faa;p=thirdparty%2Ffreeradius-server.git Add EAP tests to automated test suite --- diff --git a/src/tests/Makefile b/src/tests/Makefile index cb43cb0b2e6..e85139bb02f 100644 --- a/src/tests/Makefile +++ b/src/tests/Makefile @@ -18,7 +18,8 @@ ACCTPORT = $(shell expr $(PORT) + 1) EAPOL_TEST = eapol_test -EAP_TLS_TESTS = eap-ttls-pap.conf eap-ttls-mschapv2.conf peap-mschapv2.conf +EAP_TLS_TESTS = eap-ttls-pap.conf eap-mschapv2.conf \ + eap-ttls-mschapv2.conf peap-mschapv2.conf SECRET = testing123 @@ -77,10 +78,18 @@ tests: ../../raddb/test.conf radiusd.kill @$(MAKE) radiusd.kill @rm -f ../../raddb/test.conf +tests.eap: ../../raddb/test.conf radiusd.kill + @chmod a+x runtests.sh + @rm -f radius.log + @$(MAKE) radiusd.pid + @$(MAKE) eap + @$(MAKE) radiusd.kill + @rm -f ../../raddb/test.conf + eap: $(EAP_TLS_TESTS) - $(EAPOL_TEST) -c eap-ttls-pap.conf -s $(SECRET) - $(EAPOL_TEST) -c peap-mschapv2.conf -s $(SECRET) - $(EAPOL_TEST) -c eap-ttls-mschapv2.conf -s $(SECRET) + for x in $(EAP_TLS_TESTS); do \ + $(EAPOL_TEST) -c $$x -p $(PORT) -s $(SECRET); \ + done md5: $(EAPOL_TEST) -c eap-md5.conf -s $(SECRET) diff --git a/src/tests/eap-mschapv2.conf b/src/tests/eap-mschapv2.conf index 9e8826e1d60..d9e41825b23 100644 --- a/src/tests/eap-mschapv2.conf +++ b/src/tests/eap-mschapv2.conf @@ -6,5 +6,5 @@ network={ key_mgmt=WPA-EAP eap=MSCHAPV2 identity="bob" - password="hello" + password="bob" } diff --git a/src/tests/eap-ttls-pap.conf b/src/tests/eap-ttls-pap.conf index 8def76325e3..459fbbe521e 100644 --- a/src/tests/eap-ttls-pap.conf +++ b/src/tests/eap-ttls-pap.conf @@ -2,7 +2,6 @@ # eapol_test -c eap-ttls-pap.conf -s testing123 # network={ - ssid="example" key_mgmt=WPA-EAP eap=TTLS identity="bob" diff --git a/src/tests/mschapv1 b/src/tests/mschapv1 index f2592b8a71a..338bf8ae8d6 100644 --- a/src/tests/mschapv1 +++ b/src/tests/mschapv1 @@ -9,6 +9,8 @@ # MS-MPPE-Encryption-Policy = 0x00000001 # MS-MPPE-Encryption-Types = 0x00000006 # +# NT Hash hash = 0x9a936faf344359a0f1e3c9b5585b9f1f +# User-Name = "bob", MS-CHAP-Challenge = 0xb9634adc358b2ab3, MS-CHAP-Response = 0xb9010000000000000000000000000000000000000000000000007a42408782f745ef90a86fd21b0d9294132750f4af66a419 diff --git a/src/tests/peap-mschapv2.conf b/src/tests/peap-mschapv2.conf index 0b7b38007d8..1bb6c807b92 100644 --- a/src/tests/peap-mschapv2.conf +++ b/src/tests/peap-mschapv2.conf @@ -9,4 +9,5 @@ network={ anonymous_identity="anonymous" password="bob" phase2="auth=MSCHAPV2" + phase1="peapver=0" } diff --git a/src/tests/runtests.sh b/src/tests/runtests.sh old mode 100644 new mode 100755 index cb13ea51726..17cbd2a9162 --- a/src/tests/runtests.sh +++ b/src/tests/runtests.sh @@ -2,6 +2,7 @@ PORT=12340 HOME_PORT=12350 +SECRET=testing123 rm -f verbose.log RCODE=0 @@ -43,7 +44,7 @@ do echo "-f .cache/$x" >> .bar done -../main/radclient `cat .bar` -xFd . 127.0.0.1:$PORT auth testing123 > radclient.log 2>&1 +../main/radclient `cat .bar` -xFd . 127.0.0.1:$PORT auth $SECRET > radclient.log 2>&1 for x in `cat .foo` do