From 6d19a0bdb26f0eeb08dfdd9957c184e90db8766e Mon Sep 17 00:00:00 2001 From: Fabrizio D'Angelo Date: Mon, 12 Apr 2021 14:05:36 -0400 Subject: [PATCH 26/30] test(ipset): add test to verify hash:net,net Signed-off-by: Fabrizio D'Angelo (cherry picked from commit f3bd1297f656217031957eee7cfb4b3ee5ef42f2) (cherry picked from commit 690ad9abf26f8ec3486704553d891d7d2ce11a80) --- src/tests/regression/regression.at | 1 + src/tests/regression/rhbz1936896.at | 32 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/tests/regression/rhbz1936896.at diff --git a/src/tests/regression/regression.at b/src/tests/regression/regression.at index 8156ee608189..2a5ad9ef995a 100644 --- a/src/tests/regression/regression.at +++ b/src/tests/regression/regression.at @@ -40,3 +40,4 @@ m4_include([regression/rhbz1596304.at]) m4_include([regression/gh703.at]) m4_include([regression/ipset_netmask_allowed.at]) m4_include([regression/rhbz1940928.at]) +m4_include([regression/rhbz1936896.at]) diff --git a/src/tests/regression/rhbz1936896.at b/src/tests/regression/rhbz1936896.at new file mode 100644 index 000000000000..911db0bc448d --- /dev/null +++ b/src/tests/regression/rhbz1936896.at @@ -0,0 +1,32 @@ +FWD_START_TEST([ipset type hash:net,net]) +AT_KEYWORDS(rhbz1936896) +CHECK_IPSET + +FWD_CHECK([-q --permanent --new-ipset testset --type hash:net,net]) +FWD_CHECK([--permanent --ipset=testset --add-entry=192.168.0.0/24,10.0.1.0/24], 0, ignore) +FWD_RELOAD +FWD_CHECK([--permanent --info-ipset=testset | TRIM_WHITESPACE], 0, [m4_strip([dnl + testset + type: hash:net,net + options: + entries: 192.168.0.0/24,10.0.1.0/24 +])]) + +IPSET_LIST_SET([testset], 0, [dnl + Name: testset + Type: hash:net,net + Members: + 192.168.0.0/24,10.0.1.0/24 +]) + +NFT_LIST_SET([testset], 0, [dnl + table inet firewalld { + set testset { + type ipv4_addr . ipv4_addr + flags interval + elements = { 192.168.0.0/24 . 10.0.1.0/24 } + } + } +]) + +FWD_END_TEST -- 2.27.0