From patchwork Mon Apr 29 07:27:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1092449 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 ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44sx8l4SXfz9s6w for ; Mon, 29 Apr 2019 17:28:21 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id DB891298941 for ; Mon, 29 Apr 2019 09:28:17 +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 3BD743EA137 for ; Mon, 29 Apr 2019 09:28:10 +0200 (CEST) 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-3.smtp.seeweb.it (Postfix) with ESMTPS id CFF5B1A003D3 for ; Mon, 29 Apr 2019 09:28:08 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D17C0AE28; Mon, 29 Apr 2019 07:28:06 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 29 Apr 2019 09:27:59 +0200 Message-Id: <20190429072800.23067-1-pvorel@suse.cz> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.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-3.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] net/traceroute: Rewrite into new 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" Add info about traceroute from iputils not being supported Signed-off-by: Petr Vorel --- testcases/network/traceroute/traceroute01.sh | 63 ++++++++------------ 1 file changed, 25 insertions(+), 38 deletions(-) diff --git a/testcases/network/traceroute/traceroute01.sh b/testcases/network/traceroute/traceroute01.sh index 1c8b66f55..8e9f46f45 100755 --- a/testcases/network/traceroute/traceroute01.sh +++ b/testcases/network/traceroute/traceroute01.sh @@ -1,39 +1,20 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2019 Petr Vorel # Copyright (c) 2017 Oracle and/or its affiliates. All Rights Reserved. # Copyright (c) International Business Machines Corp., 2001 -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it would be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -TST_TOTAL=6 -TCID="traceroute01" -TST_CLEANUP="cleanup" - -TST_USE_LEGACY_API=1 +TST_CNT=2 +TST_NEEDS_CMDS="traceroute" +TST_SETUP="setup" +TST_TESTFUNC="test" . tst_net.sh -cleanup() -{ - tst_rmdir -} - setup() { - tst_resm TINFO "traceroute version:" - tst_resm TINFO $(traceroute --version 2>&1) - - tst_test_cmds traceroute - tst_tmpdir + tst_res TINFO "traceroute version:" + tst_res TINFO $(traceroute --version 2>&1) + [ "$TST_IPV6" ] && tst_res TINFO "NOTE: tracepath6 from iputils is not supported" } run_trace() @@ -51,24 +32,30 @@ run_trace() grep -q "$bytes byte" out.log if [ $? -ne 0 ]; then cat out.log - tst_resm TFAIL "'$bytes byte' not found" + tst_res TFAIL "'$bytes byte' not found" else - tst_resm TPASS "traceroute use $bytes bytes" + tst_res TPASS "traceroute use $bytes bytes" fi tail -1 out.log | grep -qE "$pattern" if [ $? -ne 0 ]; then cat out.log - tst_resm TFAIL "pattern '$pattern' not found in log" + tst_res TFAIL "pattern '$pattern' not found in log" else - tst_resm TPASS "traceroute test completed with 1 hop" + tst_res TPASS "traceroute test completed with 1 hop" fi } -setup -tst_resm TINFO "run traceroute with ICMP ECHO" -run_trace -I -tst_resm TINFO "run traceroute with TCP SYN" -run_trace -T +test1() +{ + tst_res TINFO "run traceroute with ICMP ECHO" + run_trace -I +} + +test2() +{ + tst_res TINFO "run traceroute with TCP SYN" + run_trace -T +} -tst_exit +tst_run