Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3941270imm; Mon, 8 Oct 2018 12:03:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV604a2Wh9OuDy4FKaP8xvs4TJ5VnKFQrzjkP30Y7d2nX7LRtCR6xsbkZfYl4xTohe1tAPIw9 X-Received: by 2002:a65:65c6:: with SMTP id y6-v6mr21888084pgv.233.1539025383057; Mon, 08 Oct 2018 12:03:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539025383; cv=none; d=google.com; s=arc-20160816; b=yjU+SZg7ZPzwtACRSdyZ1oplRrP9/PpvsoloYWf2A/yoMo0KA6TjLCpQ44ePp8Xhqs jT+hF1cqfpm4N9ASqk5Ex1jS6i4VBHT510v6zPGuohxMBgz2wMHH0pmDVmIDsVXj2ByA rJoDsdr/4yqpYrH9X+v3Q+Z9zdlIheKxbEFrwp7Lqpv0lRyfGU7DnGSquNbDrn/A07pZ k9Q3ei98mcDxwQRjXUimDRbU8NEhRr5wLCzMCnfvEUxLH/ygWZEtS4LYv5MQ3de8zubq 8/CB6EXI0gYqQSXhVaQkVfJjClaqmPPPcmAVny1G1dnk2pnQm+lH44OMjblcd8bCFNTp uqKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L1Fqn4sEOq4VQf8sHxi5UoG6gtj1e19F7QlChG+fnqs=; b=YvPUG2AyLsCPiYskj4UqN2IAXwcK/vl9mHGwqnb2nqaap8Ql2GAjx58kmF/e8BVnVM e4TprpRNVq0Eqbej2mBUe3SGx9tpdyycLsJ9Z9c23969YrsOK9m0rpFDLBVOSB8rDyiW +eZnwfu/5sSye+te/YODq00pJq/q8ouhE++Cy/NpQPoKItYIqwIbyYQOQuZK3qUeuQ5E RPU+ABM0sPJllepW6IWkI1KcboMtrmB+raD3hiSK7QvKcsU/atghjwiMJDuCYu0tIT8w 2gwd17n6rvWCa+UCCEb4bYUqBZHGVv0ODKKwosCj3oGpIzkK8IgPEpKpMPlN1tr2JeEx 8NsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H9XVF7/k"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3-v6si18388851plb.122.2018.10.08.12.02.48; Mon, 08 Oct 2018 12:03:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H9XVF7/k"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731573AbeJICBJ (ORCPT + 99 others); Mon, 8 Oct 2018 22:01:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:50050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728239AbeJICBI (ORCPT ); Mon, 8 Oct 2018 22:01:08 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CC2F32087D; Mon, 8 Oct 2018 18:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024481; bh=NjViDnZ83mNSQbBovvNDHu7AAJLQjAAXfsWASIwVf4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H9XVF7/kcktL2QtF/KcNuRheucibCta1yLoqthuTlKWT0/iuMEwmuZRZRA7aeSP6M cZuTz1Nfu6Wd0Fu8b+vVWju1g/Z8VVDEAWRemQHTpGn5XpQtVlZZBSIiBBpjwKXXIp 3b4bUX8YNtLlEkfrsCDQrlqm7vW+0KxjVTLHGV1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paolo Abeni , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 036/168] tc-testing: add test-cases for numeric and invalid control action Date: Mon, 8 Oct 2018 20:30:16 +0200 Message-Id: <20181008175621.421719073@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paolo Abeni [ Upstream commit 25a8238f4cc8425d4aade4f9041be468d0e8aa2e ] Only the police action allows us to specify an arbitrary numeric value for the control action. This change introduces an explicit test case for the above feature and then leverage it for testing the kernel behavior for invalid control actions (reject). Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/testing/selftests/tc-testing/tc-tests/actions/police.json | 48 ++++++++++ 1 file changed, 48 insertions(+) --- a/tools/testing/selftests/tc-testing/tc-tests/actions/police.json +++ b/tools/testing/selftests/tc-testing/tc-tests/actions/police.json @@ -313,6 +313,54 @@ ] }, { + "id": "6aaf", + "name": "Add police actions with conform-exceed control pass/pipe [with numeric values]", + "category": [ + "actions", + "police" + ], + "setup": [ + [ + "$TC actions flush action police", + 0, + 1, + 255 + ] + ], + "cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed 0/3 index 1", + "expExitCode": "0", + "verifyCmd": "$TC actions get action police index 1", + "matchPattern": "action order [0-9]*: police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action pass/pipe", + "matchCount": "1", + "teardown": [ + "$TC actions flush action police" + ] + }, + { + "id": "29b1", + "name": "Add police actions with conform-exceed control /drop", + "category": [ + "actions", + "police" + ], + "setup": [ + [ + "$TC actions flush action police", + 0, + 1, + 255 + ] + ], + "cmdUnderTest": "$TC actions add action police rate 3mbit burst 250k conform-exceed 10/drop index 1", + "expExitCode": "255", + "verifyCmd": "$TC actions ls action police", + "matchPattern": "action order [0-9]*: police 0x1 rate 3Mbit burst 250Kb mtu 2Kb action ", + "matchCount": "0", + "teardown": [ + "$TC actions flush action police" + ] + }, + { "id": "c26f", "name": "Add police action with invalid peakrate value", "category": [