From patchwork Tue Feb 19 14:47:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1044720 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=fail (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="nYXeGOvb"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 443k7q1vbsz9s7h for ; Wed, 20 Feb 2019 01:46:15 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 7E7C0294AA0 for ; Tue, 19 Feb 2019 15:46:12 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id D256C3EA37B for ; Tue, 19 Feb 2019 15:46:07 +0100 (CET) Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 6613C14016A7 for ; Tue, 19 Feb 2019 15:46:06 +0100 (CET) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1JEiM95184074 for ; Tue, 19 Feb 2019 14:46:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=3MflvTga3EkzoRbiMEPzJXtivzOmo7mQx5HM1WSVz+U=; b=nYXeGOvbNEQWglzgItT8N7lHa6ZifxtjhdtwAYZ3f3ySLNzgXBPOJ8apnoNRcf0KlSPd xOVELgNLd5LS9tCEATD1lEka5Ot91Xib2Ksm8iW+IGFfRhO+RGX+iIRSyjB50mxJ8utP HeVZo0Gl5TLVf/BV9nWiL31EU+1t86Y5jh9mopY61nqWkO2Z5fM5X3Fm3tPS6UAwW3bw 9qDtto4oJOzyRh23qyCEbLy2Dvvvy9jkmHVxHu0Og6KrUsu/CHISsyCSax15/29A9Yaa d+fK+DWmmHsUQNohPkJ56dlRsAvUugx6d/BGgv9vSDuTOc7TF9oZRKvP2pb67n0szxTC Qw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2qpb5rbf84-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Feb 2019 14:46:04 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1JEk3KG010099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 19 Feb 2019 14:46:03 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1JEk3eu019534 for ; Tue, 19 Feb 2019 14:46:03 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 19 Feb 2019 06:46:02 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Tue, 19 Feb 2019 17:47:50 +0300 Message-Id: <1550587673-7995-2-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1550587673-7995-1-git-send-email-alexey.kodanev@oracle.com> References: <1550587673-7995-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9171 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=827 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902190111 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/4] network/gre01: move setup to library 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: , MIME-Version: 1.0 Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" The same setup can be used with the other gre tests. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/network/virt/gre01.sh | 19 ++----------------- testcases/network/virt/virt_lib.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/testcases/network/virt/gre01.sh b/testcases/network/virt/gre01.sh index 27373fd..db5be6d 100755 --- a/testcases/network/virt/gre01.sh +++ b/testcases/network/virt/gre01.sh @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # Copyright (c) 2018 Petr Vorel -# Copyright (c) 2015-2017 Oracle and/or its affiliates. +# Copyright (c) 2015-2019 Oracle and/or its affiliates. # Author: Alexey Kodanev # # It requires remote host. Test will setup IPv4 and IPv6 virtual @@ -10,23 +10,8 @@ TST_NEEDS_TMPDIR=1 TST_TESTFUNC=virt_netperf_msg_sizes -TST_SETUP=do_setup +TST_SETUP=virt_gre_setup TST_CLEANUP=virt_cleanup . virt_lib.sh -do_setup() -{ - virt_type="gre" - [ "$TST_IPV6" ] && virt_type="ip6gre" - virt_lib_setup - - if [ -z $ip_local -o -z $ip_remote ]; then - tst_brk TBROK "you must specify IP address" - fi - - tst_res TINFO "test $virt_type" - virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \ - "local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)" -} - tst_run diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index c9fe80c..eb9d052 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -355,3 +355,18 @@ virt_test_02() virt_add_delete_test "$2" start_id=$(($start_id + $NS_TIMES)) } + +virt_gre_setup() +{ + virt_type="gre" + [ "$TST_IPV6" ] && virt_type="ip6gre" + virt_lib_setup + + if [ -z $ip_local -o -z $ip_remote ]; then + tst_brk TBROK "you must specify IP address" + fi + + tst_res TINFO "test $virt_type" + virt_setup "local $(tst_ipaddr) remote $(tst_ipaddr rhost) dev $(tst_iface)" \ + "local $(tst_ipaddr rhost) remote $(tst_ipaddr) dev $(tst_iface rhost)" +}