]>
Commit | Line | Data |
---|---|---|
150a5bc3 SH |
1 | ## -- Config -- |
2 | DEV := lo | |
9ecff68d | 3 | PREFIX := sudo -E |
4 | RESULTS_DIR := results | |
150a5bc3 SH |
5 | ## -- End Config -- |
6 | ||
7 | TESTS := $(patsubst tests/%,%,$(wildcard tests/*.t)) | |
82af5315 | 8 | IPVERS := $(filter-out iproute2/Makefile,$(wildcard iproute2/*)) |
150a5bc3 | 9 | KENV := $(shell cat /proc/config.gz | gunzip | grep ^CONFIG) |
82af5315 | 10 | |
150a5bc3 | 11 | .PHONY: compile listtests alltests configure $(TESTS) |
82af5315 | 12 | |
150a5bc3 SH |
13 | configure: |
14 | echo "Entering iproute2" && cd iproute2 && $(MAKE) configure && cd ..; | |
82af5315 | 15 | |
150a5bc3 | 16 | compile: configure |
82af5315 | 17 | echo "Entering iproute2" && cd iproute2 && $(MAKE) && cd ..; |
18 | ||
19 | listtests: | |
20 | @for t in $(TESTS); do \ | |
21 | echo "$$t"; \ | |
22 | done | |
23 | ||
24 | alltests: $(TESTS) | |
25 | ||
26 | clean: | |
9ecff68d | 27 | @rm -rf $(RESULTS_DIR) |
82af5315 | 28 | |
150a5bc3 SH |
29 | distclean: clean |
30 | echo "Entering iproute2" && cd iproute2 && $(MAKE) distclean && cd ..; | |
31 | ||
82af5315 | 32 | $(TESTS): |
9ecff68d | 33 | @mkdir -p $(RESULTS_DIR) |
82af5315 | 34 | @for i in $(IPVERS); do \ |
82af5315 | 35 | o=`echo $$i | sed -e 's/iproute2\///'`; \ |
150a5bc3 SH |
36 | echo -n "Running $@ [$$o/`uname -r`]: "; \ |
37 | TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \ | |
9ecff68d | 38 | ERRF="$(RESULTS_DIR)/$@.$$o.err" $(KENV) $(PREFIX) tests/$@ > $(RESULTS_DIR)/$@.$$o.out; \ |
150a5bc3 SH |
39 | if [ "$$?" = "127" ]; then \ |
40 | echo "SKIPPED"; \ | |
9ecff68d | 41 | elif [ -e "$(RESULTS_DIR)/$@.$$o.err" ]; then \ |
82af5315 | 42 | echo "FAILED"; \ |
150a5bc3 SH |
43 | else \ |
44 | echo "PASS"; \ | |
45 | fi; \ | |
9ecff68d | 46 | dmesg > $(RESULTS_DIR)/$@.$$o.dmesg; \ |
82af5315 | 47 | done |