From patchwork Thu Nov 8 13:58:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 994893 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42rPy61WdCz9s7T for ; Fri, 9 Nov 2018 00:58:22 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 76FD13E769F for ; Thu, 8 Nov 2018 14:58:19 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id D605A3E7483 for ; Thu, 8 Nov 2018 14:58:13 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 3BD86601D0F for ; Thu, 8 Nov 2018 14:58:11 +0100 (CET) Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 36290B03B; Thu, 8 Nov 2018 13:58:11 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 8 Nov 2018 14:58:03 +0100 Message-Id: <20181108135804.32448-1-pvorel@suse.cz> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.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-2.smtp.seeweb.it Subject: [LTP] [RFC PATCH 1/2] net: Add tst_net_run helper 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Signed-off-by: Petr Vorel --- Changes v1->v2: tst_net_driver removed and created generic command tst_net_run TODO: For ROD it does not handle escape for >. E.g. it'd be nice to handle this: ROD foo \> bar.log as passing the escape will not work for sh (non-safe local) and for tst_rhost_run. Do we care? Kind regards, Petr --- testcases/lib/tst_net.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index d1206e285..ff5c58c3c 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -191,6 +191,23 @@ tst_rhost_run() return $ret } +# Run command on both lhost and rhost. +# tst_net_run [-s] CMD [ARG [ARG2]] +tst_net_run() +{ + local safe + local OPTIND + while getopts s opt; do + case "$opt" in + s) safe="-s" ;; + *) tst_brk_ TBROK "tst_net_run: unknown option: $OPTARG" ;; + esac + done + shift $((OPTIND - 1)) + [ -n "$safe" ] && ROD $@ || sh -c $@ + tst_rhost_run $safe -c "$@" +} + EXPECT_RHOST_PASS() { tst_rhost_run -c "$*" > /dev/null From patchwork Thu Nov 8 13:58:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 994891 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42rPy23mP9z9s7T for ; Fri, 9 Nov 2018 00:58:18 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6BE263E74F6 for ; Thu, 8 Nov 2018 14:58:15 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id DB5BB3E7486 for ; Thu, 8 Nov 2018 14:58:13 +0100 (CET) Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 7A699601D15 for ; Thu, 8 Nov 2018 14:58:12 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1B0CCB061; Thu, 8 Nov 2018 13:58:12 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 8 Nov 2018 14:58:04 +0100 Message-Id: <20181108135804.32448-2-pvorel@suse.cz> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108135804.32448-1-pvorel@suse.cz> References: <20181108135804.32448-1-pvorel@suse.cz> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.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-2.smtp.seeweb.it Subject: [LTP] [RFC PATCH 2/2] net/ipsec: Add check for xfrm_user 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: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" which is required by ip xfrm command. As ipsec_lib.sh is used for other commands than it, check it only when used. Call in cleanup function could trigger infinite loop, therefore check only once. Signed-off-by: Petr Vorel --- testcases/network/stress/ipsec/ipsec_lib.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh index b099fdeaf..a9ac5bc50 100644 --- a/testcases/network/stress/ipsec/ipsec_lib.sh +++ b/testcases/network/stress/ipsec/ipsec_lib.sh @@ -89,6 +89,14 @@ TST_SETUP=${TST_SETUP:-ipsec_lib_setup} TST_USAGE=ipsec_lib_usage . tst_net.sh +tst_ipsec_check_driver() +{ + if [ -z "$ipsec_driver_checked" ]; then + export ipsec_driver_checked=1 + tst_net_run "tst_test_drivers xfrm_user" + fi +} + get_key() { local bits=$1 @@ -110,6 +118,7 @@ tst_ipsec_setup() # tst_ipsec_cleanup: flush ipsec state and policy rules tst_ipsec_cleanup() { + tst_ipsec_check_driver ip xfrm state flush ip xfrm policy flush tst_rhost_run -c "ip xfrm state flush && ip xfrm policy flush" @@ -175,6 +184,7 @@ tst_ipsec() local p="proto $IPSEC_PROTO" [ "$IPSEC_PROTO" = "esp_aead" ] && p="proto esp" + tst_ipsec_check_driver ipsec_set_algoline if [ $target = lhost ]; then @@ -234,6 +244,7 @@ tst_ipsec_vti() tst_brk TCONF "iproute doesn't support 'vti'" ipsec_set_algoline + tst_ipsec_check_driver local o_dir="src $src dst $dst" local i_dir="src $dst dst $src"