Two minor testsuite fixes
Subsystems (2)
v2 cover Two minor testsuite fixes
While playing around with testsuite, I noticed two minor nits which this series attempts to fix.
Changes since v1:
- Replaced patch1 completely.
Phil Sutter (2):
testsuite: Generate nlmsg blob at runtime
testsuite: Search kernel config in modules dir also
.gitignore | 2 + testsuite/Makefile | 8 +++ testsuite/tests/ip/link/dev_wo_vf_rate.nl | Bin 14076 -> 0 bytes testsuite/tools/Makefile | 2 + testsuite/tools/generate_nlmsg.c | 116 ++++++++++++++++++++++++++++++ 5 files changed, 128 insertions(+) delete mode 100644 testsuite/tests/ip/link/dev_wo_vf_rate.nl create mode 100644 testsuite/tools/Makefile create mode 100644 testsuite/tools/generate_nlmsg.c
Signature · 1 line
2.11.0
PATCH v2 1/2 testsuite: Generate nlmsg blob at runtime
Since netlink messages are in host byte order, shipping a pre-generated nlmsg blob won't suffice on systems with different endianness. Therefore generate the blob at runtime, so it's content fits the hosts endianness.
Note that the generated message will contain only a single interface featuring two VFs instead of the full list before. Yet this is sufficient, as it triggers the crash with iproute versions prior to commit 8c29ae7cc2494 ("ip link: Fix crash on older kernels when show VF dev").
---
Changes since v1:
- Dropped the previous workaround altogether.
- Instead implemented this simple nlmsg generator.
--- .gitignore | 2 + testsuite/Makefile | 2 + testsuite/tests/ip/link/dev_wo_vf_rate.nl | Bin 14076 -> 0 bytes testsuite/tools/Makefile | 2 + testsuite/tools/generate_nlmsg.c | 116 ++++++++++++++++++++++++++++++ 5 files changed, 122 insertions(+) delete mode 100644 testsuite/tests/ip/link/dev_wo_vf_rate.nl create mode 100644 testsuite/tools/Makefile create mode 100644 testsuite/tools/generate_nlmsg.c
.gitignore +2 -0
@@ -36,6 +36,8 @@ series # tests testsuite/results testsuite/iproute2/iproute2-this +testsuite/tools/generate_nlmsg +testsuite/tests/ip/link/dev_wo_vf_rate.nl # doc files generated at runtime doc/*.aux
testsuite/Makefile +2 -0
@@ -43,6 +43,8 @@ $(TESTS): clean ifeq (,$(HAVE_UNSHARED_UTIL)) $(error Please install util-linux tools to run tests in separated network namespace) endif + @./tools/generate_nlmsg + @mkdir -p $(RESULTS_DIR) @for d in $(TESTS_DIR); do \
testsuite/tests/ip/link/dev_wo_vf_rate.nl deleted binary +0 -0
testsuite/tools/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.c + $(CC) -o $@ $^
testsuite/tools/generate_nlmsg.c new file +116 -0
116 lines not on this page · raw message
Signature · 1 line
2.11.0
PATCH v2 2/2 testsuite: Search kernel config in modules dir also
In reply to Phil SutterAt least in Fedora there is no /proc/config.gz but instead /lib/modules/uname -r/config, so use that as a fallback.
--- testsuite/Makefile | 6 ++++++ 1 file changed, 6 insertions(+)
testsuite/Makefile +6 -0
@@ -15,6 +15,12 @@ IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*)) ifneq (,$(wildcard /proc/config.gz)) KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG) +else +KVER := $(shell uname -r) +KCPATH := /lib/modules/${KVER}/config +ifneq (,$(wildcard ${KCPATH})) + KENV := $(shell cat ${KCPATH} | grep ^CONFIG) +endif endif .PHONY: compile listtests alltests configure $(TESTS)
Signature · 1 line
2.11.0
Quoted 10 lines · On Thu, 9 Feb 2017 11:50:53 +0100 Phil Sutter <[email protected]> wrote:
While playing around with testsuite, I noticed two minor nits which this series attempts to fix.
Changes since v1:
- Replaced patch1 completely.Phil Sutter (2):
testsuite: Generate nlmsg blob at runtime
testsuite: Search kernel config in modules dir also
Quoted 10 lines
.gitignore | 2 + testsuite/Makefile | 8 +++ testsuite/tests/ip/link/dev_wo_vf_rate.nl | Bin 14076 -> 0 bytes testsuite/tools/Makefile | 2 + testsuite/tools/generate_nlmsg.c | 116 ++++++++++++++++++++++++++++++ 5 files changed, 128 insertions(+) delete mode 100644 testsuite/tests/ip/link/dev_wo_vf_rate.nl create mode 100644 testsuite/tools/Makefile create mode 100644 testsuite/tools/generate_nlmsg.c
Nice. Applied.
I suspect the tests are rarely run because the core functionality doesn't change often. But in new environments these would be really useful.