From patchwork Thu Oct 18 14:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 985941 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=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 42bWwj0psjz9sBq for ; Fri, 19 Oct 2018 01:42:24 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 519DD3E6108 for ; Thu, 18 Oct 2018 16:42:22 +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 E692B3E60F5 for ; Thu, 18 Oct 2018 16:42:19 +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-2.smtp.seeweb.it (Postfix) with ESMTPS id D639E600C13 for ; Thu, 18 Oct 2018 16:42:18 +0200 (CEST) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A10E7AB6D; Thu, 18 Oct 2018 14:42:17 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Thu, 18 Oct 2018 16:42:11 +0200 Message-Id: <20181018144211.8298-1-pvorel@suse.cz> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 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 v2 1/1] net: Fix missing ping6 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" ping6 is needed for some tst_net.sh based tests (and for netns_helper.sh, but it handles the dependency itself). iputils commit ebad35f ("ping: merge `ping6` command into `ping`") [1], released in s20150815 stopped providing ping6 and left it on distributions (see also [2]). Some distros don't create it (or didn't create it in the past [3]), use workaround and warn about it (as it's also a bug which should be fixed). NOTE: Unfortunately we cannot use 'ping -${TST_IPVER}' as ping got '-6' switch (as a part of support for IPv6) was in commit 25aaaf4 ("Allow ping to use IPv6 addresses") [4], released in s20150815 (previous versions supported only ping6). [1] https://github.com/iputils/iputils/commit/ebad35fee3de851b809c7b72ccc654a72b6af61d [2] https://bugzilla.redhat.com/show_bug.cgi?id=617934#c22 [3] https://bugzilla.opensuse.org/show_bug.cgi?id=1017616 [4] https://github.com/iputils/iputils/commit/25aaaf4c58b485a5d9ec758a1f170cc5ec4073c4 Signed-off-by: Petr Vorel Suggested-by: Alexey Kodanev --- Hi Alexey, used a bit strange syntax, but it handles aliases. Kind regards, Petr --- testcases/lib/tst_net.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index a4467da7c..29080f92b 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -756,3 +756,11 @@ export RHOST_HWADDRS="${RHOST_HWADDRS:-$(tst_get_hwaddrs rhost)}" if [ -n "$TST_USE_LEGACY_API" ]; then tst_net_remote_tmpdir fi + +if ! tst_cmd_available ping6; then + ping6() + { + ping -6 $@ + } + tst_res_ TINFO "ping6 binary/symlink is missing, using workaround. Please, report missing ping6 to your distribution." +fi