From patchwork Mon Aug 20 11:23:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 959604 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=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="NYS7/3zp"; dkim-atps=neutral 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 41vB5g0BgDz9s3Z for ; Mon, 20 Aug 2018 21:14:14 +1000 (AEST) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 417A93E6486 for ; Mon, 20 Aug 2018 13:14:12 +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 859DA3E644E for ; Mon, 20 Aug 2018 13:14:05 +0200 (CEST) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id C306C600152 for ; Mon, 20 Aug 2018 13:14:04 +0200 (CEST) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7KBE3Dv109982 for ; Mon, 20 Aug 2018 11:14:03 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=BT1xL65Txpoh1KXU7cJRq+ndpEc2mjoymGdAyQTQ6VA=; b=NYS7/3zpMccJfS3GtduZPS8cuB6+x2cKFEuU8qIVXI7sa15sPgKY/8GfyciVdlQLkq/c 1psiKRlY7QcIW5muIKvcyFp01ijgi/h5Cy2RS3HYaIZ95vOQenaGLEzs1S0ZKA5ixNQ4 CD41ItHvALnQel3X2z74cCH7CqOA33LeffIW68NP+dIoajx/zjRRQZ8xn/VEt4i0M0/e 0u91QJXBbRKawUvZrXIF8n6A/Qf76EafnKrU/vlVZvBHKSe3/ciMPeQKrfdMfQDUVdBd 2NjwC67p741D9JgUdGK9FmbDH5Hmyof0FKIHfgLTahYaPhynCxRmdeYkjFFlQjgqPi58 Ig== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2kxavtdq5s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 20 Aug 2018 11:14:02 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7KBDvlC010971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 20 Aug 2018 11:13:57 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7KBDvn5007409 for ; Mon, 20 Aug 2018 11:13:57 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Aug 2018 04:13:56 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Mon, 20 Aug 2018 14:23:49 +0300 Message-Id: <1534764229-26993-4-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1534764229-26993-1-git-send-email-alexey.kodanev@oracle.com> References: <1534764229-26993-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8990 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=583 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808200123 X-Virus-Scanned: clamav-milter 0.99.2 at in-2.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-2.smtp.seeweb.it Subject: [LTP] [PATCH v2 4/4] network/ipsec: replace ipsec_try() with TST_RTNL_CHK() 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" Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel --- v2: fixed missing ip before TST_RTNL_CHK testcases/network/stress/ipsec/ipsec_lib.sh | 21 +++------------------ 1 files changed, 3 insertions(+), 18 deletions(-) diff --git a/testcases/network/stress/ipsec/ipsec_lib.sh b/testcases/network/stress/ipsec/ipsec_lib.sh index aedba9b..b099fde 100644 --- a/testcases/network/stress/ipsec/ipsec_lib.sh +++ b/testcases/network/stress/ipsec/ipsec_lib.sh @@ -157,21 +157,6 @@ ipsec_set_algoline() esac } -ipsec_try() -{ - local output="$($@ 2>&1 || echo 'TERR')" - - if echo "$output" | grep -q "TERR"; then - echo "$output" | grep -q \ - 'RTNETLINK answers: Function not implemented' && \ - tst_brk TCONF "'$@': not implemented" - echo "$output" | grep -q \ - 'RTNETLINK answers: Operation not supported' && \ - tst_brk TCONF "'$@': not supported (maybe missing 'ip${TST_IPV6}_vti' kernel module)" - tst_brk TBROK "$@ failed: $output" - fi -} - # tst_ipsec target src_addr dst_addr: config ipsec # # target: target of the configuration host ( lhost / rhost ) @@ -195,7 +180,7 @@ tst_ipsec() if [ $target = lhost ]; then local spi_1="0x$SPI" local spi_2="0x$(( $SPI + 1 ))" - ipsec_try ip xfrm state add src $src dst $dst spi $spi_1 \ + TST_RTNL_CHK ip xfrm state add src $src dst $dst spi $spi_1 \ $p $ALG mode $mode sel src $src dst $dst ROD ip xfrm state add src $dst dst $src spi $spi_2 \ $p $ALG mode $mode sel src $dst dst $src @@ -257,12 +242,12 @@ tst_ipsec_vti() cleanup_vti=$vti if [ $target = lhost ]; then - ipsec_try ip li add $vti $type local $src remote $dst $key $d + TST_RTNL_CHK ip li add $vti $type local $src remote $dst $key $d ROD ip li set $vti up local spi_1="spi 0x$SPI" local spi_2="spi 0x$(( $SPI + 1 ))" - ipsec_try $ipx st add $o_dir $p $spi_1 $ALG $m + TST_RTNL_CHK $ipx st add $o_dir $p $spi_1 $ALG $m ROD $ipx st add $i_dir $p $spi_2 $ALG $m ROD $ipx po add dir out tmpl $o_dir $p $m $mrk ROD $ipx po add dir in tmpl $i_dir $p $m $mrk