CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue Jun 1 05:18:33 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Update test case. The state of IPCP and IPv6CP is Closed when those are disabled. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.32 src/tests/net/if_pppoe/t_pppoe.sh:1.33 --- src/tests/net/if_pppoe/t_pppoe.sh:1.32 Thu May 13 03:37:58 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Tue Jun 1 05:18:33 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.32 2021/05/13 03:37:58 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.33 2021/06/01 05:18:33 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -743,7 +743,7 @@ pppoe_params_body() atf_pppoectl pppoe0 noipv6cp atf_ifconfig pppoe0 up wait_for_opened "IPCP" - atf_check -s exit:0 -o match:'IPv6CP state: initial' \ + atf_check -s exit:0 -o match:'IPv6CP state: closed' \ -x "$HIJACKING pppoectl -dd pppoe0" atf_ifconfig pppoe0 down @@ -755,7 +755,7 @@ pppoe_params_body() atf_pppoectl pppoe0 noipcp ipv6cp atf_ifconfig pppoe0 up wait_for_opened "IPv6CP" - atf_check -s exit:0 -o match:'IPCP state: initial' \ + atf_check -s exit:0 -o match:'IPCP state: closed' \ -x "$HIJACKING pppoectl -dd pppoe0" }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue Jun 1 05:18:33 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Update test case. The state of IPCP and IPv6CP is Closed when those are disabled. To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Thu May 13 03:37:58 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix the wrong state check After disconnection from PPPoE server, the client waits for reconnection in initial state or reconnects in PADI state. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.31 src/tests/net/if_pppoe/t_pppoe.sh:1.32 --- src/tests/net/if_pppoe/t_pppoe.sh:1.31 Tue May 11 05:57:02 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Thu May 13 03:37:58 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.31 2021/05/11 05:57:02 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.32 2021/05/13 03:37:58 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -204,7 +204,8 @@ run_test() wait_for_disconnected atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping -c 1 -w $TIMEOUT $SERVER_IP - atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0" + atf_check -s exit:0 -o match:'(PADI sent)|(initial)' \ + -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER # test for reconnecting
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Thu May 13 03:37:58 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix the wrong state check After disconnection from PPPoE server, the client waits for reconnection in initial state or reconnects in PADI state. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue May 11 05:57:02 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add tests for "pppoectl {no}[ipcp|ipv6cp]" To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.30 src/tests/net/if_pppoe/t_pppoe.sh:1.31 --- src/tests/net/if_pppoe/t_pppoe.sh:1.30 Tue May 11 00:55:51 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Tue May 11 05:57:02 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.30 2021/05/11 00:55:51 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.31 2021/05/11 05:57:02 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -725,6 +725,37 @@ pppoe_params_body() -x "${dumpcmd} | grep PADR" atf_check -s exit:0 -o not-match:'\[AC-Name "ACNAME-TEST5\]"' -e ignore \ -x "${dumpcmd} | grep PADI" + + export RUMP_SERVER=$CLIENT + atf_ifconfig pppoe0 down + export RUMP_SERVER=$SERVER + wait_for_disconnected + + # ipcp & ipv6cp are enabled by default + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -o match:'ipcp: enable' \ + -x "$HIJACKING pppoectl pppoe0" + atf_check -s exit:0 -o match:'ipv6cp: enable' \ + -x "$HIJACKING pppoectl pppoe0" + + # ipcp enable & ipv6cp disable + atf_pppoectl pppoe0 noipv6cp + atf_ifconfig pppoe0 up + wait_for_opened "IPCP" + atf_check -s exit:0 -o match:'IPv6CP state: initial' \ + -x "$HIJACKING pppoectl -dd pppoe0" + + atf_ifconfig pppoe0 down + export RUMP_SERVER=$SERVER + wait_for_disconnected + + # ipcp disable & ipv6cp enable + export RUMP_SERVER=$CLIENT + atf_pppoectl pppoe0 noipcp ipv6cp + atf_ifconfig pppoe0 up + wait_for_opened "IPv6CP" + atf_check -s exit:0 -o match:'IPCP state: initial' \ + -x "$HIJACKING pppoectl -dd pppoe0" } pppoe_params_cleanup()
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue May 11 05:57:02 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add tests for "pppoectl {no}[ipcp|ipv6cp]" To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue May 11 00:55:51 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added missing '$' To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.29 src/tests/net/if_pppoe/t_pppoe.sh:1.30 --- src/tests/net/if_pppoe/t_pppoe.sh:1.29 Thu May 6 01:09:43 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Tue May 11 00:55:51 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.29 2021/05/06 01:09:43 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.30 2021/05/11 00:55:51 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -238,7 +238,7 @@ run_test() atf_ifconfig -w 10 atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0" - $DEBUG && HIJACKING pppoectl -d pppoe0 + $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER # test for invalid password
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Tue May 11 00:55:51 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added missing '$' To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Thu May 6 01:09:43 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added missing waiting for DAD completion To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Thu May 6 01:09:43 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added missing waiting for DAD completion To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.28 src/tests/net/if_pppoe/t_pppoe.sh:1.29 --- src/tests/net/if_pppoe/t_pppoe.sh:1.28 Fri Apr 23 03:41:55 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Thu May 6 01:09:43 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.28 2021/04/23 03:41:55 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.29 2021/05/06 01:09:43 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -760,6 +760,7 @@ pppoe_passiveauthproto() atf_ifconfig pppoe0 up $DEBUG && rump.ifconfig wait_for_opened $cp + atf_ifconfig -w 10 atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:41:55 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added a test case for MTU of pppoe(4) To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.27 src/tests/net/if_pppoe/t_pppoe.sh:1.28 --- src/tests/net/if_pppoe/t_pppoe.sh:1.27 Fri Apr 23 03:40:05 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Apr 23 03:41:55 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.27 2021/04/23 03:40:05 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.28 2021/04/23 03:41:55 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -805,6 +805,74 @@ pppoe_passiveauthproto_chap_cleanup() cleanup } +atf_test_case pppoe_mtu cleanup +pppoe_mtu_head() +{ + + atf_set "descr" "Test for mtu" + atf_set "require.progs" "rump_server" +} + +pppoe_mtu_body() +{ + local auth=chap + local cp="IPCP" + setup + + export RUMP_SERVER=$SERVER + atf_pppoectl pppoe0 \ + "hisauthname=$AUTHNAME" "hisauthsecret=$SECRET" \ + "hisauthproto=$auth" "myauthproto=none" \ + norechallenge + atf_ifconfig pppoe0 mtu 1400 + atf_ifconfig pppoe0 up + + export RUMP_SERVER=$CLIENT + atf_pppoectl pppoe0 \ + "myauthname=$AUTHNAME" "myauthsecret=$SECRET" \ + "myauthproto=$auth" "hisauthproto=none" + atf_ifconfig pppoe0 mtu 1450 + atf_ifconfig pppoe0 up + + wait_for_opened $cp + atf_ifconfig -w 10 + + export RUMP_SERVER=$SERVER + atf_check -s exit:0 -o match:'mtu 1400' rump.ifconfig pppoe0 + + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -o match:'mtu 1400' rump.ifconfig pppoe0 + + # mtu can set to 1460 but it is not applied. + atf_ifconfig pppoe0 mtu 1460 + atf_check -s exit:0 -o match:'mtu 1400' rump.ifconfig pppoe0 + + export RUMP_SERVER=$SERVER + atf_ifconfig pppoe0 mtu 1470 + atf_ifconfig pppoe0 down + atf_ifconfig pppoe0 up + wait_for_opened $cp + atf_ifconfig -w 10 + + # mtu 1460 is applied after LCP negotiation + atf_check -s exit:0 -o match:'mtu 1460' rump.ifconfig pppoe0 + + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -o match:'mtu 1460' rump.ifconfig pppoe0 + + rump.ifconfig pppoe0 mtu 1500 + atf_check -s exit:0 -o ignore \ + -e match:'SIOCSIFMTU: Invalid argument' \ + rump.ifconfig pppoe0 mtu 1501 +} + +pppoe_mtu_cleanup() +{ + + $DEBUG && dump + cleanup +} + atf_init_test_cases() { @@ -816,4 +884,5 @@ atf_init_test_cases() atf_add_test_case pppoe6_chap atf_add_test_case pppoe_passiveauthproto_pap atf_add_test_case pppoe_passiveauthproto_chap + atf_add_test_case pppoe_mtu }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:41:55 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added a test case for MTU of pppoe(4) To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:40:05 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Make IFF_DEBUG enabled if $DEBUG is true To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.26 src/tests/net/if_pppoe/t_pppoe.sh:1.27 --- src/tests/net/if_pppoe/t_pppoe.sh:1.26 Fri Apr 23 03:38:19 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Apr 23 03:40:05 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.26 2021/04/23 03:38:19 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.27 2021/04/23 03:40:05 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -88,6 +88,7 @@ setup_ifaces() inet $SERVER_IP $CLIENT_IP down atf_ifconfig pppoe0 link0 + $DEBUG && rump.ifconfig pppoe0 debug $DEBUG && rump.ifconfig $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER @@ -98,6 +99,7 @@ setup_ifaces() $inet && atf_ifconfig pppoe0 \ inet 0.0.0.0 0.0.0.1 down + $DEBUG && rump.ifconfig pppoe0 debug $DEBUG && rump.ifconfig $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:40:05 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Make IFF_DEBUG enabled if $DEBUG is true To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:38:19 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: functionalize rump.ifconfig and pppoectl for clearer test code To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.25 src/tests/net/if_pppoe/t_pppoe.sh:1.26 --- src/tests/net/if_pppoe/t_pppoe.sh:1.25 Fri Apr 23 03:07:19 2021 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Apr 23 03:38:19 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.25 2021/04/23 03:07:19 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.26 2021/04/23 03:38:19 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -39,6 +39,18 @@ TIMEOUT=3 WAITTIME=10 DEBUG=${DEBUG:-false} +atf_ifconfig() +{ + + atf_check -s exit:0 rump.ifconfig $* +} + +atf_pppoectl() +{ + + atf_check -s exit:0 -x "$HIJACKING pppoectl $*" +} + atf_test_case pppoe_create_destroy cleanup pppoe_create_destroy_head() { @@ -71,19 +83,19 @@ setup_ifaces() rump_server_add_iface $CLIENT pppoe0 export RUMP_SERVER=$SERVER - atf_check -s exit:0 rump.ifconfig shmif0 up - $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ + atf_ifconfig shmif0 up + $inet && atf_ifconfig pppoe0 \ inet $SERVER_IP $CLIENT_IP down - atf_check -s exit:0 rump.ifconfig pppoe0 link0 + atf_ifconfig pppoe0 link0 $DEBUG && rump.ifconfig $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER export RUMP_SERVER=$CLIENT - atf_check -s exit:0 rump.ifconfig shmif0 up + atf_ifconfig shmif0 up - $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ + $inet && atf_ifconfig pppoe0 \ inet 0.0.0.0 0.0.0.1 down $DEBUG && rump.ifconfig @@ -105,11 +117,11 @@ setup() setup_ifaces export RUMP_SERVER=$SERVER - atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" + atf_pppoectl -e shmif0 pppoe0 unset RUMP_SERVER export RUMP_SERVER=$CLIENT - atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" + atf_pppoectl -e shmif0 pppoe0 unset RUMP_SERVER } @@ -166,22 +178,17 @@ run_test() fi export RUMP_SERVER=$SERVER - local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \ -'hisauthname=$AUTHNAME' \ -'hisauthsecret=$SECRET' \ -'myauthproto=none' \ -$server_optparam" - atf_check -s exit:0 -x "$HIJACKING $setup_serverparam" - atf_check -s exit:0 rump.ifconfig pppoe0 up + atf_pppoectl pppoe0 "hisauthproto=$auth" \ + "hisauthname=$AUTHNAME" "hisauthsecret=$SECRET" \ + "myauthproto=none" $server_optparam + atf_ifconfig pppoe0 up unset RUMP_SERVER export RUMP_SERVER=$CLIENT - local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ -'myauthname=$AUTHNAME' \ -'myauthsecret=$SECRET' \ -'hisauthproto=none'" - atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" - atf_check -s exit:0 rump.ifconfig pppoe0 up + atf_pppoectl pppoe0 \ + "myauthname=$AUTHNAME" "myauthsecret=$SECRET" \ + "myauthproto=$auth" "hisauthproto=none" + atf_ifconfig pppoe0 up $DEBUG && rump.ifconfig wait_for_opened $cp atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP @@ -189,7 +196,7 @@ run_test() # test for disconnection from server export RUMP_SERVER=$SERVER - atf_check -s exit:0 rump.ifconfig pppoe0 down + atf_ifconfig pppoe0 down wait_for_disconnected export RUMP_SERVER=$CLIENT wait_for_disconnected @@ -207,7 +214,7 @@ run_test() # test for disconnection from client export RUMP_SERVER=$CLIENT - atf_check -s exit:0 -x rump.ifconfig pppoe0 down + atf_ifconfig pppoe0 down wait_for_disconnected export RUMP_SERVER=$SERVER wait_for_disconnected @@ -219,14 +226,14 @@ run_test() # test for reconnecting export RUMP_SERVER=$CLIENT - atf_check -s exit:0 -x rump.ifconfig pppoe0 up + atf_ifconfig pppoe0 up wait_for_opened $cp $DEBUG && rump.ifconfig pppoe0 $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER export RUMP_SERVER=$SERVER - atf_check -s exit:0 rump.ifconfig -w 10 + atf_ifconfig -w 10 atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0" $DEBUG && HIJACKING pppoectl -d pppoe0 @@ -234,15 +241,14 @@ run_test() # test for invalid password export RUMP_SERVER=$CLIENT - atf_check -s exit:0 rump.ifconfig pppoe0 down + atf_ifconfig pppoe0 down wait_for_disconnected - local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ -'myauthname=$AUTHNAME' \ -'myauthsecret=invalidsecret' \ -'hisauthproto=none' \ -'max-auth-failure=1'" - atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" - atf_check -s exit:0 rump.ifconfig pppoe0 up + atf_pppoectl pppoe0
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:38:19 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: functionalize rump.ifconfig and pppoectl for clearer test code To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:07:19 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added test cases for "pppoectl passiveauthproto" To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Apr 23 03:07:19 UTC 2021 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Added test cases for "pppoectl passiveauthproto" To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.24 src/tests/net/if_pppoe/t_pppoe.sh:1.25 --- src/tests/net/if_pppoe/t_pppoe.sh:1.24 Wed Nov 25 10:35:07 2020 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Apr 23 03:07:19 2021 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.24 2020/11/25 10:35:07 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.25 2021/04/23 03:07:19 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -739,6 +739,82 @@ pppoe_params_cleanup() $DEBUG && dump cleanup } + +pppoe_passiveauthproto() +{ + local auth=$1 + local cp="IPCP" + setup + + local server_optparam="" + if [ $auth = "chap" ]; then + server_optparam="norechallenge" + fi + + export RUMP_SERVER=$SERVER + local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \ +'hisauthname=$AUTHNAME' \ +'hisauthsecret=$SECRET' \ +'myauthproto=none' \ +$server_optparam" + atf_check -s exit:0 -x "$HIJACKING $setup_serverparam" + atf_check -s exit:0 rump.ifconfig pppoe0 up + + export RUMP_SERVER=$CLIENT + local setup_clientparam="pppoectl pppoe0 myauthproto=none \ +'myauthname=$AUTHNAME' \ +'myauthsecret=$SECRET' \ +'hisauthproto=none' \ +'passiveauthproto'" + atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" + atf_check -s exit:0 rump.ifconfig pppoe0 up + $DEBUG && rump.ifconfig + wait_for_opened $cp + atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP +} + +atf_test_case pppoe_passiveauthproto_pap cleanup +pppoe_passiveauthproto_pap_head() +{ + + atf_set "descr" "Test for passiveauthproto option on PAP" + atf_set "require.progs" "rump_server" +} + +pppoe_passiveauthproto_pap_body() +{ + + pppoe_passiveauthproto "pap" +} + +pppoe_passiveauthproto_pap_cleanup() +{ + + $DEBUG && dump + cleanup +} + +atf_test_case pppoe_passiveauthproto_chap cleanup +pppoe_passiveauthproto_chap_head() +{ + + atf_set "descr" "Test for passiveauthproto option on chap" + atf_set "require.progs" "rump_server" +} + +pppoe_passiveauthproto_chap_body() +{ + + pppoe_passiveauthproto "chap" +} + +pppoe_passiveauthproto_chap_cleanup() +{ + + $DEBUG && dump + cleanup +} + atf_init_test_cases() { @@ -748,4 +824,6 @@ atf_init_test_cases() atf_add_test_case pppoe_chap atf_add_test_case pppoe6_pap atf_add_test_case pppoe6_chap + atf_add_test_case pppoe_passiveauthproto_pap + atf_add_test_case pppoe_passiveauthproto_chap }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Nov 25 10:35:07 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Use a state of IPCP and IPv6CP to wait for connection established To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.23 src/tests/net/if_pppoe/t_pppoe.sh:1.24 --- src/tests/net/if_pppoe/t_pppoe.sh:1.23 Fri Sep 25 06:15:30 2020 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Nov 25 10:35:07 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.23 2020/09/25 06:15:30 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.24 2020/11/25 10:35:07 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -113,14 +113,18 @@ setup() unset RUMP_SERVER } -wait_for_session_established() +wait_for_opened() { - local dontfail=$1 + local cp=$1 + local dontfail=$2 local n=$WAITTIME for i in $(seq $n); do - $HIJACKING pppoectl -d pppoe0 |grep -q "state = session" - [ $? = 0 ] && return + $HIJACKING pppoectl -dd pppoe0 | grep -q "$cp state: opened" + if [ $? = 0 ]; then + rump.ifconfig -w 10 + return + fi sleep 1 done @@ -135,12 +139,10 @@ wait_for_disconnected() local n=$WAITTIME for i in $(seq $n); do - $HIJACKING pppoectl -d pppoe0 | grep -q "state = initial" - [ $? = 0 ] && return - # If PPPoE client is disconnected by PPPoE server and then - # the client kicks callout of pppoe_timeout(), the client - # state is changed to PPPOE_STATE_PADI_SENT while padi retrying. - $HIJACKING pppoectl -d pppoe0 | grep -q "state = PADI sent" + # If PPPoE client is disconnected by PPPoE server, then + # the LCP state will of the client is in a starting to send PADI. + $HIJACKING pppoectl -dd pppoe0 | grep -q \ + -e "LCP state: initial" -e "LCP state: starting" [ $? = 0 ] && return sleep 1 @@ -154,6 +156,7 @@ wait_for_disconnected() run_test() { local auth=$1 + local cp="IPCP" setup # As pppoe client doesn't support rechallenge yet. @@ -180,7 +183,7 @@ run_test() atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" atf_check -s exit:0 rump.ifconfig pppoe0 up $DEBUG && rump.ifconfig - wait_for_session_established + wait_for_opened $cp atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP unset RUMP_SERVER @@ -198,7 +201,7 @@ run_test() # test for reconnecting atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 up" export RUMP_SERVER=$CLIENT - wait_for_session_established + wait_for_opened $cp atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP unset RUMP_SERVER @@ -217,7 +220,7 @@ run_test() # test for reconnecting export RUMP_SERVER=$CLIENT atf_check -s exit:0 -x rump.ifconfig pppoe0 up - wait_for_session_established + wait_for_opened $cp $DEBUG && rump.ifconfig pppoe0 $DEBUG && $HIJACKING pppoectl -d pppoe0 unset RUMP_SERVER @@ -240,7 +243,7 @@ run_test() 'max-auth-failure=1'" atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" atf_check -s exit:0 rump.ifconfig pppoe0 up - wait_for_session_established dontfail + wait_for_opened $cp dontfail atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping -c 1 -w $TIMEOUT $SERVER_IP atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0 @@ -290,6 +293,7 @@ pppoe_chap_cleanup() run_test6() { local auth=$1 + local cp="IPv6CP" setup "inet=false" # As pppoe client doesn't support rechallenge yet. @@ -318,7 +322,7 @@ run_test6() atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $CLIENT_IP6/64 down atf_check -s exit:0 rump.ifconfig pppoe0 up $DEBUG && rump.ifconfig - wait_for_session_established + wait_for_opened $cp atf_check -s exit:0 -o ignore rump.ifconfig -w 10 export RUMP_SERVER=$SERVER atf_check -s exit:0 -o ignore rump.ifconfig -w 10 @@ -341,7 +345,7 @@ run_test6() # test for reconnecting export RUMP_SERVER=$SERVER atf_check -s exit:0 rump.ifconfig pppoe0 up - wait_for_session_established + wait_for_opened $cp atf_check -s exit:0 rump.ifconfig -w 10 $DEBUG && $HIJACKING pppoectl -d pppoe0 $DEBUG && rump.ifconfig pppoe0 @@ -366,7 +370,7 @@ run_test6() # test for reconnecting export RUMP_SERVER=$CLIENT atf_check -s exit:0 rump.ifconfig pppoe0 up - wait_for_session_established + wait_for_opened $cp atf_check -s exit:0 rump.ifconfig -w 10 $DEBUG && rump.ifconfig pppoe0 @@ -391,7 +395,7 @@ run_test6() 'max-auth-failure=1'" atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" atf_check -s exit:0 rump.ifconfig pppoe0 up - wait_for_session_established dontfail + wait_for_opened $cp dontfail atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6 atf_check -s exit:0 -o match:'DETACHED'
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Nov 25 10:35:07 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Use a state of IPCP and IPv6CP to wait for connection established To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Sep 25 06:15:30 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: update test cases for AC-Name and Service-Name To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.22 src/tests/net/if_pppoe/t_pppoe.sh:1.23 --- src/tests/net/if_pppoe/t_pppoe.sh:1.22 Fri Sep 25 06:07:31 2020 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Sep 25 06:15:30 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.22 2020/09/25 06:07:31 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.23 2020/09/25 06:15:30 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -556,7 +556,7 @@ pppoe_params_body() atf_check -s exit:0 rump.ifconfig pppoe0 down wait_for_disconnected atf_check -s exit:0 -x "$HIJACKING pppoectl -a ACNAME-TEST2 -e shmif0 pppoe0" - atf_check -s exit:0 -x "$HIJACKING pppoectl -a \"\" -e shmif0 pppoe0" + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" atf_check -s exit:0 rump.ifconfig pppoe0 up $DEBUG && rump.ifconfig wait_for_session_established @@ -567,6 +567,19 @@ pppoe_params_body() -x "${dumpcmd} | grep PADI" atf_check -s exit:0 -o match:'\[Service-Name\]' -e ignore \ -x "${dumpcmd} | grep PADR" + atf_check -s exit:0 -o not-match:'AC-Name' -e ignore \ + -x "${dumpcmd} | grep PADI" + + # store 0 length string in AC-NAME + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected + atf_check -s exit:0 -x "$HIJACKING pppoectl -a \"\" -e shmif0 pppoe0" + atf_check -s exit:0 rump.ifconfig pppoe0 up + $DEBUG && rump.ifconfig + wait_for_session_established + unset RUMP_SERVER + atf_check -s exit:0 -o match:'\[AC-Name\]' -e ignore \ -x "${dumpcmd} | grep PADI" @@ -629,7 +642,7 @@ pppoe_params_body() atf_check -s exit:0 rump.ifconfig pppoe0 down wait_for_disconnected atf_check -s exit:0 -x "$HIJACKING pppoectl -s SNAME-TEST2 -e shmif0 pppoe0" - atf_check -s exit:0 -x "$HIJACKING pppoectl -s \"\" -e shmif0 pppoe0" + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" atf_check -s exit:0 rump.ifconfig pppoe0 up $DEBUG && rump.ifconfig wait_for_session_established @@ -685,10 +698,10 @@ pppoe_params_body() $DEBUG && dump_bus atf_check -s exit:0 \ - -o match:'\[Service-Name "SNAME-TEST3"\] \[AC-Name "ACNAME-TEST4"\]' \ + -o match:'\[Service-Name\] \[AC-Name "ACNAME-TEST4"\]' \ -e ignore \ -x "${dumpcmd} | grep PADI" - atf_check -s exit:0 -o match:'\[Service-Name "SNAME-TEST3"\]' -e ignore \ + atf_check -s exit:0 -o match:'\[Service-Name\]' -e ignore \ -x "${dumpcmd} | grep PADR" # change Service-Name @@ -696,7 +709,9 @@ pppoe_params_body() atf_check -s exit:0 rump.ifconfig pppoe0 down wait_for_disconnected atf_check -s exit:0 -x \ - "$HIJACKING pppoectl -e shmif0 -s SNAME-TEST4 pppoe0" + "$HIJACKING pppoectl -e shmif0 -a ACNAME-TEST5 -s SNAME-TEST5 pppoe0" + atf_check -s exit:0 -x \ + "$HIJACKING pppoectl -e shmif0 -s SNAME-TEST6 pppoe0" atf_check -s exit:0 rump.ifconfig pppoe0 up $DEBUG && rump.ifconfig wait_for_session_established @@ -704,11 +719,13 @@ pppoe_params_body() $DEBUG && dump_bus atf_check -s exit:0 \ - -o match:'\[Service-Name "SNAME-TEST4"\] \[AC-Name "ACNAME-TEST4"\]' \ + -o match:'\[Service-Name "SNAME-TEST6"\]' \ -e ignore \ -x "${dumpcmd} | grep PADI" - atf_check -s exit:0 -o match:'\[Service-Name "SNAME-TEST3"\]' -e ignore \ + atf_check -s exit:0 -o match:'\[Service-Name "SNAME-TEST6"\]' -e ignore \ -x "${dumpcmd} | grep PADR" + atf_check -s exit:0 -o not-match:'\[AC-Name "ACNAME-TEST5\]"' -e ignore \ + -x "${dumpcmd} | grep PADI" } pppoe_params_cleanup()
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Sep 25 06:15:30 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: update test cases for AC-Name and Service-Name To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Sep 25 06:07:31 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add test cases for AC-Name and Service-Name To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.21 src/tests/net/if_pppoe/t_pppoe.sh:1.22 --- src/tests/net/if_pppoe/t_pppoe.sh:1.21 Wed Sep 23 06:18:20 2020 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Sep 25 06:07:31 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.21 2020/09/23 06:18:20 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.22 2020/09/25 06:07:31 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -62,41 +62,53 @@ pppoe_create_destroy_cleanup() cleanup } -setup() +setup_ifaces() { - inet=true - - if [ $# -ne 0 ]; then - eval $@ - fi - - rump_server_start $SERVER netinet6 pppoe - rump_server_start $CLIENT netinet6 pppoe rump_server_add_iface $SERVER shmif0 $BUS rump_server_add_iface $CLIENT shmif0 $BUS + rump_server_add_iface $SERVER pppoe0 + rump_server_add_iface $CLIENT pppoe0 export RUMP_SERVER=$SERVER atf_check -s exit:0 rump.ifconfig shmif0 up - - rump_server_add_iface $SERVER pppoe0 $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ inet $SERVER_IP $CLIENT_IP down atf_check -s exit:0 rump.ifconfig pppoe0 link0 $DEBUG && rump.ifconfig $DEBUG && $HIJACKING pppoectl -d pppoe0 - - atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" unset RUMP_SERVER export RUMP_SERVER=$CLIENT atf_check -s exit:0 rump.ifconfig shmif0 up - rump_server_add_iface $CLIENT pppoe0 $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ inet 0.0.0.0 0.0.0.1 down + $DEBUG && rump.ifconfig + $DEBUG && $HIJACKING pppoectl -d pppoe0 + unset RUMP_SERVER +} + +setup() +{ + inet=true + + if [ $# -ne 0 ]; then + eval $@ + fi + + rump_server_start $SERVER netinet6 pppoe + rump_server_start $CLIENT netinet6 pppoe + + setup_ifaces + + export RUMP_SERVER=$SERVER + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" + unset RUMP_SERVER + + export RUMP_SERVER=$CLIENT atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" unset RUMP_SERVER } @@ -426,10 +438,290 @@ pppoe6_chap_cleanup() cleanup } +atf_test_case pppoe_params cleanup + +dump_bus() +{ + + shmif_dumpbus -p - ${BUS} | tcpdump -n -e -r - +} + +setup_auth_conf() +{ + local auth=chap + + export RUMP_SERVER=$SERVER + local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \ +'hisauthname=$AUTHNAME' \ +'hisauthsecret=$SECRET' \ +'myauthproto=none' \ +$server_optparam" + + atf_check -s exit:0 rump.ifconfig pppoe0 link0 + atf_check -s exit:0 -x "$HIJACKING $setup_serverparam" + unset RUMP_SERVER + + local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ +'myauthname=$AUTHNAME' \ +'myauthsecret=$SECRET' \ +'hisauthproto=none'" + + export RUMP_SERVER=$CLIENT + $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ + inet 0.0.0.0 0.0.0.1 down + atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" + $DEBUG && rump.ifconfig + unset RUMP_SERVER +} + +pppoe_params_head() +{ + atf_set "descr" "Set and clear access concentrator name and service name" + atf_set "require.progs" "rump_server pppoectl" +} + +pppoe_params_body() +{ + local dumpcmd + + dumpcmd="shmif_dumpbus -p - ${BUS}" + dumpcmd="${dumpcmd} | tcpdump -n -e -r -" + + rump_server_start $SERVER netinet6 pppoe + rump_server_start $CLIENT netinet6 pppoe + + setup_ifaces + setup_auth_conf + + export RUMP_SERVER=$SERVER + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" + atf_check -s exit:0 rump.ifconfig pppoe0 up + unset RUMP_SERVER + + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" + atf_check -s exit:0 rump.ifconfig pppoe0 up + $DEBUG && rump.ifconfig + wait_for_session_established + unset RUMP_SERVER + + $DEBUG && dump_bus + atf_check -s exit:0 -o match:'\[Service-Name\]' -e ignore \ + -x "${dumpcmd} | grep PADI" + atf_check -s exit:0 -o match:'\[Service-Name\]' -e ignore \ + -x "${dumpcmd} | grep PADR" + atf_check -s exit:0 -o not-match:'AC-Name' -e ignore \ + -x "${dumpcmd} | grep PADI" + + # set Remote access concentrator name (AC-NAME, -a option) + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected + atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 -a ACNAME-TEST0 pppoe0" + atf_check -s exit:0 rump.ifconfig pppoe0 up + $DEBUG && rump.ifconfig + wait_for_session_established + unset RUMP_SERVER + + $DEBUG && dump_bus + atf_check -s exit:0 -o match:'\[AC-Name "ACNAME-TEST0"\]' -e ignore \ + -x "${dumpcmd} | grep PADI" + + # change AC-NAME +
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Fri Sep 25 06:07:31 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add test cases for AC-Name and Service-Name To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Sep 23 06:18:20 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add a limit for auth at a test for invalid account To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.20 src/tests/net/if_pppoe/t_pppoe.sh:1.21 --- src/tests/net/if_pppoe/t_pppoe.sh:1.20 Wed Sep 23 05:56:55 2020 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Sep 23 06:18:20 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.20 2020/09/23 05:56:55 yamaguchi Exp $ +# $NetBSD: t_pppoe.sh,v 1.21 2020/09/23 06:18:20 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -224,7 +224,8 @@ run_test() local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ 'myauthname=$AUTHNAME' \ 'myauthsecret=invalidsecret' \ -'hisauthproto=none'" +'hisauthproto=none' \ +'max-auth-failure=1'" atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" atf_check -s exit:0 rump.ifconfig pppoe0 up wait_for_session_established dontfail @@ -374,7 +375,8 @@ run_test6() local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ 'myauthname=$AUTHNAME' \ 'myauthsecret=invalidsecret' \ -'hisauthproto=none'" +'hisauthproto=none' \ +'max-auth-failure=1'" atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" atf_check -s exit:0 rump.ifconfig pppoe0 up wait_for_session_established dontfail
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Sep 23 06:18:20 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add a limit for auth at a test for invalid account To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Sep 23 05:56:55 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix typo To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.19 src/tests/net/if_pppoe/t_pppoe.sh:1.20 --- src/tests/net/if_pppoe/t_pppoe.sh:1.19 Mon Aug 19 03:22:05 2019 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Sep 23 05:56:55 2020 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.19 2019/08/19 03:22:05 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.20 2020/09/23 05:56:55 yamaguchi Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -183,7 +183,7 @@ run_test() atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER - # test for recoonecting + # test for reconnecting atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 up" export RUMP_SERVER=$CLIENT wait_for_session_established @@ -325,7 +325,7 @@ run_test6() atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER - # test for recoonecting + # test for reconnecting export RUMP_SERVER=$SERVER atf_check -s exit:0 rump.ifconfig pppoe0 up wait_for_session_established
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: yamaguchi Date: Wed Sep 23 05:56:55 UTC 2020 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix typo To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Tue Mar 28 01:27:46 UTC 2017 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Use the utility functions for rump_server To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.16 src/tests/net/if_pppoe/t_pppoe.sh:1.17 --- src/tests/net/if_pppoe/t_pppoe.sh:1.16 Wed Dec 14 03:30:30 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Tue Mar 28 01:27:46 2017 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.16 2016/12/14 03:30:30 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.17 2017/03/28 01:27:46 ozaki-r Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -25,14 +25,8 @@ # POSSIBILITY OF SUCH DAMAGE. # -server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \ - -lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev \ - -lrumpnet_pppoe" -# pppoectl doesn't work with RUMPHIJACK=sysctl=yes -HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so" - -SERVER=unix://commsock1 -CLIENT=unix://commsock2 +SERVER=unix://pppoe_server +CLIENT=unix://pppoe_client SERVER_IP=10.3.3.1 CLIENT_IP=10.3.3.3 @@ -53,12 +47,13 @@ setup() eval $@ fi - atf_check -s exit:0 ${server} $SERVER - atf_check -s exit:0 ${server} $CLIENT + rump_server_start $SERVER netinet6 pppoe + rump_server_start $CLIENT netinet6 pppoe + + rump_server_add_iface $SERVER shmif0 $BUS + rump_server_add_iface $CLIENT shmif0 $BUS export RUMP_SERVER=$SERVER - atf_check -s exit:0 rump.ifconfig shmif0 create - atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS atf_check -s exit:0 rump.ifconfig shmif0 up atf_check -s exit:0 rump.ifconfig pppoe0 create @@ -73,8 +68,6 @@ setup() unset RUMP_SERVER export RUMP_SERVER=$CLIENT - atf_check -s exit:0 rump.ifconfig shmif0 create - atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS atf_check -s exit:0 rump.ifconfig shmif0 up atf_check -s exit:0 rump.ifconfig pppoe0 create @@ -85,13 +78,6 @@ setup() unset RUMP_SERVER } -cleanup() -{ - env RUMP_SERVER=$SERVER rump.halt - env RUMP_SERVER=$CLIENT rump.halt -} - - wait_for_session_established() { local dontfail=$1 @@ -240,6 +226,8 @@ pppoe_pap_body() pppoe_pap_cleanup() { + + $DEBUG && dump cleanup } @@ -258,6 +246,8 @@ pppoe_chap_body() pppoe_chap_cleanup() { + + $DEBUG && dump cleanup } @@ -386,6 +376,8 @@ pppoe6_pap_body() pppoe6_pap_cleanup() { + + $DEBUG && dump cleanup } @@ -404,6 +396,8 @@ pppoe6_chap_body() pppoe6_chap_cleanup() { + + $DEBUG && dump cleanup }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Tue Mar 28 01:27:46 UTC 2017 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Use the utility functions for rump_server To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Dec 14 03:30:30 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: add wait_for_disconnected to run_test() as well as run_test6(). Before commited MP-safe patch, IPv4 test can run in time without wait_for_disconnected. Currently, wait_for_disconnected is required because of locking overhead. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Dec 14 03:30:30 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: add wait_for_disconnected to run_test() as well as run_test6(). Before commited MP-safe patch, IPv4 test can run in time without wait_for_disconnected. Currently, wait_for_disconnected is required because of locking overhead. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.15 src/tests/net/if_pppoe/t_pppoe.sh:1.16 --- src/tests/net/if_pppoe/t_pppoe.sh:1.15 Mon Dec 12 09:56:58 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Dec 14 03:30:30 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.15 2016/12/12 09:56:58 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.16 2016/12/14 03:30:30 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -164,8 +164,11 @@ run_test() unset RUMP_SERVER # test for disconnection from server - atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 down" + export RUMP_SERVER=$SERVER + atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected export RUMP_SERVER=$CLIENT + wait_for_disconnected atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping -c 1 -w $TIMEOUT $SERVER_IP atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0" @@ -179,8 +182,11 @@ run_test() unset RUMP_SERVER # test for disconnection from client - atf_check -s exit:0 -x "env RUMP_SERVER=$CLIENT rump.ifconfig pppoe0 down" + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -x rump.ifconfig pppoe0 down + wait_for_disconnected export RUMP_SERVER=$SERVER + wait_for_disconnected $DEBUG && $HIJACKING pppoectl -d pppoe0 atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping -c 1 -w $TIMEOUT $CLIENT_IP @@ -205,6 +211,7 @@ run_test() # test for invalid password export RUMP_SERVER=$CLIENT atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ 'myauthname=$AUTHNAME' \ 'myauthsecret=invalidsecret' \ @@ -323,8 +330,8 @@ run_test6() wait_for_disconnected export RUMP_SERVER=$SERVER - $DEBUG && $HIJACKING pppoectl -d pppoe0 wait_for_disconnected + $DEBUG && $HIJACKING pppoectl -d pppoe0 atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6 atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Mon Dec 12 09:56:59 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix accidentally if_pppoe atf failure depends on cpu workload. advised by s-yamaguchi@IIJ, thanks. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Mon Dec 12 09:56:59 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix accidentally if_pppoe atf failure depends on cpu workload. advised by s-yamaguchi@IIJ, thanks. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.14 src/tests/net/if_pppoe/t_pppoe.sh:1.15 --- src/tests/net/if_pppoe/t_pppoe.sh:1.14 Fri Dec 2 06:19:50 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Mon Dec 12 09:56:58 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.14 2016/12/02 06:19:50 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.15 2016/12/12 09:56:58 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -114,8 +114,14 @@ wait_for_disconnected() local n=$WAITTIME for i in $(seq $n); do - $HIJACKING pppoectl -d pppoe0 | grep -q "state = session" - [ $? -eq 0 ] || return + $HIJACKING pppoectl -d pppoe0 | grep -q "state = initial" + [ $? = 0 ] && return + # If PPPoE client is disconnected by PPPoE server and then + # the client kicks callout of pppoe_timeout(), the client + # state is changed to PPPOE_STATE_PADI_SENT while padi retrying. + $HIJACKING pppoectl -d pppoe0 | grep -q "state = PADI sent" + [ $? = 0 ] && return + sleep 1 done
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Fri Dec 2 06:19:50 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix typo. ping6 deadline option is not "-w" but "-X". To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.13 src/tests/net/if_pppoe/t_pppoe.sh:1.14 --- src/tests/net/if_pppoe/t_pppoe.sh:1.13 Fri Dec 2 05:28:27 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Dec 2 06:19:50 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.13 2016/12/02 05:28:27 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.14 2016/12/02 06:19:50 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -295,7 +295,7 @@ run_test6() export RUMP_SERVER=$CLIENT wait_for_disconnected atf_check -s not-exit:0 -o ignore -e ignore \ - rump.ping6 -c 1 -w $TIMEOUT $SERVER_IP6 + rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6 atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Fri Dec 2 06:19:50 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix typo. ping6 deadline option is not "-w" but "-X". To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Fri Dec 2 05:28:27 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix accidentally if_pppoe atf failure depends on cpu workload. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Fri Dec 2 05:28:27 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix accidentally if_pppoe atf failure depends on cpu workload. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.12 src/tests/net/if_pppoe/t_pppoe.sh:1.13 --- src/tests/net/if_pppoe/t_pppoe.sh:1.12 Thu Nov 24 09:03:53 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Fri Dec 2 05:28:27 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.12 2016/11/24 09:03:53 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.13 2016/12/02 05:28:27 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -208,7 +208,7 @@ run_test() wait_for_session_established dontfail atf_check -s not-exit:0 -o ignore -e ignore \ rump.ping -c 1 -w $TIMEOUT $SERVER_IP - atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0" + atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0 unset RUMP_SERVER }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Thu Nov 24 07:31:14 UTC 2016 Modified Files: src/tests/net/if_pppoe: Makefile Log Message: Add missing $NetBSD$ tag To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_pppoe/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Thu Nov 24 07:31:14 UTC 2016 Modified Files: src/tests/net/if_pppoe: Makefile Log Message: Add missing $NetBSD$ tag To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_pppoe/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/Makefile diff -u src/tests/net/if_pppoe/Makefile:1.1 src/tests/net/if_pppoe/Makefile:1.2 --- src/tests/net/if_pppoe/Makefile:1.1 Fri Apr 15 01:38:17 2016 +++ src/tests/net/if_pppoe/Makefile Thu Nov 24 07:31:14 2016 @@ -1,3 +1,5 @@ +# $NetBSD: Makefile,v 1.2 2016/11/24 07:31:14 ozaki-r Exp $ +# .include
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Thu Nov 10 10:32:59 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix: extend waittime to avoid unintended fail at high cpu load. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Thu Nov 10 10:32:59 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix: extend waittime to avoid unintended fail at high cpu load. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.10 src/tests/net/if_pppoe/t_pppoe.sh:1.11 --- src/tests/net/if_pppoe/t_pppoe.sh:1.10 Mon Nov 7 05:25:36 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Thu Nov 10 10:32:59 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.10 2016/11/07 05:25:36 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.11 2016/11/10 10:32:59 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -41,7 +41,7 @@ AUTHNAME=foo...@baz.com SECRET=oink BUS=bus0 TIMEOUT=3 -WAITTIME=5 +WAITTIME=10 DEBUG=${DEBUG:-false} setup()
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Thu Oct 27 09:59:17 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix rarely rump.ping6 failures by "UDP connect". and fix typo. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.8 src/tests/net/if_pppoe/t_pppoe.sh:1.9 --- src/tests/net/if_pppoe/t_pppoe.sh:1.8 Wed Oct 26 03:55:56 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Thu Oct 27 09:59:17 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.8 2016/10/26 03:55:56 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.9 2016/10/27 09:59:17 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -180,7 +180,7 @@ run_test() atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER - # test for recconecting + # test for reconnecting export RUMP_SERVER=$CLIENT atf_check -s exit:0 -x rump.ifconfig pppoe0 up wait_for_session_established @@ -189,6 +189,7 @@ run_test() unset RUMP_SERVER export RUMP_SERVER=$SERVER + atf_check -s exit:0 rump.ifconfig -w 10 atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0" $DEBUG && HIJACKING pppoectl -d pppoe0 @@ -322,7 +323,7 @@ run_test6() atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0" unset RUMP_SERVER - # test for recconecting + # test for reconnecting export RUMP_SERVER=$CLIENT atf_check -s exit:0 rump.ifconfig pppoe0 up wait_for_session_established @@ -333,6 +334,7 @@ run_test6() unset RUMP_SERVER export RUMP_SERVER=$SERVER + atf_check -s exit:0 rump.ifconfig -w 10 atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6 atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0" $DEBUG && HIJACKING pppoectl -d pppoe0
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Thu Oct 27 09:59:17 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: fix rarely rump.ping6 failures by "UDP connect". and fix typo. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Oct 26 03:55:56 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix error when wait_for_session_established() is called without argument. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.7 src/tests/net/if_pppoe/t_pppoe.sh:1.8 --- src/tests/net/if_pppoe/t_pppoe.sh:1.7 Wed Oct 26 03:27:24 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Oct 26 03:55:56 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.7 2016/10/26 03:27:24 knakahara Exp $ +# $NetBSD: t_pppoe.sh,v 1.8 2016/10/26 03:55:56 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -102,7 +102,7 @@ wait_for_session_established() sleep 1 done - if [ $dontfail != "dontfail" ]; then + if [ "$dontfail" != "dontfail" ]; then atf_fail "Couldn't connect to the server for $n seconds." fi } @@ -118,7 +118,7 @@ wait_for_disconnected() sleep 1 done - if [ $dontfail != "dontfail" ]; then + if [ "$dontfail" != "dontfail" ]; then atf_fail "Couldn't disconnect for $n seconds." fi }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Oct 26 03:55:56 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Fix error when wait_for_session_established() is called without argument. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Oct 26 03:27:24 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add new test cases(PAP and CHAP) for IPv6 PPPoE. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.6 src/tests/net/if_pppoe/t_pppoe.sh:1.7 --- src/tests/net/if_pppoe/t_pppoe.sh:1.6 Wed Oct 19 00:19:13 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Oct 26 03:27:24 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.6 2016/10/19 00:19:13 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.7 2016/10/26 03:27:24 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -35,6 +35,8 @@ CLIENT=unix://commsock2 SERVER_IP=10.3.3.1 CLIENT_IP=10.3.3.3 +SERVER_IP6=fc00::1 +CLIENT_IP6=fc00::3 AUTHNAME=foo...@baz.com SECRET=oink BUS=bus0 @@ -44,6 +46,12 @@ DEBUG=false setup() { + inet=true + + if [ $# -ne 0 ]; then + eval $@ + fi + atf_check -s exit:0 ${server} $SERVER atf_check -s exit:0 ${server} $CLIENT @@ -53,7 +61,8 @@ setup() atf_check -s exit:0 rump.ifconfig shmif0 up atf_check -s exit:0 rump.ifconfig pppoe0 create - atf_check -s exit:0 rump.ifconfig pppoe0 inet $SERVER_IP $CLIENT_IP down + $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ + inet $SERVER_IP $CLIENT_IP down atf_check -s exit:0 rump.ifconfig pppoe0 link0 $DEBUG && rump.ifconfig @@ -68,7 +77,8 @@ setup() atf_check -s exit:0 rump.ifconfig shmif0 up atf_check -s exit:0 rump.ifconfig pppoe0 create - atf_check -s exit:0 rump.ifconfig pppoe0 inet 0.0.0.0 0.0.0.1 down + $inet && atf_check -s exit:0 rump.ifconfig pppoe0 \ + inet 0.0.0.0 0.0.0.1 down atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" unset RUMP_SERVER @@ -97,6 +107,22 @@ wait_for_session_established() fi } +wait_for_disconnected() +{ + local dontfail=$1 + local n=$WAITTIME + + for i in $(seq $n); do + $HIJACKING pppoectl -d pppoe0 | grep -q "state = session" + [ $? -eq 0 ] || return + sleep 1 + done + + if [ $dontfail != "dontfail" ]; then + atf_fail "Couldn't disconnect for $n seconds." + fi +} + run_test() { local auth=$1 @@ -220,8 +246,155 @@ pppoe_chap_cleanup() cleanup } +run_test6() +{ + local auth=$1 + setup "inet=false" + + # As pppoe client doesn't support rechallenge yet. + local server_optparam="" + if [ $auth = "chap" ]; then + server_optparam="norechallenge" + fi + + export RUMP_SERVER=$SERVER + local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \ +'hisauthname=$AUTHNAME' \ +'hisauthsecret=$SECRET' \ +'myauthproto=none' \ +$server_optparam" + atf_check -s exit:0 -x "$HIJACKING $setup_serverparam" + atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $SERVER_IP6/64 down + atf_check -s exit:0 rump.ifconfig pppoe0 up + unset RUMP_SERVER + + export RUMP_SERVER=$CLIENT + local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \ +'myauthname=$AUTHNAME' \ +'myauthsecret=$SECRET' \ +'hisauthproto=none'" + atf_check -s exit:0 -x "$HIJACKING $setup_clientparam" + atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $CLIENT_IP6/64 down + atf_check -s exit:0 rump.ifconfig pppoe0 up + $DEBUG && rump.ifconfig + wait_for_session_established + atf_check -s exit:0 -o ignore rump.ifconfig -w 10 + export RUMP_SERVER=$SERVER + atf_check -s exit:0 -o ignore rump.ifconfig -w 10 + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6 + unset RUMP_SERVER + + # test for disconnection from server + export RUMP_SERVER=$SERVER + session_id=`$HIJACKING pppoectl -d pppoe0 | grep state` + atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected + export RUMP_SERVER=$CLIENT + wait_for_disconnected + atf_check -s not-exit:0 -o ignore -e ignore \ + rump.ping6 -c 1 -w $TIMEOUT $SERVER_IP6 + atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0" + unset RUMP_SERVER + + # test for recoonecting + export RUMP_SERVER=$SERVER + atf_check -s exit:0 rump.ifconfig pppoe0 up + wait_for_session_established + atf_check -s exit:0 rump.ifconfig -w 10 + $DEBUG && $HIJACKING pppoectl -d pppoe0 + $DEBUG && rump.ifconfig pppoe0 + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 -o ignore rump.ifconfig -w 10 + atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6 + unset RUMP_SERVER + + # test for disconnection from client + export RUMP_SERVER=$CLIENT + atf_check -s exit:0 rump.ifconfig pppoe0 down + wait_for_disconnected + + export RUMP_SERVER=$SERVER + $DEBUG && $HIJACKING pppoectl -d pppoe0 + wait_for_disconnected + atf_check -s not-exit:0 -o ignore -e ignore \ + rump.ping6 -c 1 -X $TIMEOUT
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Oct 26 03:27:24 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add new test cases(PAP and CHAP) for IPv6 PPPoE. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Wed Oct 19 00:19:13 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Make sure to run cleanup Should fix "tests: did not complete" failures. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.5 src/tests/net/if_pppoe/t_pppoe.sh:1.6 --- src/tests/net/if_pppoe/t_pppoe.sh:1.5 Tue Oct 18 04:10:24 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Oct 19 00:19:13 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.5 2016/10/18 04:10:24 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.6 2016/10/19 00:19:13 ozaki-r Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -184,7 +184,7 @@ run_test() unset RUMP_SERVER } -atf_test_case pap cleanup +atf_test_case pppoe_pap cleanup pppoe_pap_head() { @@ -202,7 +202,7 @@ pppoe_pap_cleanup() cleanup } -atf_test_case chap cleanup +atf_test_case pppoe_chap cleanup pppoe_chap_head() {
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: ozaki-r Date: Wed Oct 19 00:19:13 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Make sure to run cleanup Should fix "tests: did not complete" failures. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Sep 14 01:48:08 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Disable rechallenge for chap test case. NetBSD's PPPoE client doesn't support chap rechallenge yet. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.3 src/tests/net/if_pppoe/t_pppoe.sh:1.4 --- src/tests/net/if_pppoe/t_pppoe.sh:1.3 Mon Sep 12 14:47:24 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Wed Sep 14 01:48:08 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.3 2016/09/12 14:47:24 christos Exp $ +# $NetBSD: t_pppoe.sh,v 1.4 2016/09/14 01:48:08 knakahara Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -102,11 +102,18 @@ run_test() local auth=$1 setup + # As pppoe client doesn't support rechallenge yet. + local server_optparam="" + if [ $auth = "chap" ]; then + server_optparam="norechallenge" + fi + export RUMP_SERVER=$SERVER local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \ 'hisauthname=$AUTHNAME' \ 'hisauthsecret=$SECRET' \ -'myauthproto=none'" +'myauthproto=none' \ +$server_optparam" atf_check -s exit:0 -x "$HIJACKING $setup_serverparam" atf_check -s exit:0 rump.ifconfig pppoe0 up unset RUMP_SERVER
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: knakahara Date: Wed Sep 14 01:48:08 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Disable rechallenge for chap test case. NetBSD's PPPoE client doesn't support chap rechallenge yet. >From Shoichi YAMAGUCHI, Thanks. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: christos Date: Mon Sep 12 14:47:24 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: add a chap test; need to investigate what's wrong with it... To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: christos Date: Mon Sep 12 14:47:24 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: add a chap test; need to investigate what's wrong with it... To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.2 src/tests/net/if_pppoe/t_pppoe.sh:1.3 --- src/tests/net/if_pppoe/t_pppoe.sh:1.2 Sun Aug 7 19:34:31 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Mon Sep 12 10:47:24 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.2 2016/08/07 23:34:31 pgoyette Exp $ +# $NetBSD: t_pppoe.sh,v 1.3 2016/09/12 14:47:24 christos Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -42,8 +42,6 @@ TIMEOUT=3 WAITTIME=5 DEBUG=false -atf_test_case pap cleanup - setup() { atf_check -s exit:0 ${server} $SERVER @@ -75,17 +73,13 @@ setup() atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0" unset RUMP_SERVER } + cleanup() { env RUMP_SERVER=$SERVER rump.halt env RUMP_SERVER=$CLIENT rump.halt } -pap_head() -{ - atf_set "descr" "Does simple pap tests" - atf_set "require.progs" "rump_server pppoectl" -} wait_for_session_established() { @@ -103,9 +97,9 @@ wait_for_session_established() fi } -pap_body() +run_test() { - local auth=pap + local auth=$1 setup export RUMP_SERVER=$SERVER @@ -183,11 +177,44 @@ pap_body() unset RUMP_SERVER } +atf_test_case pap cleanup + +pap_head() +{ + atf_set "descr" "Does simple pap tests" + atf_set "require.progs" "rump_server pppoectl" +} + +pap_body() +{ + run_test pap +} + pap_cleanup() { cleanup } + +atf_test_case chap cleanup + +chap_head() +{ + atf_set "descr" "Does simple chap tests" + atf_set "require.progs" "rump_server pppoectl" +} + +chap_body() +{ + run_test chap +} + +chap_cleanup() +{ + cleanup +} + atf_init_test_cases() { atf_add_test_case pap + atf_add_test_case chap }
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: pgoyette Date: Sun Aug 7 23:34:31 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add rumpdev library since we're now calling config_cfdriver_attach() Should fix the newly-introduced test failure. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/net/if_pppoe
Module Name:src Committed By: pgoyette Date: Sun Aug 7 23:34:31 UTC 2016 Modified Files: src/tests/net/if_pppoe: t_pppoe.sh Log Message: Add rumpdev library since we're now calling config_cfdriver_attach() Should fix the newly-introduced test failure. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/net/if_pppoe/t_pppoe.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/net/if_pppoe/t_pppoe.sh diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.1 src/tests/net/if_pppoe/t_pppoe.sh:1.2 --- src/tests/net/if_pppoe/t_pppoe.sh:1.1 Fri Apr 15 01:38:17 2016 +++ src/tests/net/if_pppoe/t_pppoe.sh Sun Aug 7 23:34:31 2016 @@ -1,4 +1,4 @@ -# $NetBSD: t_pppoe.sh,v 1.1 2016/04/15 01:38:17 ozaki-r Exp $ +# $NetBSD: t_pppoe.sh,v 1.2 2016/08/07 23:34:31 pgoyette Exp $ # # Copyright (c) 2016 Internet Initiative Japan Inc. # All rights reserved. @@ -25,8 +25,9 @@ # POSSIBILITY OF SUCH DAMAGE. # -server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \ - -lrumpnet_netinet6 -lrumpnet_shmif -lrumpnet_pppoe" +server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \ + -lrumpnet_netinet6 -lrumpnet_shmif -lrumpdev \ + -lrumpnet_pppoe" HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so" SERVER=unix://commsock1