netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: fw@strlen.de, kaber@trash.net, pablo@netfilter.org
Subject: [RFC nft PATCH 2/3] tests/operations: add maps tests cases
Date: Fri, 09 Oct 2015 14:38:17 +0200	[thread overview]
Message-ID: <20151009123817.32207.32567.stgit@r2d2.cica.es> (raw)
In-Reply-To: <20151009123529.32207.81925.stgit@r2d2.cica.es>

Let's add some tests cases for maps.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
---
 .../operations/testcases/maps/anonymous_snat_map_0 |    7 +++++++
 tests/operations/testcases/maps/named_snat_map_0   |    9 +++++++++
 2 files changed, 16 insertions(+)
 create mode 100755 tests/operations/testcases/maps/anonymous_snat_map_0
 create mode 100755 tests/operations/testcases/maps/named_snat_map_0

diff --git a/tests/operations/testcases/maps/anonymous_snat_map_0 b/tests/operations/testcases/maps/anonymous_snat_map_0
new file mode 100755
index 0000000..67698ec
--- /dev/null
+++ b/tests/operations/testcases/maps/anonymous_snat_map_0
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# anonymous map can be added to a snat rule
+
+$NFT add table nat
+$NFT add chain nat postrouting
+$NFT add rule nat postrouting snat ip saddr map {1.1.1.1 : 2.2.2.2}
diff --git a/tests/operations/testcases/maps/named_snat_map_0 b/tests/operations/testcases/maps/named_snat_map_0
new file mode 100755
index 0000000..6e11051
--- /dev/null
+++ b/tests/operations/testcases/maps/named_snat_map_0
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# nameds map can be addedd to a snat rule
+
+$NFT add table nat
+$NFT add chain nat postrouting
+$NFT add map nat m { type ipv4_addr : ipv4_addr\; }
+$NFT add element nat m {1.1.1.1: 2.2.2.2}
+$NFT add rule nat postrouting snat ip saddr map @m


  parent reply	other threads:[~2015-10-09 13:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-09 12:38 [RFC nft PATCH 0/3] new test suite Arturo Borrero Gonzalez
2015-10-09 12:38 ` [RFC nft PATCH 1/3] tests: add operations test-suite Arturo Borrero Gonzalez
2015-10-09 12:38 ` Arturo Borrero Gonzalez [this message]
2015-10-09 12:38 ` [RFC nft PATCH 3/3] tests/operations: add tests for handles and comments Arturo Borrero Gonzalez
2015-10-09 12:52 ` [RFC nft PATCH 0/3] new test suite 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=20151009123817.32207.32567.stgit@r2d2.cica.es \
    --to=arturo.borrero.glez@gmail.com \
    --cc=fw@strlen.de \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.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).