: Lucas Bates
---
tools/testing/selftests/tc-testing/README | 4 +++-
tools/testing/selftests/tc-testing/tdc.py | 12
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/tools/testing/selftests/tc-testing/README
b/tools/testing/selftests/tc-testing/README
index 22e5da9
capy functionality,
since the plugin blindly sends the packet as defined in the test case
data.
See creating-testcases/scapy-example.json for sample test cases;
the first test is intended to pass while the second is intended to
fail.
Signed-off-by: Lucas Bates
---
.../creating-testcases/scapy-example.js
Instead of only passing the test case name and ID, pass the
entire current test case down to the plugins. This change
allows plugins to start accepting commands and directives
from the test cases themselves, for greater flexibility
in testing.
Signed-off-by: Lucas Bates
---
tools/testing
block works in the test cases.
Lucas Bates (2):
tc-testing: Allow tdc plugins to see test case data
tc-testing: introduce scapyPlugin for basic traffic
tools/testing/selftests/tc-testing/TdcPlugin.py| 5 +-
.../creating-testcases/scapy-example.json | 98
Sorry Alex, I completely forgot about this email.
On Thu, Jul 4, 2019 at 4:29 PM Alexander Aring wrote:
>
> Hi,
>
> On Wed, Jul 03, 2019 at 08:45:02PM -0400, Lucas Bates wrote:
> > The scapyPlugin allows for simple traffic generation in tdc to
> > test various tc feat
On Mon, Jul 8, 2019 at 1:25 PM Alexander Aring wrote:
> > Unless I'm off-base here?
>
> yes you need to know some python, complex code can be hidden by some
> helper functionality I guess.
>
> I have no problem to let this patch in, it will not harm anything...
I think I'm going to pull it for the
On Thu, Jul 4, 2019 at 4:21 PM Alexander Aring wrote:
> why you just use eval() as pattern matching operation and let the user
> define how to declare a matching mechanism instead you introduce another
> static matching scheme based on a json description?
>
> Whereas in eval() you could directly
",
0,
"control action",
"type"
],
"value": "gact"
},
{
"path": [
0,
"actions",
0,
"index"
],
test case file to
demonstrate how the scapy block works.
Lucas Bates (3):
tc-testing: Add JSON verification to tdc
tc-testing: Allow tdc plugins to see test case data
tc-testing: introduce scapyPlugin for basic traffic
tools/testing/selftests/tc-testing/TdcPlugin.py| 5
Instead of only passing the test case name and ID, pass the
entire current test case down to the plugins. This change
allows plugins to start accepting commands and directives
from the test cases themselves, for greater flexibility
in testing.
Signed-off-by: Lucas Bates
---
tools/testing
capy functionality,
since the plugin blindly sends the packet as defined in the test case
data.
See creating-testcases/scapy-example.json for sample test cases;
the first test is intended to pass while the second is intended to
fail. Consider using the matchJSON functionality
tdc
plugins to examine the test case currently being executed, such that plugins
can play a more active role in testing. This feature is needed for the
new plugin.
The third patch adds the scapyPlugin itself, and an example test case file to
demonstrate how the scapy block works.
Lucas Bates (3
The scapyPlugin allows for simple traffic generation in tdc to
test various tc features. It was tested with scapy v2.4.2, but
should work with any successive version.
In order to use the plugin's functionality, scapy must be
installed. This can be done with:
pip3 install scapy
or to install 2.
Instead of only passing the test case name and ID, pass the
entire current test case down to the plugins. This change
allows plugins to start accepting commands and directives
from the test cases themselves, for greater flexibility
in testing.
---
tools/testing/selftests/tc-testing/TdcPlugin.py |
This patch allows tdc to process JSON output to perform secondary
verification of the command under test. If the verifyCmd generates
JSON, one can provide the 'matchJSON' key to process it
instead of a regex.
matchJSON has two elements: 'path' and 'value'. The 'path' key is a
list of integers and
than one required plugin: a list
can be inserted as the value for 'requires'.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/README | 22 ++-
.../tc-testing/plugin-lib/buildebpfPlugin.py | 5 +-
.../selftests/tc-testing/plugin-lib/nsPlugin.py|
On Tue, Jun 18, 2019 at 4:52 AM Nicolas Dichtel
wrote:
> >> From my point of view, if all tests are not successful by default, it
> >> scares
> >> users and prevent them to use those tests suite to validate their patches.
> >
> > For me, explicitly telling the user that a test was skipped, and /w
On Fri, Jun 14, 2019 at 5:37 AM Nicolas Dichtel
wrote:
>
> Le 05/06/2019 à 23:08, Lucas Bates a écrit :
> > Apologies for the delay in getting this out. I've been busy
> > with other things and this change was a little trickier than
> > I expected.
> >
&
ndency 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!
Signed-off-by: L
On Fri, Jun 7, 2019 at 8:18 AM Davide Caratti wrote:
> From what I see, it is a fix for the reported problem (e.g. tests failing
> because of 'nsPlugin' uninstalled). And, I want to followup fixing the
> bpf.json in tc-actions, so that
>
> # ./tdc.py -l -c bpf | grep eBPF
> e939: (actions, bpf)
Apologies for the delay in getting this out. I've been busy
with other things and this change was a little trickier than
I expected.
This patch restores the original behaviour for tdc prior to the
introduction of the plugin system, where the network namespace
functionality was split from the main
On Fri, Apr 12, 2019 at 7:37 PM Nicolas Dichtel
wrote:
>
> Le 12/04/2019 à 18:07, Lucas Bates a écrit :
> [snip]
> > So something like this? Note the usage of the keyword "requires",
> >
> > {
> > "id": "901f",
On Fri, Apr 12, 2019 at 11:42 AM Nicolas Dichtel
wrote:
>
> Le 12/04/2019 à 17:21, Lucas Bates a écrit :
> > On Fri, Apr 12, 2019 at 4:31 AM Nicolas Dichtel
> > wrote:
> >>> in our tri-weekly tc test meeting and the general consensus to address
> >>>
On Fri, Apr 12, 2019 at 4:31 AM Nicolas Dichtel
wrote:
> > in our tri-weekly tc test meeting and the general consensus to address
> > what you brought up is leaning towards the following:
> >
> > - adding a symlink to nsPlugin
> I don't understand why a symlink is needed. Just load it by default a
On Wed, Apr 10, 2019 at 10:33 AM Nicolas Dichtel
wrote:
>
> Le 09/04/2019 à 23:44, Lucas Bates a écrit :
> > Some of the testcases (for example, all of the fw tests) in tdc
> > require activating the nsplugin. This RFC introduces a feature which
> > tags one such test wi
use plugin-
specific options may exist and need to be parsed at startup)
Please provide feedback. If this is amenable to all, I will proceed
to submit for the rest.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/README | 28 ++-
.../selftests/tc-testing/tc-tes
On Sun, Apr 7, 2019 at 10:32 PM David Miller wrote:
> > I'm not sure to understand the goal of this series:
> > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?h=45b3a3762721
> >
> > But after it, tc selftests are not intuitive anymore. When naively running
> > them
> > (.
On Fri, Mar 1, 2019 at 7:33 AM Dmytro Linkin wrote:
>
> Add 36 pedit action tests to check pedit options described in tc-pedit(8)
> man page. Test cases can be specified by categories: actions, pedit,
> raw_op, layered_op. RAW_OP cases check offset option for u8, u16 and u32
> offset size. LAYERED
tests in each
run. However, the test will be marked as skipped.
This support for skipping extends to any plugins that may generate
additional results for each executed test.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/TdcPlugin.py | 4 ++--
.../tc-testing
On Sat, Jan 12, 2019 at 7:23 AM Jamal Hadi Salim wrote:
>
> On 2019-01-11 9:55 p.m., Cong Wang wrote:
> > Martin reported a set of filters don't work after changing
> > from reclassify to continue. Looking into the code, it
> > looks like skb protocol is not always fetched for each
> > iteration o
Using an attribute set in the tdc_config.py file, limit the
amount of time tdc will wait for an executed command to
complete and prevent the script from hanging entirely.
This timeout will be applied to all executed commands.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing
In tdc and the valgrind plugin, begin using the TdcResults module
to track executed test cases.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/TdcPlugin.py| 3 +-
.../tc-testing/plugin-lib/valgrindPlugin.py| 22 +++-
tools/testing/selftests/tc-testing/tdc.py
This module includes new classes for tdc to use in keeping track
of test case results, instead of generating and tracking a lengthy
string.
The new module can be extended to support multiple formal
test result formats to be friendlier to automation.
Signed-off-by: Lucas Bates
---
tools/testing
Patch 1 adds a timeout feature for any command tdc launches in a subshell.
This prevents tdc from hanging indefinitely.
Patches 2-4 introduce a new method for tracking and generating test case
results, and implements it across the core script and all applicable
plugins.
Lucas Bates (4):
tc
Ignore any .tap or .xml test result files generated by tdc.
Additionally, ignore plugin symlinks.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/.gitignore | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/testing/selftests/tc-testing/.gitignore
b/tools/testing
Prevent exceptions from being raised while decoding output
from an executed command. There is no impact on tdc's
execution and the verify command phase would fail the pattern
match.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/tdc.py | 4 ++--
1 file changed, 2 inser
executed
command
Lucas Bates (1):
tc-testing: tdc.py: ignore errors when decoding stdout/stderr
tools/testing/selftests/tc-testing/tdc.py | 18 +-
1 file changed, 13 insertions(+), 5 deletions(-)
--
2.7.4
From: "Brenda J. Butler"
Add some defensive coding in case one of the subprocesses created by tdc
returns nothing. If no object is returned from exec_cmd, then tdc will
halt with an unhandled exception.
Signed-off-by: Brenda J. Butler
Signed-off-by: Lucas Bates
---
tools/testing/se
Hi Cong,
>
> 1. Create veth pair devices by its own. The most important thing for
> tc-tests is to automate everything, it is not friendly for users to
> create their own veth pair named v0p0 to just run the tests. tc-tests
> should be able to create a veth pair with random names and clean up
> th
t;
> Signed-off-by: Pieter Jansen van Vuuren
Acked-by: Lucas Bates
On Tue, Jun 26, 2018 at 10:51 AM, Davide Caratti wrote:
> On Tue, 2018-06-26 at 09:17 -0400, Keara Leibovitz wrote:
>> Create unittests for the tc tunnel_key action.
>>
>>
>> Signed-off-by: Keara Leibovitz
>> ---
>> .../tc-testing/tc-tests/actions/tunnel_key.json| 676
>> +++
On Tue, May 15, 2018 at 6:03 PM, Lucas Bates wrote:
> On Tue, May 15, 2018 at 5:49 PM, Jamal Hadi Salim wrote:
>>> Test 7d50: Add skbmod action to set destination mac
>>> exit: 255 0
>>> dst MAC address <11:22:33:44:55:66>
>>> RTNETLINK answers: N
On Tue, May 15, 2018 at 5:49 PM, Jamal Hadi Salim wrote:
>> Test 7d50: Add skbmod action to set destination mac
>> exit: 255 0
>> dst MAC address <11:22:33:44:55:66>
>> RTNETLINK answers: No such file or directory
>> We have an error talking to the kernel
>>
>
> You may actually have broken someth
;verifyCmd": "$TC action get action bpf index 667",
> -"matchPattern": "action order [0-9]*: bpf _b.o:\\[action\\] id
> [0-9].*index 667 ref",
> +"matchPattern": "action order [0-9]*: bpf _c.o:\\[action\\] id
> [0-9].*index 667 ref",
> "matchCount": "0",
> "teardown": [
> -"$TC action flush action bpf",
> +[
> +"$TC action flush action bpf",
> +0,
> +1,
> +255
> +],
> "rm -f _c.o"
> ]
> },
> --
> 2.14.3
>
Acked-by: Lucas Bates
f 44 00 00 41 54 55 48 89 fd 53 <48> 8b 47 20 f0
> ff 08 74 05 5b 5d 41 5c c3 41 89 f4 0f 1f 44 00
> RIP: __bpf_prog_put+0xc/0xc0 RSP: 9594003ef728
> CR2: 0020
>
> Fix it in tcf_bpf_cfg_cleanup(), ensuring that bpf_prog_{put,destroy}(f)
> is called only whe
Hi Davide,
Our overnight tc test runs of net-next revealed a kernel bug on one of
the BPF tests you submitted, d959. The add action completes
successfully, but the bug occurs on the verify when tdc does a get of
the action that was just added. Here's the text of the dump:
[ 61.973632] BUG: un
When using the -i feature to generate random ID numbers for test
cases in tdc, the function that writes the JSON to file doesn't
add a newline character to the end of the file, so we have to
add our own.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/tdc.py | 1 +
1
namespace execution.
Enclosing these compound statements inside a bash invocation
with proper escape characters resolves the problem by creating
a subshell inside the namespace.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/tc-tests/actions/gact.json | 10 +-
1 file
On Thu, Mar 22, 2018 at 2:48 PM, David Miller wrote:
> From: Lucas Bates
> Date: Wed, 21 Mar 2018 11:49:40 -0400
>
>> }
>> -]
>> \ No newline at end of file
>> +]
>> --
>> 2.7.4
>
> Please fix this.
This patch fixes the gact.json file that had no newline on the end.
namespace execution.
Enclosing these compound statements inside a bash invocation
with proper escape characters resolves the problem by creating
a subshell inside the namespace.
Signed-off-by: Lucas Bates
---
tools/testing/selftests/tc-testing/tc-tests/actions/gact.json | 10 +-
1 file
On Wed, Feb 14, 2018 at 2:09 PM, Brenda J. Butler wrote:
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> tools/testing/selftests/tc-testing/README | 173
> +---
> tools/testing/selftests/tc-testing/TODO.txt | 25 +++-
> 2
On Wed, Feb 14, 2018 at 2:09 PM, Brenda J. Butler wrote:
> Run the command under test under valgrind. Produce an extra set of
> tap output for the memory check on each test.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> .../tc-testing/plugin-lib
On Wed, Feb 14, 2018 at 2:09 PM, Brenda J. Butler wrote:
> Move the functionality of creating a namespace before the test suite
> and destroying it afterwards to a plugin.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> .../selftests/tc-testing/plug
just_command" hook. This makes the test suite quite
> flexible.
>
> Future patches will take some functionality out of the tdc.py script and
> place it in plugins.
>
> To use the plugins, place the implementation in the plugins directory
> and run tdc.py. It will notice t
On Wed, Feb 14, 2018 at 2:09 PM, Brenda J. Butler wrote:
> Move the functionality that checks for root permissions into a plugin.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> .../selftests/tc-testing/plugin-lib/rootPlugin.py | 19
> ++
nch
> of tap results for the skipped tests).
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> tools/testing/selftests/tc-testing/tdc.py | 81
> ---
> 1 file changed, 52 insertions(+), 29 deletions(-)
>
> diff --git a/tools/t
echanism. We can accumulate a number of tests by directory,
> file, category, or even by test id, instead of being constrained to
> run all tests in one collection or just one test.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
> ---
> .../cr
On Tue, Oct 31, 2017 at 7:02 PM, Cong Wang wrote:
> On Tue, Oct 31, 2017 at 3:09 PM, Cong Wang wrote:
>>
>> This almost rules out the guilty of this patchset.
>>
>> I will provide a patch for you to test, since I can't reproduce it here.
>>
>
> Lucas, please test the attached patch, it applies to
On Tue, Oct 31, 2017 at 2:55 PM, Lucas Bates wrote:
> On Tue, Oct 31, 2017 at 7:00 AM, Jamal Hadi Salim wrote:
>> On 17-10-31 01:44 AM, Cong Wang wrote:
>>>
>>> Can you try this patch? From your stack trace it is not clear where
>>> the cause
On Tue, Oct 31, 2017 at 7:00 AM, Jamal Hadi Salim wrote:
> On 17-10-31 01:44 AM, Cong Wang wrote:
>>
>> Can you try this patch? From your stack trace it is not clear where
>> the cause is, but we know that the crash is in __tcf_idr_release(),
>> this is how I came up with the following patch:
>>
>
that file will be ignored and the rest of the tests
> will be processed.
>
> Signed-off-by: Brenda J. Butler
With great pleasure:
Acked-by: Lucas Bates
s still possible to output a single test, by using the -e
> option, but now more than one test can be displayed with
> one command.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
an actual list. In that
> case, this code will not have to change.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
def get_unique_item(lst):
> -""" For a list, return a set of the unique items in the list. """
> +""" For a list, return a list of the unique items in the list. """
> return list(set(lst))
>
>
> --
> 2.15.0.rc0
>
Acked-by: Lucas Bates
tomization file.
>
> In addition, this makes it easy to revert to a stock
> tdc environment for testing the test framework and/or
> the core tests.
>
> Also it makes it harder for any custom config to be
> submitted back to the kernel tdc.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
On Tue, Oct 31, 2017 at 2:26 PM, Brenda J. Butler wrote:
> Ignore .pyc files, "python compiled" files, that get created
> when a python script is run. They should never be committed.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
for verify
> ok 3 3f simple test, no need for setup or teardown (or verify)
>
> $
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
On Mon, Oct 30, 2017 at 8:37 PM, Brenda J. Butler wrote:
> The docstring says the function returns a "set" but it returns
> a "list". These are both python data types, so we should refer to
> the right one that is being returned.
>
> Signed-off-by: Brenda J. Butler
Acked-by: Lucas Bates
On Mon, Oct 30, 2017 at 7:12 PM, Cong Wang wrote:
> On Mon, Oct 30, 2017 at 3:39 PM, Lucas Bates wrote:
>> e.On Thu, Oct 26, 2017 at 9:24 PM, Cong Wang
>> wrote:
>>> Recently, the RCU callbacks used in TC filters and TC actions keep
>>> drawing my attentio
e.On Thu, Oct 26, 2017 at 9:24 PM, Cong Wang wrote:
> Recently, the RCU callbacks used in TC filters and TC actions keep
> drawing my attention, they introduce at least 4 race condition bugs:
> As suggested by Paul, we could defer the work to a workqueue and
> gain the permission of holding RTNL
too
specific and limiting.
There are some upcoming changes to tdc to help address these
particular issues. I'll ack this for now, thanks.
Acked-by: Lucas Bates
> ---
> .../tc-testing/tc-tests/filters/tests.json | 23
> +-
> tools/testing/
all filters share the same action
> -p, --prioall filters have different prio
>
> Signed-off-by: Chris Mi
> Acked-by: Jamal Hadi Salim
Acked-by: Lucas Bates
> ---
> tools/testing/selftests/tc-testing/tdc_batch.py | 62
> +
>
he -l argument
v2: fix the lack of final newlines in two new files (thanks David)
Lucas Bates (4):
tc-testing: Add test cases for flushing actions
tc-testing: Split test case files into smaller chunks
tc-testing: Add test cases for police and skbmod
tc-testing: fix the -l argument bug in t
This patch fixes a bug in the tdc script, where executing tdc
with the -l argument would cause the tests to start running
as opposed to listing all the known test cases.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
tools/testing/selftests/tc-testing/tdc.py | 8
1 file
The original submission had the test cases stored in one
monolithic file. This can be unwieldy to edit, especially as more
test cases are added. This patch removes the original tests.json
file in favour of individual ones broken down by category.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi
Add basic unit tests for police and skbmod actions in tc.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
.../tc-testing/tc-tests/actions/police.json| 527 +
.../tc-testing/tc-tests/actions/skbmod.json| 372 +++
2 files changed, 899
Tests for flushing gact and mirred were missing. This patch
adds test cases to explicitly test the flush of any installed
gact/mirred actions.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
.../tc-testing/tc-tests/actions/tests.json | 49 +-
1 file
he -l argument
Lucas Bates (4):
tc-testing: Add test cases for flushing actions
tc-testing: Split test case files into smaller chunks
tc-testing: Add test cases for police and skbmod
tc-testing: fix the -l argument bug in tdc.py script
.../tc-testing/tc-tests/actions/gact.json |
Tests for flushing gact and mirred were missing. This patch
adds test cases to explicitly test the flush of any installed
gact/mirred actions.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
.../tc-testing/tc-tests/actions/tests.json | 49 +-
1 file
The original submission had the test cases stored in one
monolithic file. This can be unwieldy to edit, especially as more
test cases are added. This patch removes the original tests.json
file in favour of individual ones broken down by category.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi
Add basic unit tests for police and skbmod actions in tc.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
.../tc-testing/tc-tests/actions/police.json| 527 +
.../tc-testing/tc-tests/actions/skbmod.json| 372 +++
2 files changed, 899
This patch fixes a bug in the tdc script, where executing tdc
with the -l argument would cause the tests to start running
as opposed to listing all the known test cases.
Signed-off-by: Lucas Bates
Acked-by: Jamal Hadi Salim
---
tools/testing/selftests/tc-testing/tdc.py | 8
1 file
This page is to highlight all operations and options that are
applicable to all tc actions.
Signed-off-by: Lucas Bates
Signed-off-by: Jamal Hadi Salim
---
man/man8/tc-actions.8 | 221 ++
1 file changed, 221 insertions(+)
create mode 100644 man
ions. Test
cases are most welcome; see the creating-testcases subdirectory for help
in creating them.
Signed-off-by: Lucas Bates
Signed-off-by: Jamal Hadi Salim
---
tools/testing/selftests/tc-testing/.gitignore |1 +
tools/testing/selftests/tc-testing/README | 102 ++
t
Apologies for sending this as one big patch. I've been sitting on this a little
too long, but it's ready and I wanted to get it out.
There are a limited number of tests to start - I plan to add more on a regular
basis.
Lucas Bates (1):
selftests: Introduce tc testsuite
too
Signed-off-by: Lucas Bates
Signed-off-by: Jamal Hadi Salim
Signed-off-by: Roman Mashak
---
man/man8/Makefile| 2 +-
man/man8/tc-skbmod.8 | 137 +++
2 files changed, 138 insertions(+), 1 deletion(-)
create mode 100644 man/man8/tc-skbmod.8
86 matches
Mail list logo