All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: netdev@vger.kernel.org
Cc: Petr Machata <petrm@mellanox.com>,
	Jakub Kicinski <kuba@kernel.org>, Roman Mashak <mrv@mojatatu.com>,
	jhs@mojatatu.com, xiyou.wangcong@gmail.com, davem@davemloft.net,
	jiri@mellanox.com, mlxsw@mellanox.com
Subject: [PATCH net-next v2 5/6] selftests: qdiscs: RED: Add taildrop tests
Date: Wed, 11 Mar 2020 19:33:55 +0200	[thread overview]
Message-ID: <20200311173356.38181-6-petrm@mellanox.com> (raw)
In-Reply-To: <20200311173356.38181-1-petrm@mellanox.com>

Add tests for the new "taildrop" flag.

Signed-off-by: Petr Machata <petrm@mellanox.com>
---

Notes:
    v2:
    - Require nsPlugin in each RED test
    - Match end-of-line to catch cases of more flags reported than
      requested
    - Add a test for creation of non-ECN taildrop, which should fail

 .../tc-testing/tc-tests/qdiscs/red.json       | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/red.json b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/red.json
index b70a54464897..72676073c658 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/qdiscs/red.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/qdiscs/red.json
@@ -113,5 +113,73 @@
             "$TC qdisc del dev $DUMMY handle 1: root",
             "$IP link del dev $DUMMY type dummy"
         ]
+    },
+    {
+        "id": "53e8",
+        "name": "Create RED with flags ECN, taildrop",
+        "category": [
+            "qdisc",
+            "red"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true"
+        ],
+        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root red ecn taildrop limit 1M avpkt 1500 min 100K max 300K",
+        "expExitCode": "0",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc red 1: root .* limit 1Mb min 100Kb max 300Kb ecn taildrop $",
+        "matchCount": "1",
+        "teardown": [
+            "$TC qdisc del dev $DUMMY handle 1: root",
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    },
+    {
+        "id": "d091",
+        "name": "Fail to create RED with only taildrop flag",
+        "category": [
+            "qdisc",
+            "red"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true"
+        ],
+        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root red taildrop limit 1M avpkt 1500 min 100K max 300K",
+        "expExitCode": "2",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc red",
+        "matchCount": "0",
+        "teardown": [
+            "$IP link del dev $DUMMY type dummy"
+        ]
+    },
+    {
+        "id": "af8e",
+        "name": "Create RED with flags ECN, taildrop, harddrop",
+        "category": [
+            "qdisc",
+            "red"
+        ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
+        "setup": [
+            "$IP link add dev $DUMMY type dummy || /bin/true"
+        ],
+        "cmdUnderTest": "$TC qdisc add dev $DUMMY handle 1: root red ecn harddrop taildrop limit 1M avpkt 1500 min 100K max 300K",
+        "expExitCode": "0",
+        "verifyCmd": "$TC qdisc show dev $DUMMY",
+        "matchPattern": "qdisc red 1: root .* limit 1Mb min 100Kb max 300Kb ecn harddrop taildrop $",
+        "matchCount": "1",
+        "teardown": [
+            "$TC qdisc del dev $DUMMY handle 1: root",
+            "$IP link del dev $DUMMY type dummy"
+        ]
     }
 ]
-- 
2.20.1


  parent reply	other threads:[~2020-03-11 17:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 17:33 [PATCH net-next v2 0/6] RED: Introduce an ECN tail-dropping mode Petr Machata
2020-03-11 17:33 ` [PATCH net-next v2 1/6] selftests: qdiscs: Add TDC test for RED Petr Machata
2020-03-12  2:20   ` Roman Mashak
2020-03-11 17:33 ` [PATCH net-next v2 2/6] net: sched: Allow extending set of supported RED flags Petr Machata
2020-03-11 22:09   ` Jakub Kicinski
2020-03-12  0:12     ` Petr Machata
2020-03-11 17:33 ` [PATCH net-next v2 3/6] net: sched: RED: Introduce an ECN tail-dropping mode Petr Machata
2020-03-11 18:36   ` Eric Dumazet
2020-03-12  0:42     ` Petr Machata
2020-03-12  1:01       ` Eric Dumazet
2020-03-12  2:25         ` Jakub Kicinski
2020-03-12 10:16           ` Petr Machata
2020-03-12 10:17   ` Petr Machata
2020-03-11 17:33 ` [PATCH net-next v2 4/6] mlxsw: spectrum_qdisc: Offload RED " Petr Machata
2020-03-11 17:33 ` Petr Machata [this message]
2020-03-12  2:21   ` [PATCH net-next v2 5/6] selftests: qdiscs: RED: Add taildrop tests Roman Mashak
2020-03-11 17:33 ` [PATCH net-next v2 6/6] selftests: mlxsw: RED: Test RED ECN taildrop offload Petr Machata
2020-03-15  4:04 ` [PATCH net-next v2 0/6] RED: Introduce an ECN tail-dropping mode David Miller
2020-03-16 10:54   ` Petr Machata
2020-03-16 21:55     ` David Miller
2020-03-17 12:43       ` Petr Machata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200311173356.38181-6-petrm@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.