From patchwork Tue May 8 03:12:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 910022 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=cn.fujitsu.com 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 40g4b24xy0z9s2k for ; Tue, 8 May 2018 13:23:58 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 024463E6484 for ; Tue, 8 May 2018 05:23:56 +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 [IPv6:2001:4b78:1:20::4]) by picard.linux.it (Postfix) with ESMTP id D48FF3E61F6 for ; Tue, 8 May 2018 05:23:54 +0200 (CEST) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-4.smtp.seeweb.it (Postfix) with ESMTP id 2E63B10006C8 for ; Tue, 8 May 2018 05:23:49 +0200 (CEST) X-IronPort-AV: E=Sophos;i="5.43,368,1503331200"; d="scan'208";a="39671574" Received: from bogon (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 08 May 2018 11:23:42 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (unknown [10.167.33.83]) by cn.fujitsu.com (Postfix) with ESMTP id A02234B34D33; Tue, 8 May 2018 11:23:38 +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; Tue, 8 May 2018 11:23:36 +0800 From: Xiao Yang To: Date: Tue, 8 May 2018 11:12:21 +0800 Message-ID: <1525749141-29004-1-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <20180507193234.6810-2-pvorel@suse.cz> References: <20180507193234.6810-2-pvorel@suse.cz> MIME-Version: 1.0 X-Originating-IP: [10.167.220.185] X-yoursite-MailScanner-ID: A02234B34D33.A9393 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-4.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-4.smtp.seeweb.it Cc: ltp@lists.linux.it Subject: [LTP] [PATCH] lib/tst_net.sh: Detect quoted parameters correctly 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" If we pass $* to tst_net_read_opts, we cannot detect quoted parameters correctly, which process only first number from quoted parameters. For example, running sctp_ipsec.sh -s "100 1000 65535": ------------------------------------------------------ ... sctp_ipsec 1 TINFO: run server 'netstress -T sctp -S 10.167.220.185 -R 500000 -B /tmp/sctp_ipsec.8MpnrPPXkq' sctp_ipsec 1 TINFO: run client 'netstress -l -T sctp -H 10.167.220.185 -n 100 -N 100 -S 10.167.220.179 -a 2 -r 500 -d tst_netload.res -g 50802' sctp_ipsec 1 TPASS: netstress passed, time spent '397' ms ------------------------------------------------------ We solve this issue by passing "$@" to tst_net_read_opts. For example, running sctp_ipsec.sh -s "100 1000 65535": ------------------------------------------------------ ... sctp_ipsec 1 TINFO: run server 'netstress -T sctp -S 10.167.220.185 -R 500000 -B /tmp/sctp_ipsec.93mw7qy2BW' sctp_ipsec 1 TINFO: run client 'netstress -l -T sctp -H 10.167.220.185 -n 100 -N 100 -S 10.167.220.179 -a 2 -r 500 -d tst_netload.res -g 36311' sctp_ipsec 1 TPASS: netstress passed, time spent '254' ms sctp_ipsec 2 TINFO: run server 'netstress -T sctp -S 10.167.220.185 -R 500000 -B /tmp/sctp_ipsec.93mw7qy2BW' sctp_ipsec 2 TINFO: run client 'netstress -l -T sctp -H 10.167.220.185 -n 1000 -N 1000 -S 10.167.220.179 -a 2 -r 500 -d tst_netload.res -g 45078' sctp_ipsec 2 TPASS: netstress passed, time spent '276' ms sctp_ipsec 3 TINFO: run server 'netstress -T sctp -S 10.167.220.185 -R 500000 -B /tmp/sctp_ipsec.93mw7qy2BW' sctp_ipsec 3 TINFO: run client 'netstress -l -T sctp -H 10.167.220.185 -n 65535 -N 65535 -S 10.167.220.179 -a 2 -r 500 -d tst_netload.res -g 36871' sctp_ipsec 3 TPASS: netstress passed, time spent '1288' ms ------------------------------------------------------ Signed-off-by: Xiao Yang Acked-by: Petr Vorel --- testcases/lib/tst_net.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 32b4f09..df850a0 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -78,7 +78,7 @@ if [ -z "$TST_LIB_LOADED" ]; then fi if [ -n "$TST_USE_LEGACY_API" ]; then - tst_net_read_opts $* + tst_net_read_opts "$@" ipver=${TST_IPV6:-4} fi