Skip to contentSkip to conversation

unbreak 'basic' and 'bpf' tdc testcases

PATCH In review Davide Caratti 2 participants 4 messages Feb 3, 2020 – Feb 4, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover unbreak 'basic' and 'bpf' tdc testcases

- patch 1/2 fixes tdc failures with 'bpf' action on fresch clones of the kernel tree
- patch 2/2 allow running tdc for the 'basic' classifier without tweaking tdc_config.py

Davide Caratti (2):
tc-testing: fix eBPF tests failure on linux fresh clones
tc-testing: add missing 'nsPlugin' to basic.json

 .../tc-testing/plugin-lib/buildebpfPlugin.py  |  2 +-
 .../tc-testing/tc-tests/filters/basic.json    | 51 +++++++++++++++++++
 2 files changed, 52 insertions(+), 1 deletion(-)
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/2 tc-testing: fix eBPF tests failure on linux fresh clones

when the following command is done on a fresh clone of the kernel tree,

[root@f31 tc-testing]# ./tdc.py -c bpf

test cases that need to build the eBPF sample program fail systematically, because 'buildebpfPlugin' is unable to install the kernel headers (i.e, the 'khdr' target fails). Pass the correct environment to 'make', in place of ENVIR, to allow running these tests.

Fixes 4c2d39bd40c1 ("tc-testing: use a plugin to build eBPF program")
---
 .../testing/selftests/tc-testing/plugin-lib/buildebpfPlugin.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/tc-testing/plugin-lib/buildebpfPlugin.py +1 -1
index e98c36750fae..d34fe06268d2 100644
@@ -54,7 +54,7 @@ class SubPlugin(TdcPlugin):
             shell=True,
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
-            env=ENVIR)
+            env=os.environ.copy())
         (rawout, serr) = proc.communicate()
 
         if proc.returncode != 0 and len(serr) > 0:
Signature · 1 line
2.24.1
#2 lore raw

PATCH 2/2 tc-testing: add missing 'nsPlugin' to basic.json

In reply to Davide Caratti

since tdc tests for cls_basic need $DEV1, use 'nsPlugin' so that the following command can be run without errors:

[root@f31 tc-testing]# ./tdc.py -c basic

Fixes 4717b05328ba ("tc-testing: Introduced tdc tests for basic filter")
---
 .../tc-testing/tc-tests/filters/basic.json    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
tools/testing/selftests/tc-testing/tc-tests/filters/basic.json +51 -0
index 2e361cea63bc..98a20faf3198 100644
@@ -6,6 +6,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -25,6 +28,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -44,6 +50,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -63,6 +72,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -82,6 +94,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -101,6 +116,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -120,6 +138,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -139,6 +160,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -158,6 +182,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -177,6 +204,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -196,6 +226,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -215,6 +248,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -234,6 +270,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -253,6 +292,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -272,6 +314,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -291,6 +336,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
@@ -310,6 +358,9 @@
             "filter",
             "basic"
         ],
+        "plugins": {
+            "requires": "nsPlugin"
+        },
         "setup": [
             "$TC qdisc add dev $DEV1 ingress"
         ],
Signature · 1 line
2.24.1
maintainer
#3 lore raw
In reply to Davide Caratti

From: Davide Caratti <[email protected]>
Date: Mon, 3 Feb 2020 16:29:28 +0100

Quoted 4 lines

- patch 1/2 fixes tdc failures with 'bpf' action on fresch clones of the kernel tree
- patch 2/2 allow running tdc for the 'basic' classifier without tweaking tdc_config.py

Series applied, thanks Davide.