From: Alexander Aring <aring@mojatatu.com>
To: Lucas Bates <lucasb@mojatatu.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,
kernel@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
mleitner@redhat.com, vladbu@mellanox.com, dcaratti@redhat.com
Subject: Re: [RFC PATCH net-next 1/1] tc-testing: Scapy plugin and JSON verification for tdc
Date: Mon, 24 Jun 2019 17:47:32 -0400 [thread overview]
Message-ID: <20190624214732.irc5n56oyk7wfrwe@x220t> (raw)
In-Reply-To: <1560133232-17880-1-git-send-email-lucasb@mojatatu.com>
Hi Lucas,
On Sun, Jun 09, 2019 at 10:20:32PM -0400, Lucas Bates wrote:
> This is a draft version of two new tdc features.
>
> First, the scapy plugin. This requires the scapy Python module
> installed on the system (plugin was tested against v2.4.2).
> The intent is to install a given rule (as the command under test)
> and then generate packets to create statistics for that rule.
> The stats are checked in the verify phase.
>
> A new "scapy" entry appears in the test cases, which currently
> have three requirements: the source interface for the packets,
> the number of packets to be sent, and a string that is processed
> by scapy's eval() function to construct the packets.
eval() is not a function of scapy, it is a python thing.
You need to be careful with that, people can introduce weird code. Since
everything is here under review I think it is okay... so far we don't
introduce a tdc restful API for that.
>
> Limitations: For now, only one type of packet can be crafted
> per test case. Also, knowledge of scapy's syntax is required.
>
Why not add a list of eval() strings and send them out in order?
> Secondly, we add JSON processing as a method of performing the
> verification stage. Each test case can now have a "matchPattern"
> or "matchJSON" field which governs the method tdc will use to
> process the results. The intent is to make it easier to handle
> the verify stage by not requiring complex regular expressions
>
> matchJSON has two fields, path and value. Path is a list of
> strings and integers which indicate the path through the nested
> JSON data - an asterisk is also acceptable in place of
> a number if the specific index of a list is unknown.
>
Can you provide an example?
> This structure may not be the best method of handling JSON
> verification - suggestions have been made that include using a
> third party module to process the JSON, but that creates an
> external dependency for tdc.
>
> To try the sample tests in this patch:
>
> 1) Ensure nsPlugin and scapyPlugin are linked in the plugins/
> subdirectory
> 2) Run:
> sudo ./tdc.py -f tc-tests/actions/scapy-example.json -n
>
> The second test is designed to fail.
>
> Comments and discussion are encouraged!
Can you please split these patches according to your commit message.
1. JSON processing (new core feature?)
2. scapy plugin (should not touch core code)
3. scapy example
- Alex
prev parent reply other threads:[~2019-06-24 21:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-10 2:20 [RFC PATCH net-next 1/1] tc-testing: Scapy plugin and JSON verification for tdc Lucas Bates
2019-06-24 21:47 ` Alexander Aring [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=20190624214732.irc5n56oyk7wfrwe@x220t \
--to=aring@mojatatu.com \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=lucasb@mojatatu.com \
--cc=mleitner@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=vladbu@mellanox.com \
--cc=xiyou.wangcong@gmail.com \
/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