From patchwork Sat May 26 11:15:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 920964 X-Patchwork-Delegate: akodanev@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 40tLCY1gTdz9s0y for ; Sat, 26 May 2018 21:16:06 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 063C03E696D for ; Sat, 26 May 2018 13:16:01 +0200 (CEST) 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 [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 7FAD73E68D9 for ; Sat, 26 May 2018 13:15:59 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id C1539602395 for ; Sat, 26 May 2018 13:15:53 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3376BAC03; Sat, 26 May 2018 11:15:52 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Sat, 26 May 2018 13:15:42 +0200 Message-Id: <20180526111545.20521-1-pvorel@suse.cz> X-Mailer: git-send-email 2.16.3 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] [PATCH 1/4] tst_net.sh: Simplify ipver settings code 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 --- testcases/lib/tst_net.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index dc612a794..fd2eacf2f 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -29,11 +29,12 @@ TST_SETUP="tst_net_setup" # Blank for an IPV4 test; 6 for an IPV6 test. TST_IPV6=${TST_IPV6:-} +ipver=${TST_IPV6:-4} tst_net_parse_args() { case $1 in - 6) TST_IPV6=6;; + 6) TST_IPV6=6 ipver=6;; *) $TST_PARSE_ARGS_CALLER "$1" "$2";; esac } @@ -68,7 +69,6 @@ tst_net_remote_tmpdir() tst_net_setup() { - ipver=${TST_IPV6:-4} tst_net_remote_tmpdir [ -n "$TST_SETUP_CALLER" ] && $TST_SETUP_CALLER } @@ -79,7 +79,6 @@ fi if [ -n "$TST_USE_LEGACY_API" ]; then tst_net_read_opts "$@" - ipver=${TST_IPV6:-4} fi # old vs. new API compatibility layer From patchwork Sat May 26 11:15:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 920966 X-Patchwork-Delegate: akodanev@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 40tLCc3TGpz9s0y for ; Sat, 26 May 2018 21:16:12 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id D2EBB3E6EC1 for ; Sat, 26 May 2018 13:16:09 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-7.smtp.seeweb.it (in-7.smtp.seeweb.it [IPv6:2001:4b78:1:20::7]) by picard.linux.it (Postfix) with ESMTP id 2F5AB3E68D9 for ; Sat, 26 May 2018 13:15:59 +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-7.smtp.seeweb.it (Postfix) with ESMTPS id DC18E200DB8 for ; Sat, 26 May 2018 13:15:53 +0200 (CEST) Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 88352AED2; Sat, 26 May 2018 11:15:53 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Sat, 26 May 2018 13:15:43 +0200 Message-Id: <20180526111545.20521-2-pvorel@suse.cz> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180526111545.20521-1-pvorel@suse.cz> References: <20180526111545.20521-1-pvorel@suse.cz> X-Virus-Scanned: clamav-milter 0.99.2 at in-7.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-7.smtp.seeweb.it Subject: [LTP] [PATCH 2/4] net: Allow to overwrite libraries getopts handlers 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" Network libraries recently started to use TST_OPTS and TST_PARSE_ARGS: 89a83d8a0 ("net/ipsec_lib.sh: Process getopts parameters with TST_OPTS and TST_PARSE_ARGS") ce920a5a4 "network/virt_lib.sh: Process getopts parameters with TST_OPTS and TST_PARSE_ARGS" 5f088c3f4 ("nfs/nfs_lib.sh: Fix wrong getopts parameter handling") This allows to test using these libs customize getopts. Signed-off-by: Petr Vorel --- Needed for rewriting into new API. --- testcases/network/nfs/nfs_stress/nfs_lib.sh | 4 ++-- testcases/network/stress/ipsec/ipsec_lib.sh | 5 +++-- testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 4 ++-- testcases/network/virt/virt_lib.sh | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 5a3ad04bd..e378c5515 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -37,8 +37,8 @@ nfs_parse_args() esac } -TST_OPTS="hv:t:" -TST_PARSE_ARGS=nfs_parse_args +TST_OPTS="${TST_OPTS:-hv:t:}" +TST_PARSE_ARGS="${TST_PARSE_ARGS:-nfs_parse_args}" TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh index 480fe064a..28a2de5e8 100644 --- a/testcases/network/stress/ipsec/ipsec_lib.sh +++ b/testcases/network/stress/ipsec/ipsec_lib.sh @@ -67,8 +67,9 @@ ipsec_lib_parse_args() esac } -TST_OPTS="hl:m:p:s:S:k:A:e:a:c:r:" -TST_PARSE_ARGS=ipsec_lib_parse_args +TST_OPTS="${TST_OPTS:-hl:m:p:s:S:k:A:e:a:c:r:}" +TST_PARSE_ARGS="${TST_PARSE_ARGS:-ipsec_lib_parse_args}" + TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh index 8d6aa8450..45219b95a 100755 --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -39,8 +39,8 @@ TST_TOTAL=1 TCID="tcp_fastopen" TST_NEEDS_TMPDIR=1 -TST_OPTS="hr:n:R:" -TST_PARSE_ARGS=tcp_fastopen_parse_args +TST_OPTS="${TST_OPTS:-hr:n:R:}" +TST_PARSE_ARGS="${TST_PARSE_ARGS:-tcp_fastopen_parse_args}" TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index 00978a062..3523fb663 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -48,8 +48,8 @@ virt_lib_parse_args() esac } -TST_OPTS="hi:d:" -TST_PARSE_ARGS=virt_lib_parse_args +TST_OPTS="${TST_OPTS:-hi:d:}" +TST_PARSE_ARGS="${TST_PARSE_ARGS:-virt_lib_parse_args}" TST_USE_LEGACY_API=1 . tst_net.sh From patchwork Sat May 26 11:15:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 920965 X-Patchwork-Delegate: akodanev@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 40tLCY1dJBz9s0t for ; Sat, 26 May 2018 21:16:06 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 4FD763E6AB9 for ; Sat, 26 May 2018 13:16:04 +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 [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 8C23A3E68E1 for ; Sat, 26 May 2018 13:15:58 +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 C6C091400C49 for ; Sat, 26 May 2018 13:15:53 +0200 (CEST) Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5ED99ACA1; Sat, 26 May 2018 11:15:53 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Sat, 26 May 2018 13:15:44 +0200 Message-Id: <20180526111545.20521-3-pvorel@suse.cz> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180526111545.20521-1-pvorel@suse.cz> References: <20180526111545.20521-1-pvorel@suse.cz> 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 Subject: [LTP] [PATCH 3/4] net: Allow to skip additional getopts 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" Network libraries which use tst_test.sh allow to avoid setting their additional getopts. With TST_NET_SKIP_PARSE_ARGS=1 only -6 from tst_net.sh is handled (for both new and legacy API) and -h and -i from tst_test.sh (for new API only). Signed-off-by: Petr Vorel --- Not sure if this is useful. Meant for next commit. --- testcases/lib/tst_net.sh | 3 ++- testcases/lib/tst_test.sh | 2 +- testcases/network/nfs/nfs_stress/nfs_lib.sh | 6 ++++-- testcases/network/stress/ipsec/ipsec_lib.sh | 6 ++++-- testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 6 ++++-- testcases/network/virt/virt_lib.sh | 6 ++++-- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index fd2eacf2f..51d02c682 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -35,7 +35,8 @@ tst_net_parse_args() { case $1 in 6) TST_IPV6=6 ipver=6;; - *) $TST_PARSE_ARGS_CALLER "$1" "$2";; + *) [ -z "$TST_NET_SKIP_PARSE_ARGS" -o "$1" = "i" -o "$1" = "h" ] && \ + $TST_PARSE_ARGS_CALLER "$1" "$2";; esac } diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index 779383392..a3d238d88 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -255,7 +255,7 @@ tst_run() OPTS|USAGE|PARSE_ARGS|POS_ARGS);; NEEDS_ROOT|NEEDS_TMPDIR|NEEDS_DEVICE|DEVICE);; NEEDS_CMDS|NEEDS_MODULE|MODPATH|DATAROOT);; - IPV6);; + IPV6|NET_SKIP_PARSE_ARGS);; *) tst_res TWARN "Reserved variable TST_$tst_i used!";; esac done diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index e378c5515..846605ff5 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -37,8 +37,10 @@ nfs_parse_args() esac } -TST_OPTS="${TST_OPTS:-hv:t:}" -TST_PARSE_ARGS="${TST_PARSE_ARGS:-nfs_parse_args}" +if [ -z "$TST_NET_SKIP_PARSE_ARGS" ]; then + TST_OPTS="${TST_OPTS:-hv:t:}" + TST_PARSE_ARGS="${TST_PARSE_ARGS:-nfs_parse_args}" +fi TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh index 28a2de5e8..78e36d043 100644 --- a/testcases/network/stress/ipsec/ipsec_lib.sh +++ b/testcases/network/stress/ipsec/ipsec_lib.sh @@ -67,8 +67,10 @@ ipsec_lib_parse_args() esac } -TST_OPTS="${TST_OPTS:-hl:m:p:s:S:k:A:e:a:c:r:}" -TST_PARSE_ARGS="${TST_PARSE_ARGS:-ipsec_lib_parse_args}" +if [ -z "$TST_NET_SKIP_PARSE_ARGS" ]; then + TST_OPTS="${TST_OPTS:-hl:m:p:s:S:k:A:e:a:c:r:}" + TST_PARSE_ARGS="${TST_PARSE_ARGS:-ipsec_lib_parse_args}" +fi TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh index 45219b95a..4a28bff37 100755 --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -39,8 +39,10 @@ TST_TOTAL=1 TCID="tcp_fastopen" TST_NEEDS_TMPDIR=1 -TST_OPTS="${TST_OPTS:-hr:n:R:}" -TST_PARSE_ARGS="${TST_PARSE_ARGS:-tcp_fastopen_parse_args}" +if [ -z "$TST_NET_SKIP_PARSE_ARGS" ]; then + TST_OPTS="${TST_OPTS:-hr:n:R:}" + TST_PARSE_ARGS="${TST_PARSE_ARGS:-tcp_fastopen_parse_args}" +fi TST_USE_LEGACY_API=1 . tst_net.sh diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index 3523fb663..0fc299e64 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -48,8 +48,10 @@ virt_lib_parse_args() esac } -TST_OPTS="${TST_OPTS:-hi:d:}" -TST_PARSE_ARGS="${TST_PARSE_ARGS:-virt_lib_parse_args}" +if [ -z "$TST_NET_SKIP_PARSE_ARGS" ]; then + TST_OPTS="${TST_OPTS:-hi:d:}" + TST_PARSE_ARGS="${TST_PARSE_ARGS:-virt_lib_parse_args}" +fi TST_USE_LEGACY_API=1 . tst_net.sh