netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: fw@strlen.de, thaller@redhat.com
Subject: [PATCH nft 1/4] tests: shell: skip if kernel does not support flowtable counter
Date: Wed, 15 Nov 2023 10:42:28 +0100	[thread overview]
Message-ID: <20231115094231.168870-2-pablo@netfilter.org> (raw)
In-Reply-To: <20231115094231.168870-1-pablo@netfilter.org>

Check if kernel provides flowtable counter supports which is available
since 53c2b2899af7 ("netfilter: flowtable: add counter support").

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/shell/features/flowtable_counter.sh        | 16 ++++++++++++++++
 .../testcases/flowtable/0012flowtable_variable_0 |  2 ++
 2 files changed, 18 insertions(+)
 create mode 100755 tests/shell/features/flowtable_counter.sh

diff --git a/tests/shell/features/flowtable_counter.sh b/tests/shell/features/flowtable_counter.sh
new file mode 100755
index 000000000000..a4c4c62124b0
--- /dev/null
+++ b/tests/shell/features/flowtable_counter.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# 53c2b2899af7 ("netfilter: flowtable: add counter support")
+# v5.7-rc1~146^2~12^2~16
+
+EXPECTED="table ip filter2 {
+	flowtable main_ft2 {
+		hook ingress priority filter
+		devices = { lo }
+		counter
+	}
+}"
+
+$NFT -f - <<< $EXPECTED
+
+diff -u <($NFT list ruleset) - <<<"$EXPECTED"
diff --git a/tests/shell/testcases/flowtable/0012flowtable_variable_0 b/tests/shell/testcases/flowtable/0012flowtable_variable_0
index 080059d24935..9c03820f128e 100755
--- a/tests/shell/testcases/flowtable/0012flowtable_variable_0
+++ b/tests/shell/testcases/flowtable/0012flowtable_variable_0
@@ -1,5 +1,7 @@
 #!/bin/bash
 
+# NFT_TEST_REQUIRES(NFT_TEST_HAVE_flowtable_counter)
+
 set -e
 
 iface_cleanup() {
-- 
2.30.2


  reply	other threads:[~2023-11-15  9:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15  9:42 [PATCH nft 0/4] more tests/shell updates to run on 5.4 kernels Pablo Neira Ayuso
2023-11-15  9:42 ` Pablo Neira Ayuso [this message]
2023-11-15  9:42 ` [PATCH nft 2/4] tests: shell: skip if kernel does not support flowtable with no devices Pablo Neira Ayuso
2023-11-15  9:42 ` [PATCH nft 3/4] tests: shell: skip pipapo set backend in transactions/30s-stress Pablo Neira Ayuso
2023-11-15 10:25   ` Thomas Haller
2023-11-15 10:34     ` Pablo Neira Ayuso
2023-11-15  9:42 ` [PATCH nft 4/4] tests: shell: restore pipapo and chain binding coverage in standalone 30s-stress Pablo Neira Ayuso

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=20231115094231.168870-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=thaller@redhat.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;
as well as URLs for NNTP newsgroup(s).