From patchwork Thu Jun 14 12:46:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 929421 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4163KJ5D6yz9s2g for ; Thu, 14 Jun 2018 22:46:44 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 233E11A9AC7 for ; Thu, 14 Jun 2018 14:46:42 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id F2BCC1A98B4 for ; Thu, 14 Jun 2018 14:46:37 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 659EB140148D for ; Thu, 14 Jun 2018 14:46:35 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 37518AC2F; Thu, 14 Jun 2018 12:46:35 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 14 Jun 2018 14:46:26 +0200 Message-Id: <20180614124627.14344-1-pvorel@suse.cz> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Cc: Sun Lianwen Subject: [LTP] [PATCH 1/2] net: Create tst_ipsec_setup to remove duplicity X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Petr Vorel --- Another small cleanup found while working on migrating tests into new API. Kind regards, Petr --- testcases/network/stress/dccp/dccp_ipsec.sh | 11 +---------- testcases/network/stress/icmp/icmp-uni-basic.sh | 10 ++-------- testcases/network/stress/ipsec/ipsec_lib.sh | 9 +++++++++ testcases/network/stress/sctp/sctp_ipsec.sh | 11 +---------- testcases/network/stress/tcp/tcp_ipsec.sh | 11 +---------- testcases/network/stress/udp/udp_ipsec.sh | 11 +---------- 6 files changed, 15 insertions(+), 48 deletions(-) diff --git a/testcases/network/stress/dccp/dccp_ipsec.sh b/testcases/network/stress/dccp/dccp_ipsec.sh index 6c39fa39d..624f8e0af 100755 --- a/testcases/network/stress/dccp/dccp_ipsec.sh +++ b/testcases/network/stress/dccp/dccp_ipsec.sh @@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup" . ipsec_lib.sh -do_setup() -{ - # Configure SAD/SPD - if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then - tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) - tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) - fi -} - do_test() { for p in $IPSEC_SIZE_ARRAY; do @@ -40,7 +31,7 @@ do_test() done } -do_setup +tst_ipsec_setup do_test diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh index 78017ee7a..5fe6b9b13 100755 --- a/testcases/network/stress/icmp/icmp-uni-basic.sh +++ b/testcases/network/stress/icmp/icmp-uni-basic.sh @@ -26,15 +26,13 @@ TST_CLEANUP="tst_ipsec_cleanup" . ipsec_lib.sh LINK_NUM=${LINK_NUM:-0} -DO_IPSEC=${DO_IPSEC:-false} -[ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ] && DO_IPSEC=true || DO_IPSEC=false # Test description tst_resm TINFO "Sending ICMP messages with the following conditions" tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}" tst_resm TINFO "- Size of packets are ( $IPSEC_SIZE_ARRAY )" -if $DO_IPSEC; then +if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then case $IPSEC_PROTO in ah) tst_resm TINFO "- IPsec [ AH / $IPSEC_MODE ]" ;; esp) tst_resm TINFO "- IPsec [ ESP / $IPSEC_MODE ]" ;; @@ -49,11 +47,7 @@ rhost_ifname=$(tst_iface rhost $LINK_NUM) lhost_addr=$(tst_ipaddr) rhost_addr=$(tst_ipaddr rhost) -# Configure SAD/SPD -if $DO_IPSEC ; then - tst_ipsec lhost $lhost_addr $rhost_addr - tst_ipsec rhost $rhost_addr $lhost_addr -fi +tst_ipsec_setup PING_MAX="$IPSEC_REQUESTS" diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh index 480fe064a..2e001c718 100644 --- a/testcases/network/stress/ipsec/ipsec_lib.sh +++ b/testcases/network/stress/ipsec/ipsec_lib.sh @@ -111,6 +111,15 @@ cleanup_vti= ALG= ALGR= +tst_ipsec_setup() +{ + # Configure SAD/SPD + if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then + tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) + tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) + fi +} + # tst_ipsec_cleanup: flush ipsec state and policy rules tst_ipsec_cleanup() { diff --git a/testcases/network/stress/sctp/sctp_ipsec.sh b/testcases/network/stress/sctp/sctp_ipsec.sh index 677ccbfed..5f99bc7df 100755 --- a/testcases/network/stress/sctp/sctp_ipsec.sh +++ b/testcases/network/stress/sctp/sctp_ipsec.sh @@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup" . ipsec_lib.sh -do_setup() -{ - # Configure SAD/SPD - if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then - tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) - tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) - fi -} - do_test() { for p in $IPSEC_SIZE_ARRAY; do @@ -40,7 +31,7 @@ do_test() done } -do_setup +tst_ipsec_setup do_test diff --git a/testcases/network/stress/tcp/tcp_ipsec.sh b/testcases/network/stress/tcp/tcp_ipsec.sh index aeb33d663..86f455532 100755 --- a/testcases/network/stress/tcp/tcp_ipsec.sh +++ b/testcases/network/stress/tcp/tcp_ipsec.sh @@ -25,15 +25,6 @@ max_requests=10 . ipsec_lib.sh -do_setup() -{ - # Configure SAD/SPD - if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then - tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) - tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) - fi -} - do_test() { for p in $IPSEC_SIZE_ARRAY; do @@ -42,7 +33,7 @@ do_test() done } -do_setup +tst_ipsec_setup do_test diff --git a/testcases/network/stress/udp/udp_ipsec.sh b/testcases/network/stress/udp/udp_ipsec.sh index 4ebf087a6..9b5ac07b2 100755 --- a/testcases/network/stress/udp/udp_ipsec.sh +++ b/testcases/network/stress/udp/udp_ipsec.sh @@ -23,15 +23,6 @@ TST_CLEANUP="tst_ipsec_cleanup" . ipsec_lib.sh -do_setup() -{ - # Configure SAD/SPD - if [ -n "$IPSEC_MODE" -a -n "$IPSEC_PROTO" ]; then - tst_ipsec lhost $(tst_ipaddr) $(tst_ipaddr rhost) - tst_ipsec rhost $(tst_ipaddr rhost) $(tst_ipaddr) - fi -} - do_test() { for p in $IPSEC_SIZE_ARRAY; do @@ -40,7 +31,7 @@ do_test() done } -do_setup +tst_ipsec_setup do_test udp do_test udp_lite From patchwork Thu Jun 14 12:46:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 929420 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4163KH16xZz9s2g for ; Thu, 14 Jun 2018 22:46:42 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 14EF31A9927 for ; Thu, 14 Jun 2018 14:46:39 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-4.smtp.seeweb.it (in-4.smtp.seeweb.it [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id EE14E1A98B3 for ; Thu, 14 Jun 2018 14:46:37 +0200 (CEST) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 9E2241001726 for ; Thu, 14 Jun 2018 14:46:36 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 506F1AC85; Thu, 14 Jun 2018 12:46:36 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 14 Jun 2018 14:46:27 +0200 Message-Id: <20180614124627.14344-2-pvorel@suse.cz> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180614124627.14344-1-pvorel@suse.cz> References: <20180614124627.14344-1-pvorel@suse.cz> X-Virus-Scanned: clamav-milter 0.99.2 at in-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=-0.0 required=7.0 tests=SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: Sun Lianwen Subject: [LTP] [PATCH 2/2] net/icmp-uni-basic.sh: Remove LINK_NUM setup X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" LINK_NUM should not be setup in the test. Signed-off-by: Petr Vorel --- testcases/network/stress/icmp/icmp-uni-basic.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/testcases/network/stress/icmp/icmp-uni-basic.sh b/testcases/network/stress/icmp/icmp-uni-basic.sh index 5fe6b9b13..7cdf0309a 100755 --- a/testcases/network/stress/icmp/icmp-uni-basic.sh +++ b/testcases/network/stress/icmp/icmp-uni-basic.sh @@ -25,8 +25,6 @@ TST_CLEANUP="tst_ipsec_cleanup" . ipsec_lib.sh -LINK_NUM=${LINK_NUM:-0} - # Test description tst_resm TINFO "Sending ICMP messages with the following conditions" tst_resm TINFO "- Version of IP is IPv${TST_IPV6:-4}"