From: Pablo Neira Ayuso Date: Thu, 2 Jul 2026 12:08:38 +0000 (+0200) Subject: tests: shell: expand get command test with open intervals X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c68fe8a2e002f17d6166048fb21494bc86fc270;p=thirdparty%2Fnftables.git tests: shell: expand get command test with open intervals Extend the existing test to cover get commands with open internals. Signed-off-by: Pablo Neira Ayuso --- diff --git a/tests/shell/testcases/sets/0034get_element_0 b/tests/shell/testcases/sets/0034get_element_0 index 32375b9f..a2576960 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 bfc0e4a0..64c7dc0c 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 1c1dd977..88964038 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 {