From patchwork Thu Oct 15 12:20:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1382603 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 (sender SPF authorized) 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=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.a=rsa-sha256 header.s=corp-2020-01-29 header.b=a2TPpenz; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBpNY2Ytyz9sTL for ; Thu, 15 Oct 2020 23:23:41 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 82FE33C3250 for ; Thu, 15 Oct 2020 14:23:33 +0200 (CEST) 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 367933C23F5 for ; Thu, 15 Oct 2020 14:23:21 +0200 (CEST) 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 730E81400756 for ; Thu, 15 Oct 2020 14:23:20 +0200 (CEST) Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCDrKP140240 for ; Thu, 15 Oct 2020 12:23:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=i3OP1eeHuvIrw41eoepciR2fuk+0bnUlKZQzsOJSj7c=; b=a2TPpenzkRPjFiss4PEuyzd2/tRTEEc6Vt9fZGh8D8UujCwZQMt2mISKVQxR6lYJIyGd myMz/vQP16bLMbKkZlnHvT8lmctDLPnu4ZCFrdNmgrD9erF54xRMq36AfGilDo3h+fAG VZ2SVNJGRyNP+7n+iNVIpLcohJBUasRJLFUB9RQSUbfU12HV6t8vW5qP/5Os9967qy/Q lYfoUyWG4BKaFWWGAQQNyvwmYE7+ob2Relulmf+JgnjXP71TuB2c8OXwYtoKJ8rmBMzS 4uJgVnl3jpuRgIiXohHYuH9cymiI/FuB+IsgY4VQxw9556vlLNJGw310bWQM6PbZmDgp 5g== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 343vaejq4s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Oct 2020 12:23:18 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCFKUY014020 for ; Thu, 15 Oct 2020 12:21:17 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 343pv1rr4x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09FCLDtb025308 for ; Thu, 15 Oct 2020 12:21:17 GMT Received: from gyrotron.uk.oracle.com (/10.175.204.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Oct 2020 05:21:12 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 15 Oct 2020 15:20:52 +0300 Message-Id: <20201015122056.20715-1-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 suspectscore=1 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 mlxscore=0 suspectscore=1 spamscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/5] lib/tst_net: add generic tst_netload_compare() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" * Remove duplicate code for comparing time-based results in network tests (bbr, busy_poll, sctp, tcp fastopen, virt tests) * Expand thresholds for sctp, bbr test-cases, in order to avoid false-positive failures. * In virt_lib.sh, keep sign for VIRT_PERF_THRESHOLD. * TWARN when the base result is too bad (threshold_hi arg is set) Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/lib/tst_net.sh | 31 +++++++++++++++++++ testcases/network/busy_poll/busy_poll01.sh | 10 ++---- testcases/network/busy_poll/busy_poll02.sh | 8 +---- testcases/network/busy_poll/busy_poll03.sh | 8 +---- testcases/network/dccp/dccp01.sh | 15 ++------- testcases/network/sctp/sctp01.sh | 8 +---- testcases/network/tcp_cc/bbr01.sh | 2 +- testcases/network/tcp_cc/bbr02.sh | 2 +- testcases/network/tcp_cc/dctcp01.sh | 2 +- testcases/network/tcp_cc/tcp_cc_lib.sh | 8 +---- .../network/tcp_fastopen/tcp_fastopen_run.sh | 15 ++------- testcases/network/virt/virt_lib.sh | 21 ++----------- 12 files changed, 46 insertions(+), 84 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index d939a5780..b29e076c3 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -741,6 +741,37 @@ tst_netload() return $ret } +# Compares results for netload runs. +# tst_netload_compare TIME_BASE TIME THRESHOLD_LOW [THRESHOLD_HI] +# TIME_BASE: time taken to run netstress load test - 100% +# TIME: time that is compared to the base one +# THRESHOD_LOW: lower limit for TFAIL +# THRESHOD_HIGH: upper limit for TWARN +tst_netload_compare() +{ + local base_time=$1 + local new_time=$2 + local threshold_low=$3 + local threshold_hi=$4 + + if [ -z "$base_time" -o -z "$new_time" -o -z "$threshold_low" ]; then + tst_brk_ TBROK "tst_netload_compare: invalid argument(s)" + fi + + local res=$(((base_time - new_time) * 100 / base_time)) + local msg="performance result is ${res}%" + + if [ "$res" -lt "$threshold_low" ]; then + tst_res_ TFAIL "$msg < threshold ${threshold_low}%" + return + fi + + [ "$threshold_hi" ] && [ "$res" -gt "$threshold_hi" ] && \ + tst_res_ TWARN "$msg > threshold ${threshold_hi}%" + + tst_res_ TPASS "$msg, in range [${threshold_low}:${threshold_hi:-}]%" +} + # tst_ping [IFACE] [DST ADDR] [MESSAGE SIZE ARRAY] # Check icmp connectivity # IFACE: source interface name or IP address diff --git a/testcases/network/busy_poll/busy_poll01.sh b/testcases/network/busy_poll/busy_poll01.sh index 0023f6cef..d306d1be8 100755 --- a/testcases/network/busy_poll/busy_poll01.sh +++ b/testcases/network/busy_poll/busy_poll01.sh @@ -1,6 +1,6 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later -# Copyright (c) 2015-2018 Oracle and/or its affiliates. All Rights Reserved. +# Copyright (c) 2015-2020 Oracle and/or its affiliates. All Rights Reserved. # # Author: Alexey Kodanev @@ -47,13 +47,7 @@ test() tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x done - local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) )) - - if [ "$poll_cmp" -lt 1 ]; then - tst_res TFAIL "busy poll result is '$poll_cmp' %" - else - tst_res TPASS "busy poll increased performance by '$poll_cmp' %" - fi + tst_netload_compare $(cat res_0) $(cat res_50) 1 } tst_run diff --git a/testcases/network/busy_poll/busy_poll02.sh b/testcases/network/busy_poll/busy_poll02.sh index 1f25b7373..abb5160f9 100755 --- a/testcases/network/busy_poll/busy_poll02.sh +++ b/testcases/network/busy_poll/busy_poll02.sh @@ -37,13 +37,7 @@ test() tst_netload -H $(tst_ipaddr rhost) -n 10 -N 10 -d res_$x -b $x done - local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) )) - - if [ "$poll_cmp" -lt 1 ]; then - tst_res TFAIL "busy poll result is '$poll_cmp' %" - else - tst_res TPASS "busy poll increased performance by '$poll_cmp' %" - fi + tst_netload_compare $(cat res_0) $(cat res_50) 1 } tst_run diff --git a/testcases/network/busy_poll/busy_poll03.sh b/testcases/network/busy_poll/busy_poll03.sh index 3c7029927..55ffefb07 100755 --- a/testcases/network/busy_poll/busy_poll03.sh +++ b/testcases/network/busy_poll/busy_poll03.sh @@ -40,13 +40,7 @@ test() -b $x -T $2 done - local poll_cmp=$(( 100 - ($(cat res_50) * 100) / $(cat res_0) )) - - if [ "$poll_cmp" -lt 1 ]; then - tst_res TFAIL "busy poll result is '$poll_cmp' %" - else - tst_res TPASS "busy poll increased performance by '$poll_cmp' %" - fi + tst_netload_compare $(cat res_0) $(cat res_50) 1 } tst_run diff --git a/testcases/network/dccp/dccp01.sh b/testcases/network/dccp/dccp01.sh index d18ac6f18..52f232591 100755 --- a/testcases/network/dccp/dccp01.sh +++ b/testcases/network/dccp/dccp01.sh @@ -9,17 +9,6 @@ TST_NEEDS_ROOT=1 . tst_net.sh -compare() -{ - local per=$(( $res0 * 100 / $res1 - 100 )) - - if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then - tst_res TFAIL "$1 performance $per %" - else - tst_res TPASS "$1 performance $per % in range -100 ... 100 %" - fi -} - test1() { tst_res TINFO "run UDP" @@ -31,14 +20,14 @@ test2() tst_res TINFO "compare UDP/DCCP performance" tst_netload -H $(tst_ipaddr rhost) -T dccp res1="$(cat tst_netload.res)" - compare DCCP + tst_netload_compare $res0 $res1 -100 100 } test3() { tst_res TINFO "compare UDP/UDP-Lite performance" tst_netload -H $(tst_ipaddr rhost) -T udp_lite res1="$(cat tst_netload.res)" - compare UDP-Lite + tst_netload_compare $res0 $res1 -100 100 } tst_run diff --git a/testcases/network/sctp/sctp01.sh b/testcases/network/sctp/sctp01.sh index a66020061..a42bd4975 100755 --- a/testcases/network/sctp/sctp01.sh +++ b/testcases/network/sctp/sctp01.sh @@ -23,13 +23,7 @@ test() tst_netload -S $(tst_ipaddr) -H $(tst_ipaddr rhost) -T sctp -R 3 $opts local res1="$(cat tst_netload.res)" - local per=$(( $res0 * 100 / $res1 - 100 )) - - if [ "$per" -gt "100" -o "$per" -lt "-100" ]; then - tst_res TFAIL "sctp performance $per %" - else - tst_res TPASS "sctp performance $per % in range -100 ... 100 %" - fi + tst_netload_compare $res0 $res1 -200 200 } tst_run diff --git a/testcases/network/tcp_cc/bbr01.sh b/testcases/network/tcp_cc/bbr01.sh index a6592b32d..3b80d50e4 100755 --- a/testcases/network/tcp_cc/bbr01.sh +++ b/testcases/network/tcp_cc/bbr01.sh @@ -27,7 +27,7 @@ setup() do_test() { - tcp_cc_test01 bbr -50 + tcp_cc_test01 bbr -100 } tst_run diff --git a/testcases/network/tcp_cc/bbr02.sh b/testcases/network/tcp_cc/bbr02.sh index b04c0c173..3a61e8726 100755 --- a/testcases/network/tcp_cc/bbr02.sh +++ b/testcases/network/tcp_cc/bbr02.sh @@ -34,7 +34,7 @@ setup() do_test() { tcp_cc_set_qdisc $2 || return - tcp_cc_test01 bbr -50 + tcp_cc_test01 bbr -100 } tst_run diff --git a/testcases/network/tcp_cc/dctcp01.sh b/testcases/network/tcp_cc/dctcp01.sh index 14ee96dbf..45311c5a2 100755 --- a/testcases/network/tcp_cc/dctcp01.sh +++ b/testcases/network/tcp_cc/dctcp01.sh @@ -33,7 +33,7 @@ setup() do_test() { - tcp_cc_test01 dctcp 10 + tcp_cc_test01 dctcp -100 } tst_run diff --git a/testcases/network/tcp_cc/tcp_cc_lib.sh b/testcases/network/tcp_cc/tcp_cc_lib.sh index 815cc9c0e..dff8cef19 100755 --- a/testcases/network/tcp_cc/tcp_cc_lib.sh +++ b/testcases/network/tcp_cc/tcp_cc_lib.sh @@ -101,11 +101,5 @@ tcp_cc_test01() tst_netload -H $(tst_ipaddr rhost) -A $TST_NET_MAX_PKT local res1="$(cat tst_netload.res)" - local per=$(( $res0 * 100 / $res1 - 100 )) - - if [ "$per" -lt "$threshold" ]; then - tst_res TFAIL "$alg performance $per %" - else - tst_res TPASS "$alg performance $per %" - fi + tst_netload_compare $res0 $res1 $threshold } diff --git a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh index a4b542220..fb2cb8fc2 100755 --- a/testcases/network/tcp_fastopen/tcp_fastopen_run.sh +++ b/testcases/network/tcp_fastopen/tcp_fastopen_run.sh @@ -36,17 +36,6 @@ cleanup() tc qdisc del dev $(tst_iface) root netem delay 100 >/dev/null } -compare() -{ - tfo_cmp=$(( 100 - ($time_tfo_on * 100) / $time_tfo_off )) - - if [ "$tfo_cmp" -lt 3 ]; then - tst_res TFAIL "$1 perf result is '$tfo_cmp' percent" - else - tst_res TPASS "$1 perf result is '$tfo_cmp' percent" - fi -} - setup() { if tst_kvcmp -lt "3.16" && [ "$TST_IPV6" ]; then @@ -66,7 +55,7 @@ test1() tst_netload -H $(tst_ipaddr rhost) -f -t 3 -R $srv_replies time_tfo_on=$(cat tst_netload.res) - compare + tst_netload_compare $time_tfo_off $time_tfo_on 3 } test2() @@ -78,7 +67,7 @@ test2() tst_netload -H $(tst_ipaddr rhost) -F -t 3 -R $srv_replies time_tfo_on=$(cat tst_netload.res) - compare + tst_netload_compare $time_tfo_off $time_tfo_on 3 } tst_run diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index cb2b2ba97..80b9bcc90 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -295,25 +295,8 @@ virt_compare_netperf() local lt="$(cat res_lan)" tst_res TINFO "time lan IPv${TST_IPVER}($lt) $virt_type IPv4($vt) and IPv6($vt6) ms" - per=$(( $vt * 100 / $lt - 100 )) - per6=$(( $vt6 * 100 / $lt - 100 )) - - case "$virt_type" in - vxlan|geneve) - tst_res TINFO "IP4 $virt_type over IP$TST_IPVER slower by $per %" - tst_res TINFO "IP6 $virt_type over IP$TST_IPVER slower by $per6 %" - ;; - *) - tst_res TINFO "IP4 $virt_type slower by $per %" - tst_res TINFO "IP6 $virt_type slower by $per6 %" - esac - - if [ "$per" -ge "$VIRT_PERF_THRESHOLD" -o \ - "$per6" -ge "$VIRT_PERF_THRESHOLD" ]; then - tst_res TFAIL "Test failed, threshold: $VIRT_PERF_THRESHOLD %" - else - tst_res TPASS "Test passed, threshold: $VIRT_PERF_THRESHOLD %" - fi + tst_netload_compare $lt $vt "-$VIRT_PERF_THRESHOLD" + tst_netload_compare $lt $vt6 "-$VIRT_PERF_THRESHOLD" } virt_check_cmd() From patchwork Thu Oct 15 12:20:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1382601 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 (sender SPF authorized) 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.a=rsa-sha256 header.s=corp-2020-01-29 header.b=G45OOFA4; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBpLH0BMBz9sV0 for ; Thu, 15 Oct 2020 23:21:42 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 47B8F3C324F for ; Thu, 15 Oct 2020 14:21:40 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-5.smtp.seeweb.it (in-5.smtp.seeweb.it [217.194.8.5]) by picard.linux.it (Postfix) with ESMTP id B41B93C324C for ; Thu, 15 Oct 2020 14:21:21 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by in-5.smtp.seeweb.it (Postfix) with ESMTPS id C47596002CE for ; Thu, 15 Oct 2020 14:21:20 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCENjX092324 for ; Thu, 15 Oct 2020 12:21:17 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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=UTNNXF26sT/A+p/sNMe7KK6TNLjVygZwr9PpdRtzkNc=; b=G45OOFA4NtxY6+cTeYAk2g9xZkAPHsQ1HO7/gnNoe/IGam1usppsqekLjS22i/jvvLk1 UlX2wKAbdsEnsMpLYZIoJ8zBjBr+lGAroVqlUoZxESNwaSe1myRwetFBCcBANC9iJLih U9NoXz9T2WfMdHJDPk8ZvYFGbrkAZMkhb0iQ+E3CXt/pbhN1mcEHPcZ23Tlwbc1KmK/O APNuzc3zXjAjIZGcWH9Ja6ObAQ1LlVvvZQ8LrkydEbVddlrbbYifnsoero6vOx7Ug+kI OR8MpDl+9a6jO3/wStKzTu7UwE96DzXiwheoYikEm6huftrVOSMN3MfzreXGp+VgzLzW YA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 3434wkvcdu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCFLDp014221 for ; Thu, 15 Oct 2020 12:21:17 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 343pv1rr4f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09FCLEIh023932 for ; Thu, 15 Oct 2020 12:21:16 GMT Received: from gyrotron.uk.oracle.com (/10.175.204.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Oct 2020 05:21:13 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 15 Oct 2020 15:20:53 +0300 Message-Id: <20201015122056.20715-2-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201015122056.20715-1-alexey.kodanev@oracle.com> References: <20201015122056.20715-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 suspectscore=1 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=1 impostorscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Virus-Scanned: clamav-milter 0.102.4 at in-5.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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-5.smtp.seeweb.it Subject: [LTP] [PATCH 2/5] lib/tst_net: calc mean in tst_netload() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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 TST_NETLOAD_RUN_COUNT to control how many times netstress test will be run to calculate the mean time value. Default is 5. This value will divide the total number of requests in order not to significantly increase the time for the test after this patch. Moreover, one of the runs can fail once, it will produce only a warning. The test will broke after the second failure. It can be useful to make sure we have reproducible results. Signed-off-by: Alexey Kodanev --- testcases/lib/tst_net.sh | 95 ++++++++++++++++++++++++++-------------- 1 file changed, 62 insertions(+), 33 deletions(-) diff --git a/testcases/lib/tst_net.sh b/testcases/lib/tst_net.sh index b29e076c3..1912b984d 100644 --- a/testcases/lib/tst_net.sh +++ b/testcases/lib/tst_net.sh @@ -623,9 +623,11 @@ tst_wait_ipv6_dad() done } -tst_dump_rhost_cmd() +tst_netload_brk() { tst_rhost_run -c "cat $TST_TMPDIR/netstress.log" + cat tst_netload.log + tst_brk_ $1 $2 } # Run network load test, see 'netstress -h' for option description @@ -640,6 +642,7 @@ tst_netload() # common options for client and server local cs_opts= + local run_cnt="$TST_NETLOAD_RUN_COUNT" local c_num="$TST_NETLOAD_CLN_NUMBER" local c_requests="$TST_NETLOAD_CLN_REQUESTS" local c_opts= @@ -692,51 +695,76 @@ tst_netload() local expect_ret=0 [ "$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" - tst_res_ TINFO "run server 'netstress $s_opts'" - tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1 - if [ $? -ne 0 ]; then - cat tst_netload.log - local ttype="TFAIL" - grep -e 'CONF:' tst_netload.log && ttype="TCONF" - tst_brk_ $ttype "server failed" + local was_failure=0 + if [ "$run_cnt" -lt 2 ]; then + run_cnt=1 + was_failure=1 fi - local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port") - c_opts="${cs_opts}${c_opts}-a $c_num -r $c_requests -d $rfile -g $port" + s_opts="${cs_opts}${s_opts}-R $s_replies -B $TST_TMPDIR" + c_opts="${cs_opts}${c_opts}-a $c_num -r $((c_requests / run_cnt)) -d $rfile" + + tst_res_ TINFO "run server 'netstress $s_opts'" + tst_res_ TINFO "run client 'netstress -l $c_opts' $run_cnt times" - tst_res_ TINFO "run client 'netstress -l $c_opts'" - netstress -l $c_opts > tst_netload.log 2>&1 || ret=$? tst_rhost_run -c "pkill -9 netstress\$" + rm -f tst_netload.log + + local res=0 + local passed=0 + + for i in $(seq 1 $run_cnt); do + tst_rhost_run -c "netstress $s_opts" > tst_netload.log 2>&1 + if [ $? -ne 0 ]; then + cat tst_netload.log + local ttype="TFAIL" + grep -e 'CONF:' tst_netload.log && ttype="TCONF" + tst_brk_ $ttype "server failed" + fi - if [ "$expect_ret" -ne 0 ]; then - if [ $((ret & expect_ret)) -ne 0 ]; then - tst_res_ TPASS "netstress failed as expected" - else - tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'" + local port=$(tst_rhost_run -s -c "cat $TST_TMPDIR/netstress_port") + netstress -l ${c_opts} -g $port > tst_netload.log 2>&1 + ret=$? + tst_rhost_run -c "pkill -9 netstress\$" + + if [ "$expect_ret" -ne 0 ]; then + if [ $((ret & expect_ret)) -ne 0 ]; then + tst_res_ TPASS "netstress failed as expected" + else + tst_res_ TFAIL "expected '$expect_res' but ret: '$ret'" + fi + return $ret + fi + + if [ "$ret" -ne 0 ]; then + [ $((ret & 32)) -ne 0 ] && \ + tst_netload_brk TCONF "not supported configuration" + + [ $((ret & 3)) -ne 0 -a $was_failure -gt 0 ] && \ + tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'" + + tst_res_ TWARN "netstress failed, ret: $ret" + was_failure=1 + continue fi - return $ret - fi + + [ ! -f $rfile ] && \ + tst_netload_brk TFAIL "can't read $rfile" + + res="$((res + $(cat $rfile)))" + passed=$((passed + 1)) + done if [ "$ret" -ne 0 ]; then - tst_dump_rhost_cmd - cat tst_netload.log - [ $((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" + tst_netload_brk TFAIL "expected '$expect_res' but ret: '$ret'" fi - if [ ! -f $rfile ]; then - tst_dump_rhost_cmd - cat tst_netload.log - tst_brk_ TFAIL "can't read $rfile" - fi + res=$((res / $passed)) + echo "$res" > $rfile - tst_res_ TPASS "netstress passed, time spent '$(cat $rfile)' ms" + tst_res_ TPASS "netstress passed, mean time '$res' ms" return $ret } @@ -938,6 +966,7 @@ export TST_NET_DATAROOT="$LTPROOT/testcases/bin/datafiles" 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 TST_NETLOAD_RUN_COUNT="${TST_NETLOAD_RUN_COUNT:-5}" 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}" From patchwork Thu Oct 15 12:20:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1382600 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 (sender SPF authorized) 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.a=rsa-sha256 header.s=corp-2020-01-29 header.b=tMIoq0Pi; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBpLF1hVNz9sV0 for ; Thu, 15 Oct 2020 23:21:34 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 3667D3C57DC for ; Thu, 15 Oct 2020 14:21:24 +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 [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 92E463C23F5 for ; Thu, 15 Oct 2020 14:21:21 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (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 BE50C600D9D for ; Thu, 15 Oct 2020 14:21:20 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCEbJN092403 for ; Thu, 15 Oct 2020 12:21:17 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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=iPj4VbM7F3glZtqcuKKby9ieuRJfXD3NEZGDlhljUZE=; b=tMIoq0PiQnZ9HzWVoOElHAE+s45G0teEx0/MbIGHqt9NuoNk9dBhOtJuRb+N1ZnimWWE 4izQYjrDBe+Mh29kSdSiEjDuBkpdYDv0Zc/Jj31dksm82aoZin6TvLZO0IhNkHNwEqMk ZsXmii2BvI2eqHwZamqH1Fo5onDDbTZURU92pWxtKjLcW4QmA262M3rDpOv6e1WNW7V0 ApeAMm6nfrOdd0LHRRuj7ARk4pkWQ1lW3x0Tr/LK0NUK4euAH3CMmw3Wv54dTDH/LGpp Riz4M7ituz1HGPNefA0toqnWbzStaSkQnfxlh2C7nWppzvD4g1oShArg2c/ZrI/BZ/cz 4A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 3434wkvcdt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCFj56035404 for ; Thu, 15 Oct 2020 12:21:17 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3030.oracle.com with ESMTP id 343phr0mgk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09FCLFP2020861 for ; Thu, 15 Oct 2020 12:21:16 GMT Received: from gyrotron.uk.oracle.com (/10.175.204.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Oct 2020 05:21:14 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 15 Oct 2020 15:20:54 +0300 Message-Id: <20201015122056.20715-3-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201015122056.20715-1-alexey.kodanev@oracle.com> References: <20201015122056.20715-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 spamscore=0 adultscore=0 bulkscore=0 mlxlogscore=824 malwarescore=0 mlxscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=1 impostorscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=836 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 3/5] network/virt: skip setting neighbour table if tunnel doesn't have hwaddr X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- testcases/network/virt/virt_lib.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index 80b9bcc90..f62120347 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -229,10 +229,13 @@ virt_minimize_timeout() local mac_loc="$(cat /sys/class/net/ltp_v0/address)" local mac_rmt="$(tst_rhost_run -c 'cat /sys/class/net/ltp_v0/address')" - ROD_SILENT "ip ne replace $ip_virt_remote lladdr \ - $mac_rmt nud permanent dev ltp_v0" - tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \ - $mac_loc nud permanent dev ltp_v0" + if [ "$mac_loc" ]; then + ROD_SILENT "ip ne replace $ip_virt_remote lladdr \ + $mac_rmt nud permanent dev ltp_v0" + tst_rhost_run -s -c "ip ne replace $ip_virt_local lladdr \ + $mac_loc nud permanent dev ltp_v0" + fi + virt_tcp_syn=$(sysctl -n net.ipv4.tcp_syn_retries) ROD sysctl -q net.ipv4.tcp_syn_retries=1 } From patchwork Thu Oct 15 12:20:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1382602 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 (sender SPF authorized) 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.a=rsa-sha256 header.s=corp-2020-01-29 header.b=fhzqbxiG; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBpNG4DZhz9sTL for ; Thu, 15 Oct 2020 23:23:26 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 0F4943C57DC for ; Thu, 15 Oct 2020 14:23:24 +0200 (CEST) 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 092343C23F5 for ; Thu, 15 Oct 2020 14:23:20 +0200 (CEST) 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-6.smtp.seeweb.it (Postfix) with ESMTPS id B15A21400759 for ; Thu, 15 Oct 2020 14:23:19 +0200 (CEST) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCEgSc178760 for ; Thu, 15 Oct 2020 12:23:18 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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=DHt1VDhrSWVJpfe5AIqNrY3718TXmMX/TygXfXxOoS4=; b=fhzqbxiGgeDTTwxb3c2ncHmQ9irY3Cv46dDNbDeA8Q3ADG8L+8j11Ar9SVnLzjG5DuHW Q1/HRVmMysR2Q2NC3fw7qba08mr4qILf8avtfK5LEzJUKRTINQ3jDqHkaeAtHSSbgsIF jU82335mzDrHs/Icv7WQCuVFOJHgp2nNQ+WvV5xyFZY98ACgBrAMAGJdMBX6ql/TrjIg rvb6QgN9+YVsEaB7SegaF01Qe7QV1+WVuT0fcszSHPZE977LsixaQ3q5nvXLLmiOcoZV ID8zmyt+8KEqc6zF+jfwRlI6+uAXsjvLfWuv2/WdkqjS0Cdz9aeOgqkFHHNySu8UUfNf Hg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2130.oracle.com with ESMTP id 346g8ghj0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Oct 2020 12:23:18 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCFdkm079818 for ; Thu, 15 Oct 2020 12:21:17 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 344by53w3r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 12:21:17 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 09FCLGJ9020867 for ; Thu, 15 Oct 2020 12:21:16 GMT Received: from gyrotron.uk.oracle.com (/10.175.204.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Oct 2020 05:21:15 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 15 Oct 2020 15:20:55 +0300 Message-Id: <20201015122056.20715-4-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201015122056.20715-1-alexey.kodanev@oracle.com> References: <20201015122056.20715-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 suspectscore=1 mlxscore=0 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 impostorscore=0 suspectscore=1 priorityscore=1501 phishscore=0 clxscore=1015 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 4/5] network/virt: add wireguard01 X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" * performance tests with TCP traffic * invalid configuration with allowed IPs, public key * emulation of the lossy link for the underlying interface. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- runtest/net.features | 3 ++ testcases/network/virt/virt_lib.sh | 4 +- testcases/network/virt/wireguard01.sh | 56 ++++++++++++++++++++ testcases/network/virt/wireguard_lib.sh | 68 +++++++++++++++++++++++++ 4 files changed, 129 insertions(+), 2 deletions(-) create mode 100755 testcases/network/virt/wireguard01.sh create mode 100755 testcases/network/virt/wireguard_lib.sh diff --git a/runtest/net.features b/runtest/net.features index 44a974563..c5a1ba714 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -78,3 +78,6 @@ mpls03_ipv6 mpls03.sh -6 mpls04 mpls04.sh fanout01 fanout01 + +wireguard01 wireguard01.sh +wireguard01_ipv6 wireguard01.sh -6 diff --git a/testcases/network/virt/virt_lib.sh b/testcases/network/virt/virt_lib.sh index f62120347..abf331428 100644 --- a/testcases/network/virt/virt_lib.sh +++ b/testcases/network/virt/virt_lib.sh @@ -124,7 +124,7 @@ virt_add() esac case $virt_type in - vxlan|geneve|sit) + vxlan|geneve|sit|wireguard) ip li add $vname type $virt_type $opt ;; gre|ip6gre) @@ -145,7 +145,7 @@ virt_add_rhost() [ "$vxlan_dstport" -eq 1 ] && opt="$opt dstport 0" tst_rhost_run -s -c "ip li add ltp_v0 type $virt_type $@ $opt" ;; - sit) + sit|wireguard) tst_rhost_run -s -c "ip link add ltp_v0 type $virt_type $@" ;; gre|ip6gre) diff --git a/testcases/network/virt/wireguard01.sh b/testcases/network/virt/wireguard01.sh new file mode 100755 index 000000000..ff0c7e92b --- /dev/null +++ b/testcases/network/virt/wireguard01.sh @@ -0,0 +1,56 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved. + +TST_NEEDS_CMDS="tc" +TST_SETUP=setup +TST_CLEANUP=cleanup +TST_TESTFUNC=test +TST_CNT=3 + +. wireguard_lib.sh + +setup() +{ + if [ -n "$LTP_NETNS" -a "$VIRT_PERF_THRESHOLD" -lt 700 ]; then + tst_res TINFO "Adjust threshold for veth (no encap/encrypt)" + VIRT_PERF_THRESHOLD=700 + fi + + local netem_opt="reorder 30% 50% delay 1" + tst_res TINFO "Use netem $netem_opt" + ROD tc qdisc add dev $(tst_iface) root netem $netem_opt + wireguard_lib_setup +} + +cleanup() +{ + tc qdisc del dev $(tst_iface) root netem >/dev/null 2>&1 + wireguard_lib_cleanup +} + +test1() +{ + tst_res TINFO "Using correct wireguard configuration" + virt_netperf_msg_sizes + wireguard_lib_cleanup +} + +test2() +{ + tst_res TINFO "Invalid configuration with allowed IPs" + wireguard_lib_setup invalid_allowed_ips + virt_minimize_timeout + virt_compare_netperf "fail" + wireguard_lib_cleanup +} + +test3() +{ + tst_res TINFO "Invalid configuration with public keys" + wireguard_lib_setup invalid_pub_keys + virt_minimize_timeout + virt_compare_netperf "fail" +} + +tst_run diff --git a/testcases/network/virt/wireguard_lib.sh b/testcases/network/virt/wireguard_lib.sh new file mode 100755 index 000000000..c6ea7334e --- /dev/null +++ b/testcases/network/virt/wireguard_lib.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved. + +TST_NEEDS_TMPDIR=1 +TST_NEEDS_CMDS="$TST_NEEDS_CMDS wg" +TST_TESTFUNC=${TST_TESTFUNC:-virt_netperf_msg_sizes} +TST_SETUP=${TST_SETUP:-wireguard_lib_setup} +TST_CLEANUP=${TST_CLEANUP:-wireguard_lib_cleanup} +TST_NEEDS_DRIVERS="wireguard" +VIRT_PERF_THRESHOLD_MIN=${VIRT_PERF_THRESHOLD_MIN:-200} + +virt_type="wireguard" +. virt_lib.sh + +# Usage: wireguard_lib_setup [TYPE] +# TYPE: [ default | invalid_allowed_ips | invalid_pub_keys ] +wireguard_lib_setup() +{ + local type="${1:-default}" + local pub_key0="$(wg genkey | tee wg0.key | wg pubkey)" + local pub_key1="$(wg genkey | tee wg1.key | wg pubkey)" + + local port_loc="$(tst_get_unused_port ipv${TST_IPVER} dgram)" + local port_rmt=$(tst_rhost_run -c "tst_get_unused_port ipv${TST_IPVER} dgram") + + # copy private key to remote host + tst_rhost_run -s -c "echo '$(cat wg1.key)' > wg1.key" + + tst_res TINFO "setup wireguard UDPv${TST_IPVER} tunnel, port $port_loc/$port_rmt" + tst_res TINFO "lhost[$(tst_ipaddr)] <-> rhost[$(tst_ipaddr rhost)]" + + virt_setup + + local ka_opt="persistent-keepalive 1" + local allow_ip_loc="${ip_virt_local}/32,${ip6_virt_local}/128" + local allow_ip_rmt="${ip_virt_remote}/32,${ip6_virt_remote}/128" + + case $type in + invalid_allowed_ips) + allow_ip_loc="${ip_virt_remote}/32,${ip6_virt_remote}/128" + allow_ip_rmt="${ip_virt_local}/32,${ip6_virt_local}/128" + tst_res TINFO "Allowed IPs are source IPs only" + ;; + invalid_pub_keys) + pub_key0="$(wg genkey | wg pubkey)" + tst_res TINFO "Invalid peer public key of lhost" + ;; + esac + + ROD wg set ltp_v0 listen-port $port_loc private-key wg0.key + ROD wg set ltp_v0 peer $pub_key1 endpoint \ + $(tst_ipaddr rhost):$port_rmt $ka_opt \ + allowed-ips $allow_ip_rmt + + tst_rhost_run -s -c \ + "wg set ltp_v0 listen-port $port_rmt private-key wg1.key" + tst_rhost_run -s -c "wg set ltp_v0 peer $pub_key0 \ + endpoint $(tst_ipaddr):$port_loc $ka_opt \ + allowed-ips $allow_ip_loc" + + tst_net_run -s "ip route add 128.0.0.0/1 dev ltp_v0" +} + +wireguard_lib_cleanup() +{ + virt_cleanup +} From patchwork Thu Oct 15 12:20:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kodanev X-Patchwork-Id: 1382599 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 (sender SPF authorized) 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.a=rsa-sha256 header.s=corp-2020-01-29 header.b=qp5jnzjU; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CBpLD2zVHz9sTL for ; Thu, 15 Oct 2020 23:21:34 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 2F47C3C57E1 for ; Thu, 15 Oct 2020 14:21:32 +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 [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id B09693C29C1 for ; Thu, 15 Oct 2020 14:21:21 +0200 (CEST) Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) (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 C3E27600EA4 for ; Thu, 15 Oct 2020 14:21:20 +0200 (CEST) Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCEMaG092298 for ; Thu, 15 Oct 2020 12:21:19 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 : mime-version : content-transfer-encoding; s=corp-2020-01-29; bh=cS3p72FOJI+SGYpe/jjo2nLEOSTQusXd0ZGkrVU9U84=; b=qp5jnzjUeZHwVSMYkE+ZFgOFt9IirImhxd9/DjMs5gHZfAOUnc7Zp8y1wkJR8tk63NLb VGXJaKTqIvMsCde3BzhCQaCDgcyCA6B4U9toKYrRFWcdaaNSAtb5ezDXyQpfCRHPC0MP m2dqsbGNf1RI5Z6C6TAA9NwW7m+J6dv8Knd3JuouxATspD3f+YXge51OLoyhT9vwfM+r PqTGG1/Yuq8yBdknnEigHpV/IvFNSLewlX6LFUnr8MNJgZf1AvPAvdRVVhc0rW3dydZS LMeyRm0oqP6Vx4asFpXWpGvUdq0dialdlcEIrz4AgKXLhNeVZS+yTN5tYD/3c5dcbaLD 3A== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 3434wkvcdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 15 Oct 2020 12:21:19 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 09FCFLqT014165 for ; Thu, 15 Oct 2020 12:21:18 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserp3020.oracle.com with ESMTP id 343pv1rr5e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 15 Oct 2020 12:21:18 +0000 Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 09FCLHA6025327 for ; Thu, 15 Oct 2020 12:21:18 GMT Received: from gyrotron.uk.oracle.com (/10.175.204.150) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Oct 2020 05:21:16 -0700 From: Alexey Kodanev To: ltp@lists.linux.it Date: Thu, 15 Oct 2020 15:20:56 +0300 Message-Id: <20201015122056.20715-5-alexey.kodanev@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201015122056.20715-1-alexey.kodanev@oracle.com> References: <20201015122056.20715-1-alexey.kodanev@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 suspectscore=1 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9774 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 phishscore=0 suspectscore=1 impostorscore=0 clxscore=1015 spamscore=0 priorityscore=1501 bulkscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010150089 X-Virus-Scanned: clamav-milter 0.102.4 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,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH 5/5] network/virt: add wireguard02: ipsec vs wireguard X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 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" Compare multi-threading performance with IPSec/vti. Signed-off-by: Alexey Kodanev Reviewed-by: Petr Vorel --- runtest/net.features | 2 ++ testcases/lib/tst_test.sh | 2 +- testcases/network/virt/wireguard02.sh | 48 +++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100755 testcases/network/virt/wireguard02.sh diff --git a/runtest/net.features b/runtest/net.features index c5a1ba714..617a6b91e 100644 --- a/runtest/net.features +++ b/runtest/net.features @@ -81,3 +81,5 @@ fanout01 fanout01 wireguard01 wireguard01.sh wireguard01_ipv6 wireguard01.sh -6 +wireguard02 wireguard02.sh +wireguard02_ipv6 wireguard02.sh -6 diff --git a/testcases/lib/tst_test.sh b/testcases/lib/tst_test.sh index f2bd1e3ef..2417da140 100644 --- a/testcases/lib/tst_test.sh +++ b/testcases/lib/tst_test.sh @@ -506,7 +506,7 @@ tst_run() NEEDS_DRIVERS|FS_TYPE|MNTPOINT|MNT_PARAMS);; IPV6|IPVER|TEST_DATA|TEST_DATA_IFS);; RETRY_FUNC|RETRY_FN_EXP_BACKOFF|TIMEOUT);; - NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG);; + NET_DATAROOT|NET_MAX_PKT|NET_RHOST_RUN_DEBUG|NETLOAD_CLN_NUMBER);; *) tst_res TWARN "Reserved variable TST_$_tst_i used!";; esac done diff --git a/testcases/network/virt/wireguard02.sh b/testcases/network/virt/wireguard02.sh new file mode 100755 index 000000000..c16ae68d1 --- /dev/null +++ b/testcases/network/virt/wireguard02.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (c) 2020 Oracle and/or its affiliates. All Rights Reserved. + +TST_CLEANUP=cleanup +TST_TESTFUNC=test1 +TST_SETUP=wireguard_lib_setup + +. ipsec_lib.sh +. wireguard_lib.sh + +IPSEC_MODE="tunnel" +IPSEC_PROTO="esp_aead" +AEALGO="rfc4106_256" +EALGO="aes" +AALGO="sha256" + +cleanup() +{ + wireguard_lib_cleanup + tst_ipsec_cleanup +} + +test1() +{ + local wgaddr + local clients_num="$TST_NETLOAD_CLN_NUMBER" + + # Enforce multi-threading test, at least with 10 TCP clients + [ $clients_num -lt 10 ] && clients_num=10 + + tst_res TINFO "test wireguard" + + [ -n "$TST_IPV6" ] && wgaddr="$ip6_virt_remote" || wgaddr="$ip_virt_remote" + tst_netload -H $wgaddr -a $clients_num -D ltp_v0 + local time_wg=$(cat tst_netload.res) + wireguard_lib_cleanup + + tst_res TINFO "test IPSec $IPSEC_MODE/$IPSEC_PROTO $EALGO" + tst_ipsec_setup_vti + tst_netload -H $ip_rmt_tun -a $clients_num -D $tst_vti + local time_ipsec=$(cat tst_netload.res) + tst_ipsec_cleanup + + tst_netload_compare $time_ipsec $time_wg -100 +} + +tst_run