Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/net/if_ipsec Enhance assertion ipsecif(4) ATF to avoid...



details:   https://anonhg.NetBSD.org/src/rev/349fa41c4981
branches:  trunk
changeset: 321355:349fa41c4981
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Tue Mar 13 03:50:26 2018 +0000

description:
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.

diffstat:

 tests/net/if_ipsec/t_ipsec.sh |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (29 lines):

diff -r 82759c6621cc -r 349fa41c4981 tests/net/if_ipsec/t_ipsec.sh
--- a/tests/net/if_ipsec/t_ipsec.sh     Tue Mar 13 03:17:01 2018 +0000
+++ b/tests/net/if_ipsec/t_ipsec.sh     Tue Mar 13 03:50:26 2018 +0000
@@ -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"



Home | Main Index | Thread Index | Old Index