]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
tests: Fix problem with test running
authorvadimk <vadim4j@gmail.com>
Sat, 6 Sep 2014 10:27:07 +0000 (13:27 +0300)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 29 Sep 2014 15:51:51 +0000 (08:51 -0700)
Tests were not allowed to be ran, the following
issues were fixed:
    - creating the results folder before test running
    - sudo $PREFIX moved before variables definition which
        allow to pass them through the sudo to test script.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
testsuite/Makefile

index 2a4e0ba9bfca8615b0dc312c8ed80f39d2f40f4d..b4ab15e2b8f9be190729808b3eca48291c07b505 100644 (file)
@@ -1,6 +1,7 @@
 ## -- Config --
 DEV := lo
-PREFIX := sudo
+PREFIX := sudo -E
+RESULTS_DIR := results
 ## -- End Config --
 
 TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
@@ -23,23 +24,24 @@ listtests:
 alltests: $(TESTS)
 
 clean:
-       @rm -rf results/*
+       @rm -rf $(RESULTS_DIR)
 
 distclean: clean
        echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
 
 $(TESTS):
+       @mkdir -p $(RESULTS_DIR)
        @for i in $(IPVERS); do \
                o=`echo $$i | sed -e 's/iproute2\///'`; \
                echo -n "Running $@ [$$o/`uname -r`]: "; \
                TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
-               ERRF="results/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > results/$@.$$o.out; \
+               ERRF="$(RESULTS_DIR)/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > $(RESULTS_DIR)/$@.$$o.out; \
                if [ "$$?" = "127" ]; then \
                        echo "SKIPPED"; \
-               elif [ -e "results/$@.$$o.err" ]; then \
+               elif [ -e "$(RESULTS_DIR)/$@.$$o.err" ]; then \
                        echo "FAILED"; \
                else \
                        echo "PASS"; \
                fi; \
-               dmesg > results/$@.$$o.dmesg; \
+               dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \
        done