All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH nft 2/2] tests: shell: expand get command test with open intervals
Date: Thu,  2 Jul 2026 14:36:34 +0200	[thread overview]
Message-ID: <20260702123634.349861-2-pablo@netfilter.org> (raw)
In-Reply-To: <20260702123634.349861-1-pablo@netfilter.org>

Extend the existing test to cover get commands with open internals.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/shell/testcases/sets/0034get_element_0         | 12 +++++++++++-
 .../testcases/sets/dumps/0034get_element_0.json-nft  |  6 ++++++
 .../shell/testcases/sets/dumps/0034get_element_0.nft |  2 +-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/tests/shell/testcases/sets/0034get_element_0 b/tests/shell/testcases/sets/0034get_element_0
index 32375b9f50c2..a25769604685 100755
--- a/tests/shell/testcases/sets/0034get_element_0
+++ b/tests/shell/testcases/sets/0034get_element_0
@@ -16,7 +16,7 @@ check() { # (set, elems, expected)
 
 RULESET="add table ip t
 add set ip t s { type inet_service; flags interval; }
-add element ip t s { 10, 20-30, 40, 50-60 }
+add element ip t s { 10, 20-30, 40, 50-60, 60000-65535 }
 add set ip t ips { type ipv4_addr; flags interval; }
 add element ip t ips { 10.0.0.1, 10.0.0.5-10.0.0.8 }
 add element ip t ips { 10.0.0.128/25, 10.0.1.0/24, 10.0.2.3-10.0.2.12 }
@@ -36,6 +36,16 @@ check s 15-18 ""
 # multiple single elements, ranges smaller than present
 check s "10, 40" "10, 40"
 check s "22-24, 26-28" "20-30, 20-30"
+check s "60000-65535" "60000-65535"
+check s "60000-65534" "60000-65535"
+check s "60001-65535" "60000-65535"
+check s "60001-65534" "60000-65535"
+check s "22-24, 60000-65535" "20-30, 60000-65535"
+check s "22-24, 60000-65534" "20-30, 60000-65535"
+check s "22-24, 60001-65535" "20-30, 60000-65535"
+check s "22-24, 60001-65534" "20-30, 60000-65535"
+check s "60001-65534, 10" "60000-65535, 10"
+check s "20, 60001-65535, 10" "20-30, 60000-65535, 10"
 check s 21-29 20-30
 
 # mixed single elements and ranges
diff --git a/tests/shell/testcases/sets/dumps/0034get_element_0.json-nft b/tests/shell/testcases/sets/dumps/0034get_element_0.json-nft
index bfc0e4a0f588..64c7dc0c6555 100644
--- a/tests/shell/testcases/sets/dumps/0034get_element_0.json-nft
+++ b/tests/shell/testcases/sets/dumps/0034get_element_0.json-nft
@@ -38,6 +38,12 @@
               50,
               60
             ]
+          },
+          {
+            "range": [
+              60000,
+              65535
+            ]
           }
         ]
       }
diff --git a/tests/shell/testcases/sets/dumps/0034get_element_0.nft b/tests/shell/testcases/sets/dumps/0034get_element_0.nft
index 1c1dd9779a8a..889640389cd9 100644
--- a/tests/shell/testcases/sets/dumps/0034get_element_0.nft
+++ b/tests/shell/testcases/sets/dumps/0034get_element_0.nft
@@ -2,7 +2,7 @@ table ip t {
 	set s {
 		type inet_service
 		flags interval
-		elements = { 10, 20-30, 40, 50-60 }
+		elements = { 10, 20-30, 40, 50-60, 60000-65535 }
 	}
 
 	set ips {
-- 
2.47.3


  reply	other threads:[~2026-07-02 12:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02 12:36 [PATCH nft 1/2] segtree: fix get element command with open intervals Pablo Neira Ayuso
2026-07-02 12:36 ` Pablo Neira Ayuso [this message]
2026-07-07 13:26   ` [PATCH nft 2/2] tests: shell: expand get command test " Phil Sutter
2026-07-07 14:16     ` Pablo Neira Ayuso
2026-07-07 14:49       ` Phil Sutter
2026-07-07 14:52         ` 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=20260702123634.349861-2-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /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.