All of lore.kernel.org
 help / color / mirror / Atom feed
* [iproute PATCH 0/2] Two minor testsuite fixes
@ 2017-02-07 23:04 Phil Sutter
  2017-02-07 23:04 ` [iproute PATCH 1/2] testsuite: skip link show test on big endian systems Phil Sutter
  2017-02-07 23:04 ` [iproute PATCH 2/2] testsuite: Search kernel config in modules dir also Phil Sutter
  0 siblings, 2 replies; 5+ messages in thread
From: Phil Sutter @ 2017-02-07 23:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

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

-- 
2.11.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [iproute PATCH 1/2] testsuite: skip link show test on big endian systems
  2017-02-07 23:04 [iproute PATCH 0/2] Two minor testsuite fixes Phil Sutter
@ 2017-02-07 23:04 ` Phil Sutter
  2017-02-07 23:12   ` Stephen Hemminger
  2017-02-07 23:04 ` [iproute PATCH 2/2] testsuite: Search kernel config in modules dir also Phil Sutter
  1 sibling, 1 reply; 5+ messages in thread
From: Phil Sutter @ 2017-02-07 23:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

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 <phil@nwl.cc>
---
 .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

diff --git a/.gitignore b/.gitignore
index 74a5496ddf7aa..a1f295dac3dd2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ series
 # tests
 testsuite/results
 testsuite/iproute2/iproute2-this
+testsuite/tools/is_big_endian
 
 # doc files generated at runtime
 doc/*.aux
diff --git a/testsuite/Makefile b/testsuite/Makefile
index 2027650051d48..17568881b8b66 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -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 \
diff --git a/testsuite/tests/ip/link/show_dev_wo_vf_rate.t b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
index a600ba65c5bec..ad90af5400271 100755
--- a/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
+++ b/testsuite/tests/ip/link/show_dev_wo_vf_rate.t
@@ -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
diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile
new file mode 100644
index 0000000000000..ecbea16c2c1cc
--- /dev/null
+++ b/testsuite/tools/Makefile
@@ -0,0 +1,2 @@
+is_big_endian: is_big_endian.c
+	$(CC) -o $@ $<
diff --git a/testsuite/tools/is_big_endian.c b/testsuite/tools/is_big_endian.c
new file mode 100644
index 0000000000000..303e91b4603e8
--- /dev/null
+++ b/testsuite/tools/is_big_endian.c
@@ -0,0 +1,7 @@
+//#include <stdio.h>
+#include <arpa/inet.h>
+
+int main(void)
+{
+	return 1 != ntohs(1);
+}
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [iproute PATCH 2/2] testsuite: Search kernel config in modules dir also
  2017-02-07 23:04 [iproute PATCH 0/2] Two minor testsuite fixes Phil Sutter
  2017-02-07 23:04 ` [iproute PATCH 1/2] testsuite: skip link show test on big endian systems Phil Sutter
@ 2017-02-07 23:04 ` Phil Sutter
  1 sibling, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2017-02-07 23:04 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

At least in Fedora there is no /proc/config.gz but instead
/lib/modules/`uname -r`/config, so use that as a fallback.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 testsuite/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testsuite/Makefile b/testsuite/Makefile
index 17568881b8b66..41a3afc92ae98 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [iproute PATCH 1/2] testsuite: skip link show test on big endian systems
  2017-02-07 23:04 ` [iproute PATCH 1/2] testsuite: skip link show test on big endian systems Phil Sutter
@ 2017-02-07 23:12   ` Stephen Hemminger
  2017-02-07 23:49     ` Phil Sutter
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Hemminger @ 2017-02-07 23:12 UTC (permalink / raw)
  To: Phil Sutter; +Cc: netdev

On Wed,  8 Feb 2017 00:04:21 +0100
Phil Sutter <phil@nwl.cc> 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 <phil@nwl.cc>

Maybe better to figure out how to generate the files in host order?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [iproute PATCH 1/2] testsuite: skip link show test on big endian systems
  2017-02-07 23:12   ` Stephen Hemminger
@ 2017-02-07 23:49     ` Phil Sutter
  0 siblings, 0 replies; 5+ messages in thread
From: Phil Sutter @ 2017-02-07 23:49 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Tue, Feb 07, 2017 at 03:12:49PM -0800, Stephen Hemminger wrote:
> On Wed,  8 Feb 2017 00:04:21 +0100
> Phil Sutter <phil@nwl.cc> 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 <phil@nwl.cc>
> 
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-02-07 23:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-07 23:04 [iproute PATCH 0/2] Two minor testsuite fixes Phil Sutter
2017-02-07 23:04 ` [iproute PATCH 1/2] testsuite: skip link show test on big endian systems Phil Sutter
2017-02-07 23:12   ` Stephen Hemminger
2017-02-07 23:49     ` Phil Sutter
2017-02-07 23:04 ` [iproute PATCH 2/2] testsuite: Search kernel config in modules dir also Phil Sutter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.