testsuite: remove all temp files and implement make clean
Subsystems (3)
PATCH 1/3 testsuite: remove all temp files and implement make clean
Some generated test files were not removed, including one executable in the testsuite/tools directory.
Ensure make clean from the top level directory works for the testsuite subdirs too, and that all the files are removed.
--- Makefile | 2 +- testsuite/Makefile | 3 +++ testsuite/tools/Makefile | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-)
Makefile +1 -1
@@ -96,7 +96,7 @@ snapshot: > include/SNAPSHOT.h clean: - @for i in $(SUBDIRS); \ + @for i in $(SUBDIRS) testsuite; \ do $(MAKE) $(MFLAGS) -C $$i clean; done clobber:
testsuite/Makefile +3 -0
@@ -43,6 +43,9 @@ alltests: $(TESTS) clean: @echo "Removing $(RESULTS_DIR) dir ..." @rm -rf $(RESULTS_DIR) + @rm -f iproute2/iproute2-this + @rm -f tests/ip/link/dev_wo_vf_rate.nl + $(MAKE) -C tools clean distclean: clean echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
testsuite/tools/Makefile +3 -0
@@ -1,3 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.c $(CC) -o $@ $^ + +clean: + rm -f generate_nlmsg
Signature · 1 line
2.18.0
PATCH 2/3 testsuite: let make compile build the netlink helper
The generate_nlmsg binary is required but make -C testsuite compile does not build it. Add the necessary includes and C*FLAGS to the tools Makefile and have the compile target build it.
--- testsuite/Makefile | 1 + testsuite/tools/Makefile | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
testsuite/Makefile +1 -0
@@ -32,6 +32,7 @@ configure: compile: configure echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..; + $(MAKE) -C tools listtests: @for t in $(TESTS); do \
testsuite/tools/Makefile +3 -1
@@ -1,6 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 +include ../../config.mk + generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.c - $(CC) -o $@ $^ + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDLIBS) $(EXTRA_CFLAGS) -I../../include -include../../include/uapi/linux/netlink.h -o $@ $^ clean: rm -f generate_nlmsg
Signature · 1 line
2.18.0
PATCH 3/3 testsuite: run dmesg with sudo
In reply to Luca BoccassiSome distributions like Debian nowadays restrict the dmesg command to root-only. Run it with sudo in the testsuite.
--- testsuite/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testsuite/Makefile +1 -1
@@ -79,5 +79,5 @@ endif echo "PASS"; \ fi; \ rm "$$TMP_ERR" "$$TMP_OUT"; \ - dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \ + sudo dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \ done
Signature · 1 line
2.18.0
Quoted 7 lines · Luca Boccassi
Some generated test files were not removed, including one executable in the testsuite/tools directory.
Ensure make clean from the top level directory works for the testsuite subdirs too, and that all the files are removed.Signed-off-by Luca Boccassi <[email protected]>---
Patch 1+2 look good to me and I would ack if that would count in any way. For patch 3 I only wonder whether that might re-use $PREFIX (which is defined as "sudo -E unshare -n"). Ok, the unshare part might be slight overkill, but maybe a little better in style. Not sure though, and it is high level whining...
-Stefan
Quoted 44 lines
Makefile | 2 +- testsuite/Makefile | 3 +++ testsuite/tools/Makefile | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-)Makefile +1
-1@@ -96,7 +96,7 @@ snapshot: > include/SNAPSHOT.h clean: - @for i in $(SUBDIRS); \ + @for i in $(SUBDIRS) testsuite; \ do $(MAKE) $(MFLAGS) -C $$i clean; done clobber:testsuite/Makefile +3
-0@@ -43,6 +43,9 @@ alltests: $(TESTS) clean: @echo "Removing $(RESULTS_DIR) dir ..." @rm -rf $(RESULTS_DIR) + @rm -f iproute2/iproute2-this + @rm -f tests/ip/link/dev_wo_vf_rate.nl + $(MAKE) -C tools clean distclean: clean echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;testsuite/tools/Makefile +3
-0@@ -1,3 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.c $(CC) -o $@ $^ + +clean: + rm -f generate_nlmsg
Quoted 19 lines · Stefan Bader
Quoted 9 lines · Luca Boccassi
Some generated test files were not removed, including one executable in
the testsuite/tools directory.
Ensure make clean from the top level directory works for the testsuite
subdirs too, and that all the files are removed.Signed-off-by Luca Boccassi <[email protected]>---
Patch 1+2 look good to me and I would ack if that would count in any way.
For patch 3 I only wonder whether that might re-use $PREFIX (which is defined as "sudo -E unshare -n"). Ok, the unshare part might be slight
overkill, but maybe a little better in style. Not sure though, and it is high level whining...
Quoted 1 line
-Stefan
Hi,
Yeah I thought about that, but as you noticed it would run it through unshare so I changed it in the end. I don't mind either way - Stephen, let me know which one you prefer.
Signature · 2 lines
Kind regards, Luca Boccassi