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
 

Reply via email to