From patchwork Tue Feb 26 16:23:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1048440 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="3NoTa9t1"; 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 4483ws1t7Hz9s70 for ; Wed, 27 Feb 2019 03:21:47 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 31B863EAE94 for ; Tue, 26 Feb 2019 17:21:44 +0100 (CET) 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 3D3413EAE60 for ; Tue, 26 Feb 2019 17:21:42 +0100 (CET) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-4.smtp.seeweb.it (Postfix) with ESMTPS id 04AB3100185A for ; Tue, 26 Feb 2019 17:21:39 +0100 (CET) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1QGJSK9040530 for ; Tue, 26 Feb 2019 16:21:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=cCXbRNLaVuUkPCIG0L2iO1EEBcdo+p0w9+QVRhKQcsc=; b=3NoTa9t1HEIMDc+85NUIE0OPs7cZbvJoyOi596gEcDLeAWZuRyigoJRgs7MSxBQALx6u lrt1BBC8jCBpT5spXOpAV5chzaGnZ5XJrCh4g2Dri1Fp0VI+0KLmbjDCpnOvgEPqrgjY r3JjyJ4ao3+mOyhObavdLHtsVSXP5WoKFkvYqxvsruS0bJ4X2e6i4FYJQcYZntalt07j tRztEfVA5VQR0D98s4osY/TCwKcs/XLEIoiE3F5JZRtQwYJ5xBLS05MgdAHqxgJVIF8p Mt5nOYMX5LWlwZtg6Vm059ewnw9wnlIGbSmnGfIaf6cUUZ5CZ189/tu62TdBmwa7R5mM LQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2qtupe5ub4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Feb 2019 16:21:38 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1QGLcRk020301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Feb 2019 16:21:38 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1QGLbd4007794 for ; Tue, 26 Feb 2019 16:21:37 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Feb 2019 08:21:37 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Tue, 26 Feb 2019 19:23:32 +0300 Message-Id: <1551198213-10024-1-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9178 signatures=668685 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=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902260116 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.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-4.smtp.seeweb.it Subject: [LTP] [PATCH 1/2] lib/tst_net.sh: don't treat TWARN/TCONF as failure in tst_netload() 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" Report TWARN and don't stop the test in that case. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel --- testcases/lib/tst_net.sh | 37 ++++++++++++++++++++++++------------- 1 files changed, 24 insertions(+), 13 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 3148643..7625c51 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -573,7 +573,7 @@ tst_netload() [ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt " local expect_ret=0 - [ "$expect_res" != "pass" ] && expect_ret=1 + [ "$expect_res" != "pass" ] && expect_ret=3 tst_rhost_run -c "pkill -9 netstress\$" s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR" @@ -590,26 +590,37 @@ tst_netload() c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port" tst_res_ TINFO "run client 'netstress -l $c_opts'" - netstress -l $c_opts > tst_netload.log 2>&1 || ret=1 + netstress -l $c_opts > tst_netload.log 2>&1 || ret=$? tst_rhost_run -c "pkill -9 netstress\$" - if [ "$expect_ret" -ne "$ret" ]; then + if [ "$expect_ret" -ne 0 ]; then + if [ $((ret & expect_ret)) -ne 0 ]; then + tst_res_ TPASS "netstress failed as expected" + else + tst_res_ TFAIL "unexpected pass, ret is $ret" + fi + return $ret + fi + + if [ "$ret" -ne 0 ]; then tst_dump_rhost_cmd cat tst_netload.log - tst_brk_ TFAIL "expected '$expect_res' but ret: '$ret'" + [ $((ret & 3)) -ne 0 ] && \ + tst_brk_ TFAIL "expected '$expect_res' but ret: '$ret'" + [ $((ret & 32)) -ne 0 ] && \ + tst_brk_ TCONF "not supported configuration" + [ $((ret & 4)) -ne 0 ] && \ + tst_res_ TWARN "netstress has warnings" fi - if [ "$ret" -eq 0 ]; then - if [ ! -f $rfile ]; then - tst_dump_rhost_cmd - cat tst_netload.log - tst_brk_ TFAIL "can't read $rfile" - fi - tst_res_ TPASS "netstress passed, time spent '$(cat $rfile)' ms" - else - tst_res_ TPASS "netstress failed as expected" + if [ ! -f $rfile ]; then + tst_dump_rhost_cmd + cat tst_netload.log + tst_brk_ TFAIL "can't read $rfile" fi + tst_res_ TPASS "netstress passed, time spent '$(cat $rfile)' ms" + return $ret } From patchwork Tue Feb 26 16:23:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1048441 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=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="1hqAc36Q"; 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 4483wv4Gwbz9s4V for ; Wed, 27 Feb 2019 03:21:51 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id B98133EAE84 for ; Tue, 26 Feb 2019 17:21:48 +0100 (CET) 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 [217.194.8.4]) by picard.linux.it (Postfix) with ESMTP id 59EF23EAE60 for ; Tue, 26 Feb 2019 17:21:43 +0100 (CET) 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-4.smtp.seeweb.it (Postfix) with ESMTPS id 791BD100184F for ; Tue, 26 Feb 2019 17:21:41 +0100 (CET) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x1QGJLdY040518 for ; Tue, 26 Feb 2019 16:21:40 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=5XLuK9gWy3XlD3gyy6rT58C+8l8tML8Bh8GXIyCE0ZQ=; b=1hqAc36QXALCrnB8XltYp8xUX82GTO2Hcc3gcvfeaNzE6ZHHavFMRsv9EPKo40p9hvmK xOm25fkDiGVCEY1zZHWY9BXKlnc2YHrWjo+skd8rhsYJawV1xYua/GjKMKHOH857e2lv 9eD0afm6Z/XqoKUxhPiNqU6fV9cukUn9T4fKwEqkVq7XkwiZqbLhL8CQoT0nFGHPK4PB h0PE7aYOmT0jZD+NQ7fjmw3mGRjArN1UCnIdTmeplSMrCS2kaOWS+TZMtUfBctW2YCi0 XxIGaAQmufx8XlDRw1YY+bqgLONqgkTa8lgsZ0bLCiRTBHn1Xci1VUVTEWGYtlSGa9EA wA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2qtwku5nne-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Feb 2019 16:21:40 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x1QGLcs8001838 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 26 Feb 2019 16:21:39 GMT Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x1QGLcc3007814 for ; Tue, 26 Feb 2019 16:21:38 GMT Received: from ak.ru.oracle.com (/10.162.80.29) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 26 Feb 2019 08:21:38 -0800 From: Alexey Kodanev To: ltp@lists.linux.it Date: Tue, 26 Feb 2019 19:23:33 +0300 Message-Id: <1551198213-10024-2-git-send-email-alexey.kodanev@oracle.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1551198213-10024-1-git-send-email-alexey.kodanev@oracle.com> References: <1551198213-10024-1-git-send-email-alexey.kodanev@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9178 signatures=668685 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=886 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902260116 X-Virus-Scanned: clamav-milter 0.99.2 at in-4.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-4.smtp.seeweb.it Subject: [LTP] [PATCH 2/2] lib/tst_net.sh: use SO_BINDTODEVICE in tst_netload() 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" Since we have the information about the device, enable the usage of the option, when starting netstress. It can be disabled with TST_NETLOAD_BINDTODEVICE=0. Signed-off-by: Alexey Kodanev Acked-by: Petr Vorel --- testcases/lib/tst_net.sh | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index 7625c51..9e26cee 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -537,6 +537,7 @@ tst_netload() # number of server replies after which TCP connection is closed local s_replies="${TST_NETLOAD_MAX_SRV_REPLIES:-500000}" local s_opts= + local bind_to_device=1 if [ ! "$TST_NEEDS_TMPDIR" = 1 ]; then tst_brk_ TBROK "Using tst_netload requires setting TST_NEEDS_TMPDIR=1" @@ -564,7 +565,8 @@ tst_netload() f) cs_opts="${cs_opts}-f " ;; F) cs_opts="${cs_opts}-F " ;; e) expect_res="$OPTARG" ;; - D) cs_opts="${cs_opts}-D $OPTARG " ;; + D) cs_opts="${cs_opts}-D $OPTARG " + bind_to_device=0 ;; *) tst_brk_ TBROK "tst_netload: unknown option: $OPTARG" ;; esac done @@ -572,6 +574,11 @@ tst_netload() [ "$setup_srchost" = 1 ] && s_opts="${s_opts}-S $hostopt " + if [ "$bind_to_device" = 1 -a "$TST_NETLOAD_BINDTODEVICE" = 1 ]; then + c_opts="${c_opts}-D $(tst_iface) " + s_opts="${s_opts}-D $(tst_iface rhost) " + fi + local expect_ret=0 [ "$expect_res" != "pass" ] && expect_ret=3 @@ -788,6 +795,7 @@ fi export TST_NETLOAD_CLN_REQUESTS="${TST_NETLOAD_CLN_REQUESTS:-10000}" export TST_NETLOAD_CLN_NUMBER="${TST_NETLOAD_CLN_NUMBER:-2}" +export TST_NETLOAD_BINDTODEVICE="${TST_NETLOAD_BINDTODEVICE:-1}" export HTTP_DOWNLOAD_DIR="${HTTP_DOWNLOAD_DIR:-/var/www/html}" export FTP_DOWNLOAD_DIR="${FTP_DOWNLOAD_DIR:-/var/ftp}" export FTP_UPLOAD_DIR="${FTP_UPLOAD_DIR:-/var/ftp/pub}"