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
Subject: [PATCH nft 3/3 nft] tests/py: add interval tests
Date: Wed, 27 Apr 2016 15:07:15 +0200	[thread overview]
Message-ID: <1461762435-12411-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1461762435-12411-1-git-send-email-pablo@netfilter.org>

Add some initial tests to cover dynamic interval sets.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 tests/py/ip/sets.t  | 12 ++++++++++++
 tests/py/ip6/sets.t | 11 +++++++++++
 2 files changed, 23 insertions(+)

diff --git a/tests/py/ip/sets.t b/tests/py/ip/sets.t
index 2b4e7e1..0e2b193 100644
--- a/tests/py/ip/sets.t
+++ b/tests/py/ip/sets.t
@@ -31,3 +31,15 @@
 ip saddr @set1 drop;ok
 ip saddr @set2 drop;ok
 ip saddr @set33 drop;fail
+
+!set3 type ipv4_addr flags interval;ok
+?set3 192.168.0.0/16;ok
+?set3 172.16.0.0/12;ok
+?set3 10.0.0.0/8;ok
+
+!set4 type ipv4_addr flags interval;ok
+?set4 192.168.1.0/24;ok
+?set4 192.168.0.0/24;ok
+?set4 192.168.2.0/24;ok
+?set4 192.168.1.1;fail
+?set4 192.168.3.0/24;ok
diff --git a/tests/py/ip6/sets.t b/tests/py/ip6/sets.t
index 765b971..ff38925 100644
--- a/tests/py/ip6/sets.t
+++ b/tests/py/ip6/sets.t
@@ -23,3 +23,14 @@
 
 ip6 saddr @set2 drop;ok
 ip6 saddr @set33 drop;fail
+
+!set3 type ipv6_addr flags interval;ok
+?set3 1234:1234:1234:1234::/64;ok
+?set3 1324:1234:1234:1235::/64;ok
+?set3 1324:1234:1234:1233::/64;ok
+?set3 1234:1234:1234:1234:1234:1234:/96;fail
+?set3 1324:1234:1234:1236::/64;ok
+
+!set4 type ipv6_addr flags interval;ok
+?set4 1234:1234:1234:1234::/64 4321:1234:1234:1234::/64;ok
+?set4 4321:1234:1234:1234:1234:1234::/96;fail
-- 
2.1.4


      parent reply	other threads:[~2016-04-27 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 13:07 [PATCH nft 1/3 nft] tests/py: add more interval tests for anonymous sets Pablo Neira Ayuso
2016-04-27 13:07 ` [PATCH nft 2/3 nft] tests/py: explicitly indication of set type and flags from test definitions Pablo Neira Ayuso
2016-04-27 13:07 ` Pablo Neira Ayuso [this message]

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=1461762435-12411-3-git-send-email-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 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).