tests: Fix problem with test running
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>
This commit is contained in:
parent
10f5a375ea
commit
9ecff68d11
|
|
@ -1,6 +1,7 @@
|
||||||
## -- Config --
|
## -- Config --
|
||||||
DEV := lo
|
DEV := lo
|
||||||
PREFIX := sudo
|
PREFIX := sudo -E
|
||||||
|
RESULTS_DIR := results
|
||||||
## -- End Config --
|
## -- End Config --
|
||||||
|
|
||||||
TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
|
TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t))
|
||||||
|
|
@ -23,23 +24,24 @@ listtests:
|
||||||
alltests: $(TESTS)
|
alltests: $(TESTS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -rf results/*
|
@rm -rf $(RESULTS_DIR)
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
|
echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..;
|
||||||
|
|
||||||
$(TESTS):
|
$(TESTS):
|
||||||
|
@mkdir -p $(RESULTS_DIR)
|
||||||
@for i in $(IPVERS); do \
|
@for i in $(IPVERS); do \
|
||||||
o=`echo $$i | sed -e 's/iproute2\///'`; \
|
o=`echo $$i | sed -e 's/iproute2\///'`; \
|
||||||
echo -n "Running $@ [$$o/`uname -r`]: "; \
|
echo -n "Running $@ [$$o/`uname -r`]: "; \
|
||||||
TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
|
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 \
|
if [ "$$?" = "127" ]; then \
|
||||||
echo "SKIPPED"; \
|
echo "SKIPPED"; \
|
||||||
elif [ -e "results/$@.$$o.err" ]; then \
|
elif [ -e "$(RESULTS_DIR)/$@.$$o.err" ]; then \
|
||||||
echo "FAILED"; \
|
echo "FAILED"; \
|
||||||
else \
|
else \
|
||||||
echo "PASS"; \
|
echo "PASS"; \
|
||||||
fi; \
|
fi; \
|
||||||
dmesg > results/$@.$$o.dmesg; \
|
dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue