From patchwork Thu Sep 6 04:31:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Pettit X-Patchwork-Id: 966782 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=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 425SLn3JlVz9s3l for ; Thu, 6 Sep 2018 14:31:12 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 5982292B; Thu, 6 Sep 2018 04:31:09 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 807148B1 for ; Thu, 6 Sep 2018 04:31:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7AB012D5 for ; Thu, 6 Sep 2018 04:31:07 +0000 (UTC) X-Originating-IP: 76.21.1.228 Received: from localhost.localdomain (unknown [76.21.1.228]) (Authenticated sender: jpettit@ovn.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 3B63420005 for ; Thu, 6 Sep 2018 04:31:04 +0000 (UTC) From: Justin Pettit To: dev@openvswitch.org Date: Wed, 5 Sep 2018 21:31:01 -0700 Message-Id: <20180906043101.40003-1-jpettit@ovn.org> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] ovn.at: Skip ACL rate-limiting test on slow/overloaded systems. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org In ACL rate-limiting test, we send three sets of 100 packets. One of the sets drops packets at a rate of 10 per second, one at a rate of 5 per second, and one not at all. On my setup, it takes roughly 0.67 seconds to send those 300 packets, but we have reports of it taking over 15 seconds on others. The test was intended to allow some flexibility in run-time, but it's very difficult to design a mechanism that can all possibilities. To prevent false test failures, this patch changes the test to check the duration count of the meter, and if it's greater than nine seconds, just skip the test. Signed-off-by: Justin Pettit Reported-by: Thomas Goirand --- tests/ovn.at | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/ovn.at b/tests/ovn.at index e10a7f9bab59..1fe4a4d4bf1c 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -6500,15 +6500,23 @@ for i in `seq 1 100`; do ovs-appctl netdev-dummy/receive lp1 'in_port(1),eth(src=f0:00:00:00:00:01,dst=f0:00:00:00:00:02),eth_type(0x0800),ipv4(src=192.168.1.2,dst=192.168.1.3,proto=6,tos=0,ttl=64,frag=no),tcp(src=7777,dst=82)' done +# The rate at which packets are sent is highly system-dependent, so we +# can't count on precise drop counts. To work around that, we just +# check that exactly 100 "http-acl3" actions were logged and that there +# were more "http-acl1" actions than "http-acl2" ones. +OVS_WAIT_UNTIL([ test 100 = $(grep -c 'http-acl3' hv/ovn-controller.log) ]) + +# On particularly slow or overloaded systems, the transmission rate may +# be lower than the configured meter rate. To prevent false test +# failures, we check the duration count of the meter, and if it's +# greater than nine seconds, just skip the test. +d_secs=$(as hv ovs-ofctl -O OpenFlow13 meter-stats br-int | grep "meter:1" | sed 's/.* duration:\([[0-9]]\{1,\}\)\.[[0-9]]\+s .*/\1/') +AT_SKIP_IF([test $d_secs -gt 9]) + # Print some information that may help debugging. as hv ovs-appctl -t ovn-controller meter-table-list as hv ovs-ofctl -O OpenFlow13 meter-stats br-int -# The userspace meter implementation doesn't precisely enforce counts, -# so we just check that exactly 100 "http-acl3" actions were logged and -# that there were more "http-acl1" actions than "http-acl2" ones. -OVS_WAIT_UNTIL([ test 100 = $(grep -c 'http-acl3' hv/ovn-controller.log) ]) - n_acl1=$(grep -c 'http-acl1' hv/ovn-controller.log) n_acl2=$(grep -c 'http-acl2' hv/ovn-controller.log) n_acl3=$(grep -c 'http-acl3' hv/ovn-controller.log)