Two minor testsuite fixes
Subsystems (2)
cover Two minor testsuite fixes
While playing around with testsuite, I noticed two minor nits which this series attempts to fix.
Phil Sutter (2):
testsuite: skip link show test on big endian systems
testsuite: Search kernel config in modules dir also
.gitignore | 1 + testsuite/Makefile | 7 +++++++ testsuite/tests/ip/link/show_dev_wo_vf_rate.t | 5 +++++ testsuite/tools/Makefile | 2 ++ testsuite/tools/is_big_endian.c | 7 +++++++ 5 files changed, 22 insertions(+) create mode 100644 testsuite/tools/Makefile create mode 100644 testsuite/tools/is_big_endian.c
Signature · 1 line
2.11.0
PATCH 1/2 testsuite: skip link show test on big endian systems
Netlink protocol is in host byte order, so the provided binary netlink message buffer being in little endian format will cause the test to fail on big endian systems.
--- .gitignore | 1 + testsuite/Makefile | 1 + testsuite/tests/ip/link/show_dev_wo_vf_rate.t | 5 +++++ testsuite/tools/Makefile | 2 ++ testsuite/tools/is_big_endian.c | 7 +++++++ 5 files changed, 16 insertions(+) create mode 100644 testsuite/tools/Makefile create mode 100644 testsuite/tools/is_big_endian.c
.gitignore +1 -0
@@ -36,6 +36,7 @@ series # tests testsuite/results testsuite/iproute2/iproute2-this +testsuite/tools/is_big_endian # doc files generated at runtime doc/*.aux
testsuite/Makefile +1 -0
@@ -24,6 +24,7 @@ configure: compile: configure echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..; + echo "Entering tools" && cd tools && $(MAKE) && cd ..; listtests: @for t in $(TESTS); do \
testsuite/tests/ip/link/show_dev_wo_vf_rate.t +5 -0
@@ -2,5 +2,10 @@ source lib/generic.sh +if ./tools/is_big_endian; then + ts_log "won't work on big endian system" + ts_skip +fi + NL_FILE="tests/ip/link/dev_wo_vf_rate.nl" ts_ip "$0" "Show VF devices w/o VF rate info" -d monitor file $NL_FILE
testsuite/tools/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +is_big_endian: is_big_endian.c + $(CC) -o $@ $<
testsuite/tools/is_big_endian.c new file +7 -0
@@ -0,0 +1,7 @@ +//#include <stdio.h> +#include <arpa/inet.h> + +int main (void ) +{ +return 1 !=ntohs (1 ); +}
Signature · 1 line
2.11.0
PATCH 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
Re: [iproute PATCH 1/2] testsuite: skip link show test on big endian systems
In reply to Phil SutterQuoted 5 lines · On Wed, 8 Feb 2017 00:04:21 +0100 Phil Sutter <[email protected]> wrote:
Netlink protocol is in host byte order, so the provided binary netlink message buffer being in little endian format will cause the test to fail on big endian systems.
Signed-off-by Phil Sutter <[email protected]>
Maybe better to figure out how to generate the files in host order?
Re: [iproute PATCH 1/2] testsuite: skip link show test on big endian systems
Quoted 10 lines · Stephen Hemminger
Quoted 5 lines · On Wed, 8 Feb 2017 00:04:21 +0100 Phil Sutter <[email protected]> wrote:
Netlink protocol is in host byte order, so the provided binary netlink message buffer being in little endian format will cause the test to fail on big endian systems.
Signed-off-by Phil Sutter <[email protected]>Maybe better to figure out how to generate the files in host order?
Yes, I had thought about that as well. Not sure whether it's worth the effort though to write a program which constructs the messages and dumps them into a file for 'ip monitor' to read. I think there's a certain chance this will eventually test the message builder instead of iproute. :)
Cheers, Phil