Module Name:    src
Committed By:   knakahara
Date:           Tue Mar 13 03:50:26 UTC 2018

Modified Files:
        src/tests/net/if_ipsec: t_ipsec.sh

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/net/if_ipsec/t_ipsec.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_ipsec/t_ipsec.sh
diff -u src/tests/net/if_ipsec/t_ipsec.sh:1.3 src/tests/net/if_ipsec/t_ipsec.sh:1.4
--- src/tests/net/if_ipsec/t_ipsec.sh:1.3	Thu Feb  1 05:22:01 2018
+++ src/tests/net/if_ipsec/t_ipsec.sh	Tue Mar 13 03:50:26 2018
@@ -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 @@ setup_if_ipsec_sa()
 	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 @@ setup_dummy_if_ipsec_sa()
 	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"

Reply via email to