public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@nvidia.com>
To: <memxor@gmail.com>
Cc: <xiyou.wangcong@gmail.com>, <davem@davemloft.net>,
	<jhs@mojatatu.com>, <jiri@resnulli.us>, <kuba@kernel.org>,
	<toke@redhat.com>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, Vlad Buslov <vladbu@nvidia.com>
Subject: [PATCH net-next] tc-testing: add simple action change test
Date: Tue, 30 Mar 2021 13:41:10 +0300	[thread overview]
Message-ID: <20210330104110.25360-1-vladbu@nvidia.com> (raw)
In-Reply-To: <20210329225322.143135-1-memxor@gmail.com>

Use act_simple to verify that action created with 'tc actions change'
command exists after command returns. The goal is to verify internal action
API reference counting to ensure that the case when netlink message has
NLM_F_REPLACE flag set but action with specified index doesn't exist is
handled correctly.

Signed-off-by: Vlad Buslov <vladbu@nvidia.com>
---
 .../tc-testing/tc-tests/actions/simple.json   | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json b/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json
index 8e8c1ae12260..e15f708b0fa4 100644
--- a/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json
+++ b/tools/testing/selftests/tc-testing/tc-tests/actions/simple.json
@@ -23,6 +23,30 @@
             "$TC actions flush action simple"
         ]
     },
+    {
+        "id": "4297",
+        "name": "Add simple action with change command",
+        "category": [
+            "actions",
+            "simple"
+        ],
+        "setup": [
+            [
+                "$TC actions flush action simple",
+                0,
+                1,
+                255
+            ]
+        ],
+        "cmdUnderTest": "$TC actions change action simple sdata \"Not changed\" index 60",
+        "expExitCode": "0",
+        "verifyCmd": "$TC actions list action simple",
+        "matchPattern": "action order [0-9]*: Simple <Not changed>.*index 60 ref",
+        "matchCount": "1",
+        "teardown": [
+            "$TC actions flush action simple"
+        ]
+    },
     {
         "id": "6d4c",
         "name": "Add simple action with duplicate index",
-- 
2.29.2


  parent reply	other threads:[~2021-03-30 10:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 22:53 [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode Kumar Kartikeya Dwivedi
2021-03-30 10:32 ` Vlad Buslov
2021-03-30 10:41 ` Vlad Buslov [this message]
2021-03-31  0:20   ` [PATCH net-next] tc-testing: add simple action change test patchwork-bot+netdevbpf
2021-03-31  4:40 ` [PATCH v2 1/1] net: sched: bump refcount for new action in ACT replace mode Cong Wang
2021-03-31  7:59   ` Vlad Buslov
2021-03-31  8:37   ` [PATCH net-next v3] " Kumar Kartikeya Dwivedi
2021-03-31 14:08     ` Vlad Buslov
2021-03-31  8:38   ` [PATCH v2 1/1] " Kumar Kartikeya Dwivedi

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=20210330104110.25360-1-vladbu@nvidia.com \
    --to=vladbu@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=memxor@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=toke@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox