From patchwork Mon May 7 03:24:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 909512 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=cn.fujitsu.com 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 40fSvG4tn7z9s35 for ; Mon, 7 May 2018 13:35:54 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 088993E6755 for ; Mon, 7 May 2018 05:35:52 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [217.194.8.3]) by picard.linux.it (Postfix) with ESMTP id 248083E698A for ; Mon, 7 May 2018 05:35:48 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-3.smtp.seeweb.it (Postfix) with ESMTP id 423171A00F26 for ; Mon, 7 May 2018 05:35:45 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="39623461" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 May 2018 11:35:35 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id 117C748AE76D; Mon, 7 May 2018 11:35:33 +0800 (CST) Received: from RHEL7U5Alpha_SERVER.g08.fujitsu.local (10.167.220.185) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 7 May 2018 11:35:33 +0800 From: Xiao Yang To: Date: Mon, 7 May 2018 11:24:11 +0800 Message-ID: <1525663451-32016-3-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1525663451-32016-1-git-send-email-yangx.jy@cn.fujitsu.com> References: <1525663451-32016-1-git-send-email-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.185] X-yoursite-MailScanner-ID: 117C748AE76D.A5DCA X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com X-Spam-Status: No, score=0.0 required=7.0 tests=none autolearn=disabled version=3.4.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Subject: [LTP] [PATCH 3/3] net/nfs_lib.sh: Cleanup for legacy API 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" 1) Move common tst_net.sh to nfs_lib.sh itself 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions Signed-off-by: Xiao Yang Acked-by: Petr Vorel --- testcases/network/nfs/fsx-linux/fsx.sh | 2 -- testcases/network/nfs/nfs_stress/nfs01 | 2 -- testcases/network/nfs/nfs_stress/nfs02 | 2 -- testcases/network/nfs/nfs_stress/nfs03 | 2 -- testcases/network/nfs/nfs_stress/nfs04 | 2 -- testcases/network/nfs/nfs_stress/nfs05 | 2 -- testcases/network/nfs/nfs_stress/nfs06 | 2 -- testcases/network/nfs/nfs_stress/nfs_lib.sh | 13 ++++++++----- testcases/network/nfs/nfslock01/nfslock01 | 2 -- testcases/network/nfs/nfsstat01/nfsstat01 | 2 -- 10 files changed, 8 insertions(+), 23 deletions(-) diff --git a/testcases/network/nfs/fsx-linux/fsx.sh b/testcases/network/nfs/fsx-linux/fsx.sh index 84ad0e2..3f82d18 100755 --- a/testcases/network/nfs/fsx-linux/fsx.sh +++ b/testcases/network/nfs/fsx-linux/fsx.sh @@ -26,8 +26,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs01 b/testcases/network/nfs/nfs_stress/nfs01 index 93bf088..efaa215 100755 --- a/testcases/network/nfs/nfs_stress/nfs01 +++ b/testcases/network/nfs/nfs_stress/nfs01 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs02 b/testcases/network/nfs/nfs_stress/nfs02 index 74aa3d8..5cbe771 100755 --- a/testcases/network/nfs/nfs_stress/nfs02 +++ b/testcases/network/nfs/nfs_stress/nfs02 @@ -25,8 +25,6 @@ TST_TOTAL=3 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test1() { diff --git a/testcases/network/nfs/nfs_stress/nfs03 b/testcases/network/nfs/nfs_stress/nfs03 index 3279a22..2de7622 100755 --- a/testcases/network/nfs/nfs_stress/nfs03 +++ b/testcases/network/nfs/nfs_stress/nfs03 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs03_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh DIR_NUM=${DIR_NUM:-"100"} FILE_NUM=${FILE_NUM:-"100"} diff --git a/testcases/network/nfs/nfs_stress/nfs04 b/testcases/network/nfs/nfs_stress/nfs04 index 254c987..ccadbb1 100755 --- a/testcases/network/nfs/nfs_stress/nfs04 +++ b/testcases/network/nfs/nfs_stress/nfs04 @@ -28,8 +28,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh nfs_setup diff --git a/testcases/network/nfs/nfs_stress/nfs05 b/testcases/network/nfs/nfs_stress/nfs05 index 8c39cde..8435181 100755 --- a/testcases/network/nfs/nfs_stress/nfs05 +++ b/testcases/network/nfs/nfs_stress/nfs05 @@ -29,8 +29,6 @@ FILE_NUM=${FILE_NUM:-"50"} THREAD_NUM=${THREAD_NUM:-"8"} . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh tst_check_cmds make gcc diff --git a/testcases/network/nfs/nfs_stress/nfs06 b/testcases/network/nfs/nfs_stress/nfs06 index 628271a..0048190 100755 --- a/testcases/network/nfs/nfs_stress/nfs06 +++ b/testcases/network/nfs/nfs_stress/nfs06 @@ -25,8 +25,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh do_test() { diff --git a/testcases/network/nfs/nfs_stress/nfs_lib.sh b/testcases/network/nfs/nfs_stress/nfs_lib.sh index 28c43ba..7aed718 100644 --- a/testcases/network/nfs/nfs_stress/nfs_lib.sh +++ b/testcases/network/nfs/nfs_stress/nfs_lib.sh @@ -20,9 +20,6 @@ NFILES=${NFILES:=1000} SOCKET_TYPE="${SOCKET_TYPE:-udp}" NFS_TYPE=${NFS_TYPE:=nfs} -TST_OPTS=":hv:t:" -TST_PARSE_ARGS=nfs_parse_args - nfs_parse_args() { case "$1" in @@ -34,12 +31,18 @@ nfs_parse_args() echo "6 run over IPv6" exit 0 ;; - v) VERSION=$OPTARG;; - t) SOCKET_TYPE=$OPTARG;; + v) VERSION=$2;; + t) SOCKET_TYPE=$2;; *) tst_brkm TBROK "unknown option: $1" esac } +TST_OPTS=":hv:t:" +TST_PARSE_ARGS=nfs_parse_args + +TST_USE_LEGACY_API=1 +. tst_net.sh + get_socket_type() { local t diff --git a/testcases/network/nfs/nfslock01/nfslock01 b/testcases/network/nfs/nfslock01/nfslock01 index a545fa0..bf406e6 100755 --- a/testcases/network/nfs/nfslock01/nfslock01 +++ b/testcases/network/nfs/nfslock01/nfslock01 @@ -26,8 +26,6 @@ TST_TOTAL=1 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh LUSER=${LUSER:=root} diff --git a/testcases/network/nfs/nfsstat01/nfsstat01 b/testcases/network/nfs/nfsstat01/nfsstat01 index afd239f..9212518 100755 --- a/testcases/network/nfs/nfsstat01/nfsstat01 +++ b/testcases/network/nfs/nfsstat01/nfsstat01 @@ -22,8 +22,6 @@ TST_TOTAL=4 TST_CLEANUP="nfs_cleanup" . nfs_lib.sh -TST_USE_LEGACY_API=1 -. tst_net.sh setup() {