Skip to contentSkip to conversation

testsuite: make alltests fixes

PATCH In review Petr Vorel 4 participants 7 messages Sep 20, 2018 – Sep 21, 2018

Subsystems (2)
lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

v2 cover testsuite: make alltests fixes

Hi,

here are simply fixes to restore 'make alltests'.
Currently it does not run.

Kind regards,
Petr

Petr Vorel (3):
testsuite: Fix missing generate_nlmsg
testsuite: Generate generate_nlmsg when needed
testsuite: Warn about empty $(IPVERS)

 testsuite/Makefile | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
Signature · 1 line
2.19.0.rc2
author
#1 lore raw

PATCH v2 1/3 testsuite: Fix missing generate_nlmsg

Commit ad23e152 caused generate_nlmsg to be always missing:

$ make alltests
make: ./tools/generate_nlmsg: Command not found

Create testclean: to remove only results directory.

Fixes ad23e152 testsuite: remove all temp files and implement make clean
---
 testsuite/Makefile | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
testsuite/Makefile +6 -5
index d1ac997d..a31d4531 100644
@@ -30,7 +30,6 @@ configure:
 
 compile: configure
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
-	$(MAKE) -C tools
 
 listtests:
 	@for t in $(TESTS); do \
@@ -39,9 +38,11 @@ listtests:
 
 alltests: $(TESTS)
 
-clean:
+testclean:
 	@echo "Removing $(RESULTS_DIR) dir ..."
 	@rm -rf $(RESULTS_DIR)
+
+clean: testclean
 	@rm -f iproute2/iproute2-this
 	@rm -f tests/ip/link/dev_wo_vf_rate.nl
 	$(MAKE) -C tools clean
@@ -49,18 +50,18 @@ clean:
 distclean: clean
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
 
-$(TESTS): clean
+$(TESTS): testclean
 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 \
 	    mkdir -p $(RESULTS_DIR)/$$d; \
 	done
-	
+
 	@if [ "$(KCPATH)" = "/proc/config.gz" ]; then \
 		gunzip -c $(KCPATH) >$(KENVFN); \
 	elif [ "$(KCPATH)" != "" ]; then \
Signature · 1 line
2.19.0.rc2
author
#2 lore raw

PATCH v2 2/3 testsuite: Generate generate_nlmsg when needed

In reply to Petr Vorel

Commit 886f2c43 added generate_nlmsg.c. Running alltests target, which uses the binary required to run 'make -C tools' before.

Fixes 886f2c43 testsuite: Generate nlmsg blob at runtime
---
 testsuite/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
testsuite/Makefile +5 -2
index a31d4531..1c2467f5 100644
@@ -28,7 +28,7 @@ endif
 configure:
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..;
 
-compile: configure
+compile: configure generate_nlmsg
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..;
 
 listtests:
@@ -36,7 +36,10 @@ listtests:
 		echo "$$t"; \
 	done
 
-alltests: $(TESTS)
+generate_nlmsg:
+	$(MAKE) -C tools
+
+alltests: generate_nlmsg $(TESTS)
 
 testclean:
 	@echo "Removing $(RESULTS_DIR) dir ..."
Signature · 1 line
2.19.0.rc2
author
#3 lore raw

PATCH v2 3/3 testsuite: Warn about empty $(IPVERS)

In reply to Petr Vorel

alltests target requires having symlink created by configure target (default target). Without that there is no test being run.

---
 testsuite/Makefile | 3 +++
 1 file changed, 3 insertions(+)
testsuite/Makefile +3 -0
index 1c2467f5..b3aebec1 100644
@@ -54,6 +54,9 @@ distclean: clean
 	echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
 
 $(TESTS): testclean
+ifeq (,$(IPVERS))
+	$(error Please run make first)
+endif
 ifeq (,$(HAVE_UNSHARED_UTIL))
 	$(error Please install util-linux tools to run tests in separated network namespace)
 endif
Signature · 1 line
2.19.0.rc2
#4 lore raw
In reply to Petr Vorel

Hi Petr,

Quoted 2 lines · Petr Vorel

here are simply fixes to restore 'make alltests'.
Currently it does not run.

Yeah, that testsuite definitely deserves some love.

Just one nit: The one-line summary in Fixes: tags should be enclosed in quotes and parens, e.g.:

| Fixes: deadbeef ("foo bar")

Cheers, Phil

#5 lore raw
In reply to Petr Vorel
Quoted 8 lines · Petr Vorel

Hi,

here are simply fixes to restore 'make alltests'.
Currently it does not run.

Kind regards,
Petr

Quoted 7 lines

Petr Vorel (3):
  testsuite: Fix missing generate_nlmsg
  testsuite: Generate generate_nlmsg when needed
  testsuite: Warn about empty $(IPVERS)

 testsuite/Makefile | 21 ++++++++++++++-------

 1 file changed, 14 insertions(+), 7 deletions(-)
Signature · 2 lines
Kind regards,
Luca Boccassi
#6 lore raw
In reply to Petr Vorel
Quoted 8 lines · On Thu, 20 Sep 2018 01:36:21 +0200 Petr Vorel <[email protected]> wrote:

Hi,

here are simply fixes to restore 'make alltests'.
Currently it does not run.

Kind regards,
Petr

Quoted 8 lines

Petr Vorel (3):
testsuite: Fix missing generate_nlmsg
testsuite: Generate generate_nlmsg when needed
testsuite: Warn about empty $(IPVERS)

 testsuite/Makefile | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

Applied, it would be good to have 'make tests' at the top level.