Tue Mar 13 03:50:26 2018 UTC ()
Enhance assertion ipsecif(4) ATF to avoid confusing setkey(8) error message.

When setkey(8) says "syntax error at [-E]", it must mean get_if_ipsec_unique()
failed.


(knakahara)
diff -r1.3 -r1.4 src/tests/net/if_ipsec/t_ipsec.sh

cvs diff -r1.3 -r1.4 src/tests/net/if_ipsec/t_ipsec.sh (expand / switch to context diff)
--- src/tests/net/if_ipsec/t_ipsec.sh 2018/02/01 05:22:01 1.3
+++ src/tests/net/if_ipsec/t_ipsec.sh 2018/03/13 03:50:26 1.4
@@ -1,4 +1,4 @@
-#	$NetBSD: t_ipsec.sh,v 1.3 2018/02/01 05:22:01 ozaki-r Exp $
+#	$NetBSD: t_ipsec.sh,v 1.4 2018/03/13 03:50:26 knakahara Exp $
 #
 # Copyright (c) 2017 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -269,7 +269,9 @@
 	local algo_args="$(generate_algo_args $proto $algo)"
 
 	inunique=`get_if_ipsec_unique ${sock} ${dst} ${mode}`
+	atf_check -s exit:0 test "X$inunique" != "X"
 	outunique=`get_if_ipsec_unique ${sock} ${src} ${mode}`
+	atf_check -s exit:0 test "X$outunique" != "X"
 
 	if [ ${dir} = "1to2" ] ; then
 	    if [ ${mode} = "ipv6" ] ; then
@@ -446,7 +448,9 @@
 	local algo_args="$(generate_algo_args $proto $algo)"
 
 	inunique=`get_if_ipsec_unique ${sock} ${dst} ${mode}`
+	atf_check -s exit:0 test "X$inunique" != "X"
 	outunique=`get_if_ipsec_unique ${sock} ${src} ${mode}`
+	atf_check -s exit:0 test "X$outunique" != "X"
 
 	if [ ${dir} = "1to2" ] ; then
 	    inid="20000"