Home | History | Annotate | Line # | Download | only in if_pppoe
t_pppoe.sh revision 1.1.2.1
      1  1.1.2.1  pgoyette #	$NetBSD: t_pppoe.sh,v 1.1.2.1 2016/11/04 14:49:24 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     ozaki server="rump_server -lrump -lrumpnet -lrumpnet_net -lrumpnet_netinet \
     29      1.1     ozaki 		    -lrumpnet_netinet6 -lrumpnet_shmif -lrumpnet_pppoe"
     30      1.1     ozaki HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so"
     31      1.1     ozaki 
     32      1.1     ozaki SERVER=unix://commsock1
     33      1.1     ozaki CLIENT=unix://commsock2
     34      1.1     ozaki 
     35      1.1     ozaki SERVER_IP=10.3.3.1
     36      1.1     ozaki CLIENT_IP=10.3.3.3
     37  1.1.2.1  pgoyette SERVER_IP6=fc00::1
     38  1.1.2.1  pgoyette CLIENT_IP6=fc00::3
     39      1.1     ozaki AUTHNAME=foobar@baz.com
     40      1.1     ozaki SECRET=oink
     41      1.1     ozaki BUS=bus0
     42      1.1     ozaki TIMEOUT=3
     43      1.1     ozaki WAITTIME=5
     44      1.1     ozaki DEBUG=false
     45      1.1     ozaki 
     46      1.1     ozaki atf_test_case pap cleanup
     47      1.1     ozaki 
     48      1.1     ozaki setup()
     49      1.1     ozaki {
     50  1.1.2.1  pgoyette 	inet=true
     51  1.1.2.1  pgoyette 
     52  1.1.2.1  pgoyette 	if [ $# -ne 0 ]; then
     53  1.1.2.1  pgoyette 		eval $@
     54  1.1.2.1  pgoyette 	fi
     55  1.1.2.1  pgoyette 
     56      1.1     ozaki 	atf_check -s exit:0 ${server} $SERVER
     57      1.1     ozaki 	atf_check -s exit:0 ${server} $CLIENT
     58      1.1     ozaki 
     59      1.1     ozaki 	export RUMP_SERVER=$SERVER
     60      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 create
     61      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
     62      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 up
     63      1.1     ozaki 
     64      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 create
     65  1.1.2.1  pgoyette 	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
     66  1.1.2.1  pgoyette 	    inet $SERVER_IP $CLIENT_IP down
     67      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 link0
     68      1.1     ozaki 
     69      1.1     ozaki 	$DEBUG && rump.ifconfig
     70      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
     71      1.1     ozaki 
     72      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
     73      1.1     ozaki 	unset RUMP_SERVER
     74      1.1     ozaki 
     75      1.1     ozaki 	export RUMP_SERVER=$CLIENT
     76      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 create
     77      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 linkstr $BUS
     78      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig shmif0 up
     79      1.1     ozaki 
     80      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 create
     81  1.1.2.1  pgoyette 	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
     82  1.1.2.1  pgoyette 	    inet 0.0.0.0 0.0.0.1 down
     83      1.1     ozaki 
     84      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
     85      1.1     ozaki 	unset RUMP_SERVER
     86      1.1     ozaki }
     87      1.1     ozaki cleanup()
     88      1.1     ozaki {
     89      1.1     ozaki 	env RUMP_SERVER=$SERVER rump.halt
     90      1.1     ozaki 	env RUMP_SERVER=$CLIENT rump.halt
     91      1.1     ozaki }
     92      1.1     ozaki 
     93      1.1     ozaki pap_head()
     94      1.1     ozaki {
     95      1.1     ozaki 	atf_set "descr" "Does simple pap tests"
     96      1.1     ozaki 	atf_set "require.progs" "rump_server pppoectl"
     97      1.1     ozaki }
     98      1.1     ozaki 
     99      1.1     ozaki wait_for_session_established()
    100      1.1     ozaki {
    101      1.1     ozaki 	local dontfail=$1
    102      1.1     ozaki 	local n=$WAITTIME
    103      1.1     ozaki 
    104      1.1     ozaki 	for i in $(seq $n); do
    105      1.1     ozaki 		$HIJACKING pppoectl -d pppoe0 |grep -q "state = session"
    106      1.1     ozaki 		[ $? = 0 ] && return
    107      1.1     ozaki 		sleep 1
    108      1.1     ozaki 	done
    109      1.1     ozaki 
    110  1.1.2.1  pgoyette 	if [ "$dontfail" != "dontfail" ]; then
    111      1.1     ozaki 		atf_fail "Couldn't connect to the server for $n seconds."
    112      1.1     ozaki 	fi
    113      1.1     ozaki }
    114      1.1     ozaki 
    115  1.1.2.1  pgoyette wait_for_disconnected()
    116  1.1.2.1  pgoyette {
    117  1.1.2.1  pgoyette 	local dontfail=$1
    118  1.1.2.1  pgoyette 	local n=$WAITTIME
    119  1.1.2.1  pgoyette 
    120  1.1.2.1  pgoyette 	for i in $(seq $n); do
    121  1.1.2.1  pgoyette 		$HIJACKING pppoectl -d pppoe0 | grep -q "state = session"
    122  1.1.2.1  pgoyette 		[ $? -eq 0 ] || return
    123  1.1.2.1  pgoyette 		sleep 1
    124  1.1.2.1  pgoyette 	done
    125  1.1.2.1  pgoyette 
    126  1.1.2.1  pgoyette 	if [ "$dontfail" != "dontfail" ]; then
    127  1.1.2.1  pgoyette 		atf_fail "Couldn't disconnect for $n seconds."
    128  1.1.2.1  pgoyette 	fi
    129  1.1.2.1  pgoyette }
    130  1.1.2.1  pgoyette 
    131  1.1.2.1  pgoyette run_test()
    132      1.1     ozaki {
    133      1.1     ozaki 	local auth=pap
    134      1.1     ozaki 	setup
    135      1.1     ozaki 
    136      1.1     ozaki 	export RUMP_SERVER=$SERVER
    137      1.1     ozaki 	local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
    138      1.1     ozaki 				    'hisauthname=$AUTHNAME' \
    139      1.1     ozaki 				    'hisauthsecret=$SECRET' \
    140      1.1     ozaki 				    'myauthproto=none'"
    141      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
    142      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    143      1.1     ozaki 	unset RUMP_SERVER
    144      1.1     ozaki 
    145      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    146      1.1     ozaki 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    147      1.1     ozaki 				    'myauthname=$AUTHNAME' \
    148      1.1     ozaki 				    'myauthsecret=$SECRET' \
    149      1.1     ozaki 				    'hisauthproto=none'"
    150      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    151      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    152      1.1     ozaki 	$DEBUG && rump.ifconfig
    153      1.1     ozaki 	wait_for_session_established
    154      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    155      1.1     ozaki 	unset RUMP_SERVER
    156      1.1     ozaki 
    157      1.1     ozaki 	# test for disconnection from server
    158      1.1     ozaki 	atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 down"
    159      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    160      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    161      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    162      1.1     ozaki 	atf_check -s exit:0 -o match:'PADI sent' -x "$HIJACKING pppoectl -d pppoe0"
    163      1.1     ozaki 	unset RUMP_SERVER
    164      1.1     ozaki 
    165      1.1     ozaki 	# test for recoonecting
    166      1.1     ozaki 	atf_check -s exit:0 -x "env RUMP_SERVER=$SERVER rump.ifconfig pppoe0 up"
    167      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    168      1.1     ozaki 	wait_for_session_established
    169      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    170      1.1     ozaki 	unset RUMP_SERVER
    171      1.1     ozaki 
    172      1.1     ozaki 	# test for disconnection from client
    173      1.1     ozaki 	atf_check -s exit:0 -x "env RUMP_SERVER=$CLIENT rump.ifconfig pppoe0 down"
    174      1.1     ozaki 	export RUMP_SERVER=$SERVER
    175      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    176      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    177      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
    178      1.1     ozaki 	atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
    179      1.1     ozaki 	unset RUMP_SERVER
    180      1.1     ozaki 
    181  1.1.2.1  pgoyette 	# test for reconnecting
    182      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    183      1.1     ozaki 	atf_check -s exit:0 -x rump.ifconfig pppoe0 up
    184      1.1     ozaki 	wait_for_session_established
    185      1.1     ozaki 	$DEBUG && rump.ifconfig pppoe0
    186      1.1     ozaki 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    187      1.1     ozaki 	unset RUMP_SERVER
    188      1.1     ozaki 
    189      1.1     ozaki 	export RUMP_SERVER=$SERVER
    190  1.1.2.1  pgoyette 	atf_check -s exit:0 rump.ifconfig -w 10
    191      1.1     ozaki 	atf_check -s exit:0 -o ignore rump.ping -c 1 -w $TIMEOUT $CLIENT_IP
    192      1.1     ozaki 	atf_check -s exit:0 -o match:'session' -x "$HIJACKING pppoectl -d pppoe0"
    193      1.1     ozaki 	$DEBUG && HIJACKING pppoectl -d pppoe0
    194      1.1     ozaki 	unset RUMP_SERVER
    195      1.1     ozaki 
    196      1.1     ozaki 	# test for invalid password
    197      1.1     ozaki 	export RUMP_SERVER=$CLIENT
    198      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 down
    199      1.1     ozaki 	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
    200      1.1     ozaki 				    'myauthname=$AUTHNAME' \
    201      1.1     ozaki 				    'myauthsecret=invalidsecret' \
    202      1.1     ozaki 				    'hisauthproto=none'"
    203      1.1     ozaki 	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
    204      1.1     ozaki 	atf_check -s exit:0 rump.ifconfig pppoe0 up
    205      1.1     ozaki 	wait_for_session_established dontfail
    206      1.1     ozaki 	atf_check -s not-exit:0 -o ignore -e ignore \
    207      1.1     ozaki 	    rump.ping -c 1 -w $TIMEOUT $SERVER_IP
    208      1.1     ozaki 	atf_check -s exit:0 -o match:'initial' -x "$HIJACKING pppoectl -d pppoe0"
    209      1.1     ozaki 	unset RUMP_SERVER
    210      1.1     ozaki }
    211      1.1     ozaki 
    212  1.1.2.1  pgoyette atf_test_case pppoe_pap cleanup
    213  1.1.2.1  pgoyette 
    214  1.1.2.1  pgoyette pppoe_pap_head()
    215  1.1.2.1  pgoyette {
    216  1.1.2.1  pgoyette 	atf_set "descr" "Does simple pap tests"
    217  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    218  1.1.2.1  pgoyette }
    219  1.1.2.1  pgoyette 
    220  1.1.2.1  pgoyette pppoe_pap_body()
    221  1.1.2.1  pgoyette {
    222  1.1.2.1  pgoyette 	run_test pap
    223  1.1.2.1  pgoyette }
    224  1.1.2.1  pgoyette 
    225  1.1.2.1  pgoyette pppoe_pap_cleanup()
    226  1.1.2.1  pgoyette {
    227  1.1.2.1  pgoyette 	cleanup
    228  1.1.2.1  pgoyette }
    229  1.1.2.1  pgoyette 
    230  1.1.2.1  pgoyette atf_test_case pppoe_chap cleanup
    231  1.1.2.1  pgoyette 
    232  1.1.2.1  pgoyette pppoe_chap_head()
    233  1.1.2.1  pgoyette {
    234  1.1.2.1  pgoyette 	atf_set "descr" "Does simple chap tests"
    235  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    236  1.1.2.1  pgoyette }
    237  1.1.2.1  pgoyette 
    238  1.1.2.1  pgoyette pppoe_chap_body()
    239  1.1.2.1  pgoyette {
    240  1.1.2.1  pgoyette 	run_test chap
    241  1.1.2.1  pgoyette }
    242  1.1.2.1  pgoyette 
    243  1.1.2.1  pgoyette pppoe_chap_cleanup()
    244  1.1.2.1  pgoyette {
    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.1  pgoyette 	    rump.ping6 -c 1 -w $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 	$DEBUG && $HIJACKING pppoectl -d pppoe0
    318  1.1.2.1  pgoyette 	wait_for_disconnected
    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     ozaki 	cleanup
    374      1.1     ozaki }
    375  1.1.2.1  pgoyette 
    376  1.1.2.1  pgoyette atf_test_case pppoe6_chap cleanup
    377  1.1.2.1  pgoyette 
    378  1.1.2.1  pgoyette pppoe6_chap_head()
    379  1.1.2.1  pgoyette {
    380  1.1.2.1  pgoyette 	atf_set "descr" "Does simple chap using IPv6 tests"
    381  1.1.2.1  pgoyette 	atf_set "require.progs" "rump_server pppoectl"
    382  1.1.2.1  pgoyette }
    383  1.1.2.1  pgoyette 
    384  1.1.2.1  pgoyette pppoe6_chap_body()
    385  1.1.2.1  pgoyette {
    386  1.1.2.1  pgoyette 	run_test6 chap
    387  1.1.2.1  pgoyette }
    388  1.1.2.1  pgoyette 
    389  1.1.2.1  pgoyette pppoe6_chap_cleanup()
    390  1.1.2.1  pgoyette {
    391  1.1.2.1  pgoyette 	cleanup
    392  1.1.2.1  pgoyette }
    393  1.1.2.1  pgoyette 
    394      1.1     ozaki atf_init_test_cases()
    395      1.1     ozaki {
    396  1.1.2.1  pgoyette 	atf_add_test_case pppoe_pap
    397  1.1.2.1  pgoyette 	atf_add_test_case pppoe_chap
    398  1.1.2.1  pgoyette 	atf_add_test_case pppoe6_pap
    399  1.1.2.1  pgoyette 	atf_add_test_case pppoe6_chap
    400      1.1     ozaki }
    401