Home | History | Annotate | Line # | Download | only in if_pppoe
t_pppoe.sh revision 1.1.2.3
      1  1.1.2.3  pgoyette #	$NetBSD: t_pppoe.sh,v 1.1.2.3 2017/04/26 02:53:33 pgoyette Exp $
      2      1.1     ozaki #
      3      1.1     ozaki # Copyright (c) 2016 Internet Initiative Japan Inc.
      4      1.1     ozaki # All rights reserved.
      5      1.1     ozaki #
      6      1.1     ozaki # Redistribution and use in source and binary forms, with or without
      7      1.1     ozaki # modification, are permitted provided that the following conditions
      8      1.1     ozaki # are met:
      9      1.1     ozaki # 1. Redistributions of source code must retain the above copyright
     10      1.1     ozaki #    notice, this list of conditions and the following disclaimer.
     11      1.1     ozaki # 2. Redistributions in binary form must reproduce the above copyright
     12      1.1     ozaki #    notice, this list of conditions and the following disclaimer in the
     13      1.1     ozaki #    documentation and/or other materials provided with the distribution.
     14      1.1     ozaki #
     15      1.1     ozaki # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     16      1.1     ozaki # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     17      1.1     ozaki # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     18      1.1     ozaki # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     19      1.1     ozaki # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     20      1.1     ozaki # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     21      1.1     ozaki # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     22      1.1     ozaki # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     23      1.1     ozaki # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     24      1.1     ozaki # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     25      1.1     ozaki # POSSIBILITY OF SUCH DAMAGE.
     26      1.1     ozaki #
     27      1.1     ozaki 
     28  1.1.2.3  pgoyette SERVER=unix://pppoe_server
     29  1.1.2.3  pgoyette CLIENT=unix://pppoe_client
     30      1.1     ozaki 
     31      1.1     ozaki SERVER_IP=10.3.3.1
     32      1.1     ozaki CLIENT_IP=10.3.3.3
     33  1.1.2.1  pgoyette SERVER_IP6=fc00::1
     34  1.1.2.1  pgoyette CLIENT_IP6=fc00::3
     35      1.1     ozaki AUTHNAME=foobar@baz.com
     36      1.1     ozaki SECRET=oink
     37      1.1     ozaki BUS=bus0
     38      1.1     ozaki TIMEOUT=3
     39  1.1.2.2  pgoyette WAITTIME=10
     40  1.1.2.2  pgoyette DEBUG=${DEBUG:-false}
     41      1.1     ozaki 
     42      1.1     ozaki atf_test_case pap cleanup
     43      1.1     ozaki 
     44      1.1     ozaki setup()
     45      1.1     ozaki {
     46  1.1.2.1  pgoyette 	inet=true
     47  1.1.2.1  pgoyette 
     48  1.1.2.1  pgoyette 	if [ $# -ne 0 ]; then
     49  1.1.2.1  pgoyette 		eval $@
     50  1.1.2.1  pgoyette 	fi
     51  1.1.2.1  pgoyette 
     52  1.1.2.3  pgoyette 	rump_server_start $SERVER netinet6 pppoe
     53  1.1.2.3  pgoyette 	rump_server_start $CLIENT netinet6 pppoe
     54  1.1.2.3  pgoyette 
     55  1.1.2.3  pgoyette 	rump_server_add_iface $SERVER shmif0 $BUS
     56  1.1.2.3  pgoyette 	rump_server_add_iface $CLIENT shmif0 $BUS
     57      1.1     ozaki 
     58      1.1     ozaki 	export RUMP_SERVER=$SERVER
     59      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 up
     60      1.1     ozaki 
     61      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 create
     62  1.1.2.1  pgoyette 	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
     63  1.1.2.1  pgoyette 	    inet $SERVER_IP $CLIENT_IP down
     64      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 link0
     65      1.1     ozaki 
     66      1.1     ozaki 	$DEBUG && rump.ifconfig
     67      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
     68      1.1     ozaki 
     69      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
     70      1.1     ozaki 	unset RUMP_SERVER
     71      1.1     ozaki 
     72      1.1     ozaki 	export RUMP_SERVER=$CLIENT
     73      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 up
     74      1.1     ozaki 
     75      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 create
     76  1.1.2.1  pgoyette 	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
     77  1.1.2.1  pgoyette 	    inet 0.0.0.0 0.0.0.1 down
     78      1.1     ozaki 
     79      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
     80      1.1     ozaki 	unset RUMP_SERVER
     81      1.1     ozaki }
     82      1.1     ozaki wait_for_session_established()
     83      1.1     ozaki {
     84      1.1     ozaki 	local dontfail=$1
     85      1.1     ozaki 	local n=$WAITTIME
     86      1.1     ozaki 
     87      1.1     ozaki 	for i in $(seq $n); do
     88      1.1     ozaki 		$HIJACKING pppoectl -d pppoe0 |grep -q "state = session"
     89      1.1     ozaki 		[ $? = 0 ] && return
     90      1.1     ozaki 		sleep 1
     91      1.1     ozaki 	done
     92      1.1     ozaki 
     93  1.1.2.1  pgoyette 	if [ "$dontfail" != "dontfail" ]; then
     94      1.1     ozaki 		atf_fail "Couldn't connect to the server for $n seconds."
     95      1.1     ozaki 	fi
     96      1.1     ozaki }
     97      1.1     ozaki 
     98  1.1.2.1  pgoyette wait_for_disconnected()
     99  1.1.2.1  pgoyette {
    100  1.1.2.1  pgoyette 	local dontfail=$1
    101  1.1.2.1  pgoyette 	local n=$WAITTIME
    102  1.1.2.1  pgoyette 
    103  1.1.2.1  pgoyette 	for i in $(seq $n); do
    104  1.1.2.2  pgoyette 		$HIJACKING pppoectl -d pppoe0 | grep -q "state = initial"
    105  1.1.2.2  pgoyette 		[ $? = 0 ] && return
    106  1.1.2.2  pgoyette 		# If PPPoE client is disconnected by PPPoE server and then
    107  1.1.2.2  pgoyette 		# the client kicks callout of pppoe_timeout(), the client
    108  1.1.2.2  pgoyette 		# state is changed to PPPOE_STATE_PADI_SENT while padi retrying.
    109  1.1.2.2  pgoyette 		$HIJACKING pppoectl -d pppoe0 | grep -q "state = PADI sent"
    110  1.1.2.2  pgoyette 		[ $? = 0 ] && return
    111  1.1.2.2  pgoyette 
    112  1.1.2.1  pgoyette 		sleep 1
    113  1.1.2.1  pgoyette 	done
    114  1.1.2.1  pgoyette 
    115  1.1.2.1  pgoyette 	if [ "$dontfail" != "dontfail" ]; then
    116  1.1.2.1  pgoyette 		atf_fail "Couldn't disconnect for $n seconds."
    117  1.1.2.1  pgoyette 	fi
    118  1.1.2.1  pgoyette }
    119  1.1.2.1  pgoyette 
    120  1.1.2.1  pgoyette run_test()
    121      1.1     ozaki {
    122      1.1     ozaki 	local auth=pap
    123      1.1     ozaki 	setup
    124      1.1     ozaki 
    125      1.1     ozaki 	export RUMP_SERVER=$SERVER
    126      1.1     ozaki 	local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
    127      1.1     ozaki 				    'hisauthname=$AUTHNAME' \
    128      1.1     ozaki 				    'hisauthsecret=$SECRET' \
    129      1.1     ozaki 				    'myauthproto=none'"
    130      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
    131      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    132      1.1     ozaki 	unset RUMP_SERVER
    133      1.1     ozaki 
    134      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    135      1.1     ozaki 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    136      1.1     ozaki 				    'myauthname=$AUTHNAME' \
    137      1.1     ozaki 				    'myauthsecret=$SECRET' \
    138      1.1     ozaki 				    'hisauthproto=none'"
    139      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    140      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    141      1.1     ozaki 	$DEBUG && rump.ifconfig
    142      1.1     ozaki 	wait_for_session_established
    143      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    144      1.1     ozaki 	unset RUMP_SERVER
    145      1.1     ozaki 
    146      1.1     ozaki 	# test for disconnection from server
    147  1.1.2.2  pgoyette 	export RUMP_SERVER=$SERVER
    148  1.1.2.2  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    149  1.1.2.2  pgoyette 	wait_for_disconnected
    150      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    151  1.1.2.2  pgoyette 	wait_for_disconnected
    152      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    153      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    154      1.1     ozaki 	atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0"
    155      1.1     ozaki 	unset RUMP_SERVER
    156      1.1     ozaki 
    157      1.1     ozaki 	# test for recoonecting
    158      1.1     ozaki 	atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 up"
    159      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    160      1.1     ozaki 	wait_for_session_established
    161      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    162      1.1     ozaki 	unset RUMP_SERVER
    163      1.1     ozaki 
    164      1.1     ozaki 	# test for disconnection from client
    165  1.1.2.2  pgoyette 	export RUMP_SERVER=$CLIENT
    166  1.1.2.2  pgoyette 	atf_check -s exit:0 -x rump.ifconfig pppoe0 down
    167  1.1.2.2  pgoyette 	wait_for_disconnected
    168      1.1     ozaki 	export RUMP_SERVER=$SERVER
    169  1.1.2.2  pgoyette 	wait_for_disconnected
    170      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    171      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    172      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
    173      1.1     ozaki 	atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
    174      1.1     ozaki 	unset RUMP_SERVER
    175      1.1     ozaki 
    176  1.1.2.1  pgoyette 	# test for reconnecting
    177      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    178      1.1     ozaki 	atf_check -s exit:0 -x rump.ifconfig pppoe0 up
    179      1.1     ozaki 	wait_for_session_established
    180      1.1     ozaki 	$DEBUG && rump.ifconfig pppoe0
    181      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    182      1.1     ozaki 	unset RUMP_SERVER
    183      1.1     ozaki 
    184      1.1     ozaki 	export RUMP_SERVER=$SERVER
    185  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig -w 10
    186      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
    187      1.1     ozaki 	atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
    188      1.1     ozaki 	$DEBUG && HIJACKING pppoectl -d pppoe0
    189      1.1     ozaki 	unset RUMP_SERVER
    190      1.1     ozaki 
    191      1.1     ozaki 	# test for invalid password
    192      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    193      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    194  1.1.2.2  pgoyette 	wait_for_disconnected
    195      1.1     ozaki 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    196      1.1     ozaki 				    'myauthname=$AUTHNAME' \
    197      1.1     ozaki 				    'myauthsecret=invalidsecret' \
    198      1.1     ozaki 				    'hisauthproto=none'"
    199      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    200      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    201      1.1     ozaki 	wait_for_session_established dontfail
    202      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    203      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    204  1.1.2.2  pgoyette 	atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0
    205      1.1     ozaki 	unset RUMP_SERVER
    206      1.1     ozaki }
    207      1.1     ozaki 
    208  1.1.2.1  pgoyette atf_test_case pppoe_pap cleanup
    209  1.1.2.1  pgoyette 
    210  1.1.2.1  pgoyette pppoe_pap_head()
    211  1.1.2.1  pgoyette {
    212  1.1.2.1  pgoyette 	atf_set "descr" "Does simple pap tests"
    213  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    214  1.1.2.1  pgoyette }
    215  1.1.2.1  pgoyette 
    216  1.1.2.1  pgoyette pppoe_pap_body()
    217  1.1.2.1  pgoyette {
    218  1.1.2.1  pgoyette 	run_test pap
    219  1.1.2.1  pgoyette }
    220  1.1.2.1  pgoyette 
    221  1.1.2.1  pgoyette pppoe_pap_cleanup()
    222  1.1.2.1  pgoyette {
    223  1.1.2.3  pgoyette 
    224  1.1.2.3  pgoyette 	$DEBUG && dump
    225  1.1.2.1  pgoyette 	cleanup
    226  1.1.2.1  pgoyette }
    227  1.1.2.1  pgoyette 
    228  1.1.2.1  pgoyette atf_test_case pppoe_chap cleanup
    229  1.1.2.1  pgoyette 
    230  1.1.2.1  pgoyette pppoe_chap_head()
    231  1.1.2.1  pgoyette {
    232  1.1.2.1  pgoyette 	atf_set "descr" "Does simple chap tests"
    233  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    234  1.1.2.1  pgoyette }
    235  1.1.2.1  pgoyette 
    236  1.1.2.1  pgoyette pppoe_chap_body()
    237  1.1.2.1  pgoyette {
    238  1.1.2.1  pgoyette 	run_test chap
    239  1.1.2.1  pgoyette }
    240  1.1.2.1  pgoyette 
    241  1.1.2.1  pgoyette pppoe_chap_cleanup()
    242  1.1.2.1  pgoyette {
    243  1.1.2.3  pgoyette 
    244  1.1.2.3  pgoyette 	$DEBUG && dump
    245  1.1.2.1  pgoyette 	cleanup
    246  1.1.2.1  pgoyette }
    247  1.1.2.1  pgoyette 
    248  1.1.2.1  pgoyette run_test6()
    249  1.1.2.1  pgoyette {
    250  1.1.2.1  pgoyette 	local auth=$1
    251  1.1.2.1  pgoyette 	setup "inet=false"
    252  1.1.2.1  pgoyette 
    253  1.1.2.1  pgoyette 	# As pppoe client doesn't support rechallenge yet.
    254  1.1.2.1  pgoyette 	local server_optparam=""
    255  1.1.2.1  pgoyette 	if [ $auth = "chap" ]; then
    256  1.1.2.1  pgoyette 		server_optparam="norechallenge"
    257  1.1.2.1  pgoyette 	fi
    258  1.1.2.1  pgoyette 
    259  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    260  1.1.2.1  pgoyette 	local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
    261  1.1.2.1  pgoyette 				    'hisauthname=$AUTHNAME' \
    262  1.1.2.1  pgoyette 				    'hisauthsecret=$SECRET' \
    263  1.1.2.1  pgoyette 				    'myauthproto=none' \
    264  1.1.2.1  pgoyette 				    $server_optparam"
    265  1.1.2.1  pgoyette 	atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
    266  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $SERVER_IP6/64 down
    267  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    268  1.1.2.1  pgoyette 	unset RUMP_SERVER
    269  1.1.2.1  pgoyette 
    270  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    271  1.1.2.1  pgoyette 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    272  1.1.2.1  pgoyette 				    'myauthname=$AUTHNAME' \
    273  1.1.2.1  pgoyette 				    'myauthsecret=$SECRET' \
    274  1.1.2.1  pgoyette 				    'hisauthproto=none'"
    275  1.1.2.1  pgoyette 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    276  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $CLIENT_IP6/64 down
    277  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    278  1.1.2.1  pgoyette 	$DEBUG && rump.ifconfig
    279  1.1.2.1  pgoyette 	wait_for_session_established
    280  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
    281  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    282  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
    283  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    284  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
    285  1.1.2.1  pgoyette 	unset RUMP_SERVER
    286  1.1.2.1  pgoyette 
    287  1.1.2.1  pgoyette 	# test for disconnection from server
    288  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    289  1.1.2.1  pgoyette 	session_id=`$HIJACKING pppoectl -d pppoe0 | grep state`
    290  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    291  1.1.2.1  pgoyette 	wait_for_disconnected
    292  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    293  1.1.2.1  pgoyette 	wait_for_disconnected
    294  1.1.2.1  pgoyette 	atf_check -s not-exit:0 -o ignore -e ignore \
    295  1.1.2.2  pgoyette 	    rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
    296  1.1.2.1  pgoyette 	atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0"
    297  1.1.2.1  pgoyette 	unset RUMP_SERVER
    298  1.1.2.1  pgoyette 
    299  1.1.2.1  pgoyette 	# test for recoonecting
    300  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    301  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    302  1.1.2.1  pgoyette 	wait_for_session_established
    303  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig -w 10
    304  1.1.2.1  pgoyette 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    305  1.1.2.1  pgoyette 	$DEBUG && rump.ifconfig pppoe0
    306  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    307  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
    308  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
    309  1.1.2.1  pgoyette 	unset RUMP_SERVER
    310  1.1.2.1  pgoyette 
    311  1.1.2.1  pgoyette 	# test for disconnection from client
    312  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    313  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    314  1.1.2.1  pgoyette 	wait_for_disconnected
    315  1.1.2.1  pgoyette 
    316  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    317  1.1.2.1  pgoyette 	wait_for_disconnected
    318  1.1.2.2  pgoyette 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    319  1.1.2.1  pgoyette 	atf_check -s not-exit:0 -o ignore -e ignore \
    320  1.1.2.1  pgoyette 	    rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6
    321  1.1.2.1  pgoyette 	atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
    322  1.1.2.1  pgoyette 	unset RUMP_SERVER
    323  1.1.2.1  pgoyette 
    324  1.1.2.1  pgoyette 	# test for reconnecting
    325  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    326  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    327  1.1.2.1  pgoyette 	wait_for_session_established
    328  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig -w 10
    329  1.1.2.1  pgoyette 
    330  1.1.2.1  pgoyette 	$DEBUG && rump.ifconfig pppoe0
    331  1.1.2.1  pgoyette 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    332  1.1.2.1  pgoyette 	unset RUMP_SERVER
    333  1.1.2.1  pgoyette 
    334  1.1.2.1  pgoyette 	export RUMP_SERVER=$SERVER
    335  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig -w 10
    336  1.1.2.1  pgoyette 	atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $CLIENT_IP6
    337  1.1.2.1  pgoyette 	atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
    338  1.1.2.1  pgoyette 	$DEBUG && HIJACKING pppoectl -d pppoe0
    339  1.1.2.1  pgoyette 	unset RUMP_SERVER
    340  1.1.2.1  pgoyette 
    341  1.1.2.1  pgoyette 	# test for invalid password
    342  1.1.2.1  pgoyette 	export RUMP_SERVER=$CLIENT
    343  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    344  1.1.2.1  pgoyette 	wait_for_disconnected
    345  1.1.2.1  pgoyette 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    346  1.1.2.1  pgoyette 				    'myauthname=$AUTHNAME' \
    347  1.1.2.1  pgoyette 				    'myauthsecret=invalidsecret' \
    348  1.1.2.1  pgoyette 				    'hisauthproto=none'"
    349  1.1.2.1  pgoyette 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    350  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    351  1.1.2.1  pgoyette 	wait_for_session_established dontfail
    352  1.1.2.1  pgoyette 	atf_check -s not-exit:0 -o ignore -e ignore \
    353  1.1.2.1  pgoyette 	    rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
    354  1.1.2.1  pgoyette 	atf_check -s exit:0 -o match:'DETACHED' rump.ifconfig pppoe0
    355  1.1.2.1  pgoyette 	unset RUMP_SERVER
    356  1.1.2.1  pgoyette }
    357  1.1.2.1  pgoyette 
    358  1.1.2.1  pgoyette atf_test_case pppoe6_pap cleanup
    359  1.1.2.1  pgoyette 
    360  1.1.2.1  pgoyette pppoe6_pap_head()
    361  1.1.2.1  pgoyette {
    362  1.1.2.1  pgoyette 	atf_set "descr" "Does simple pap using IPv6 tests"
    363  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    364  1.1.2.1  pgoyette }
    365  1.1.2.1  pgoyette 
    366  1.1.2.1  pgoyette pppoe6_pap_body()
    367  1.1.2.1  pgoyette {
    368  1.1.2.1  pgoyette 	run_test6 pap
    369  1.1.2.1  pgoyette }
    370  1.1.2.1  pgoyette 
    371  1.1.2.1  pgoyette pppoe6_pap_cleanup()
    372      1.1     ozaki {
    373  1.1.2.3  pgoyette 
    374  1.1.2.3  pgoyette 	$DEBUG && dump
    375      1.1     ozaki 	cleanup
    376      1.1     ozaki }
    377  1.1.2.1  pgoyette 
    378  1.1.2.1  pgoyette atf_test_case pppoe6_chap cleanup
    379  1.1.2.1  pgoyette 
    380  1.1.2.1  pgoyette pppoe6_chap_head()
    381  1.1.2.1  pgoyette {
    382  1.1.2.1  pgoyette 	atf_set "descr" "Does simple chap using IPv6 tests"
    383  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    384  1.1.2.1  pgoyette }
    385  1.1.2.1  pgoyette 
    386  1.1.2.1  pgoyette pppoe6_chap_body()
    387  1.1.2.1  pgoyette {
    388  1.1.2.1  pgoyette 	run_test6 chap
    389  1.1.2.1  pgoyette }
    390  1.1.2.1  pgoyette 
    391  1.1.2.1  pgoyette pppoe6_chap_cleanup()
    392  1.1.2.1  pgoyette {
    393  1.1.2.3  pgoyette 
    394  1.1.2.3  pgoyette 	$DEBUG && dump
    395  1.1.2.1  pgoyette 	cleanup
    396  1.1.2.1  pgoyette }
    397  1.1.2.1  pgoyette 
    398      1.1     ozaki atf_init_test_cases()
    399      1.1     ozaki {
    400  1.1.2.1  pgoyette 	atf_add_test_case pppoe_pap
    401  1.1.2.1  pgoyette 	atf_add_test_case pppoe_chap
    402  1.1.2.1  pgoyette 	atf_add_test_case pppoe6_pap
    403  1.1.2.1  pgoyette 	atf_add_test_case pppoe6_chap
    404      1.1     ozaki }
    405