From patchwork Mon May 7 03:24:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 909511 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 40fSvF5hdHz9s1w for ; Mon, 7 May 2018 13:35:53 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 18A6B3E697D for ; Mon, 7 May 2018 05:35:49 +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 D5B043E6777 for ; Mon, 7 May 2018 05:35:45 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-2.smtp.seeweb.it (Postfix) with ESMTP id 5C6E5600EB1 for ; Mon, 7 May 2018 05:35:44 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="39623457" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 07 May 2018 11:35:30 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id DFD7348AE76D; Mon, 7 May 2018 11:35:31 +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:32 +0800 From: Xiao Yang To: Date: Mon, 7 May 2018 11:24:10 +0800 Message-ID: <1525663451-32016-2-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: DFD7348AE76D.AB226 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-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 2/3] net/tcp_fastopen_run.sh: Cleanup in TST_PARSE_ARGS functions 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) Process getopts parameters by TST_OPTS and TST_PARSE_ARGS 2) Pass $OPTARG as $2 to TST_PARSE_ARGS functions Signed-off-by: Xiao Yang Acked-by: Petr Vorel --- testcases/network/tcp_fastopen/tcp_fastopen_run.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh index 5cc9804..865b3d4 100755 --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -20,8 +20,9 @@ TST_NETLOAD_MAX_SRV_REPLIES=3 -while getopts :hr:n:R:6 opt; do - case "$opt" in +tcp_fastopen_parse_args() +{ + case "$1" in h) echo "Usage:" echo "h help" @@ -29,17 +30,18 @@ while getopts :hr:n:R:6 opt; do echo "6 run over IPv6" exit 0 ;; - R) TST_NETLOAD_MAX_SRV_REPLIES=$OPTARG ;; - 6) TST_IPV6=6 ;; - *) tst_brkm TBROK "unknown option: $opt" ;; + R) TST_NETLOAD_MAX_SRV_REPLIES=$2 ;; + *) tst_brkm TBROK "unknown option: $1" ;; esac -done -shift $(($OPTIND - 1)) +} TST_TOTAL=1 TCID="tcp_fastopen" TST_NEEDS_TMPDIR=1 +TST_OPTS=":hr:n:R:" +TST_PARSE_ARGS=tcp_fastopen_parse_args + TST_USE_LEGACY_API=1 . tst_net.sh