netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iproute2 tests: Fix problem with test running
@ 2014-09-05 16:46 Vadim Kochan
  2014-09-05 17:07 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Vadim Kochan @ 2014-09-05 16:46 UTC (permalink / raw)
  To: netdev; +Cc: Vadim Kochan

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 | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/testsuite/Makefile b/testsuite/Makefile
index 2a4e0ba..6f2ea85 100644
--- a/testsuite/Makefile
+++ b/testsuite/Makefile
@@ -1,6 +1,7 @@
 ## -- Config --
 DEV := lo
 PREFIX := sudo
+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; \
+		$(PREFIX) TC="$$i/tc/tc" IP="$$i/ip/ip" DEV="$(DEV)" IPVER="$@" SNAME="$$i" \
+		ERRF="$(RESULTS_DIR)/$@.$$o.err" $(KENV) 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
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iproute2 tests: Fix problem with test running
  2014-09-05 16:46 [PATCH] iproute2 tests: Fix problem with test running Vadim Kochan
@ 2014-09-05 17:07 ` Stephen Hemminger
  2014-09-05 17:09   ` Vadim Kochan
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2014-09-05 17:07 UTC (permalink / raw)
  To: Vadim Kochan; +Cc: netdev

On Fri,  5 Sep 2014 19:46:31 +0300
Vadim Kochan <vadim4j@gmail.com> wrote:

> index 2a4e0ba..6f2ea85 100644
> --- a/testsuite/Makefile
> +++ b/testsuite/Makefile
> @@ -1,6 +1,7 @@
>  ## -- Config --
>  DEV := lo
>  PREFIX := sudo
> +RESULTS_DIR := "results"

Why the quotes?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iproute2 tests: Fix problem with test running
  2014-09-05 17:07 ` Stephen Hemminger
@ 2014-09-05 17:09   ` Vadim Kochan
  0 siblings, 0 replies; 3+ messages in thread
From: Vadim Kochan @ 2014-09-05 17:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

Eff, mistake ...

On Fri, Sep 5, 2014 at 8:07 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Fri,  5 Sep 2014 19:46:31 +0300
> Vadim Kochan <vadim4j@gmail.com> wrote:
>
>> index 2a4e0ba..6f2ea85 100644
>> --- a/testsuite/Makefile
>> +++ b/testsuite/Makefile
>> @@ -1,6 +1,7 @@
>>  ## -- Config --
>>  DEV := lo
>>  PREFIX := sudo
>> +RESULTS_DIR := "results"
>
> Why the quotes?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-09-05 17:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-05 16:46 [PATCH] iproute2 tests: Fix problem with test running Vadim Kochan
2014-09-05 17:07 ` Stephen Hemminger
2014-09-05 17:09   ` Vadim Kochan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).