All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: iptables automated tests
Date: Tue, 8 Oct 2013 11:41:20 +0200	[thread overview]
Message-ID: <20131008094120.GA7068@localhost> (raw)

Hi,

The following branch contains a new automated test infrastructure for
iptables:

http://git.netfilter.org/iptables/log/?h=tests-iptables

It's basically a python script that takes an input file '.t' that look
like:

:INPUT,OUTPUT,FORWARD
-p udp -m udp --sport 1;=;OK
-p udp -m udp --sport 65535;=;OK
-p udp -m udp --dport 1;=;OK
-p udp -m udp --dport 65535;=;OK
-p udp -m udp --sport 1:1023;=;OK
-p udp -m udp --sport 1024:65535;=;OK
[...]
-p udp -m udp --sport -1;;FAIL

Some explanation of the file format:

Lines starting by ':' mean the chains where you want to test the
rules, then lines with '#' are comments.

We also have '*' to indicate the table and '@' to execute some
external command.

Remaining lines look like:

-p udp -m udp --dport 1;=;OK
\_____________________/ _ __
          1             2  3

Part 1 is the rule that you want to load, then part 2 using '=' means
that the output via iptables-save look exactly the same like the
original command (in some case, the input command does not match the
output command that is fetch from the kernel, thus, this line to
include exceptions). Part 3 indicates if the test should run
successfully or fail.

The infrastructure allows us to test that iptables configurations are
consistent between userspace and the kernel. During the workshop we
discussed ideas for another infrastructure to test the packet
processing path, which are complementary to this infrastructure.

Regards.

                 reply	other threads:[~2013-10-08  9:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20131008094120.GA7068@localhost \
    --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.