]> git.proxmox.com Git - ovs.git/commitdiff
tests: Add ability to automatically rerun failed tests.
authorBen Pfaff <blp@ovn.org>
Wed, 24 Feb 2016 23:42:24 +0000 (15:42 -0800)
committerBen Pfaff <blp@ovn.org>
Wed, 24 Feb 2016 23:46:09 +0000 (15:46 -0800)
A lot of packaging was doing this already, so this simplifies their
implementation.

Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Andy Zhou <azhou@ovn.org>
CONTRIBUTING.md
INSTALL.md
debian/rules
rhel/openvswitch-fedora.spec.in
rhel/openvswitch.spec.in
tests/automake.mk
xenserver/openvswitch-xen.spec.in

index 086b6e8b4719bf114c6690b661ddfe14099661ae..6f69cfff0b96b5a01f4e014c5972e57e4e85a499 100644 (file)
@@ -29,8 +29,9 @@ In particular:
 
 Testing is also important:
 
-  - A patch that modifies existing code should be tested with
-    `make check` before submission.
+  - A patch that modifies existing code should be tested with `make
+    check` before submission.  Please see INSTALL.md, under
+    "Self-Tests", for more information.
 
   - A patch that adds or deletes files should also be tested with
     `make distcheck` before submission.
index dd4d9651a30b0eb48bd8c9627f8de13576a91fcd..9c96bbe0f6e70f2902da7532a114cfa30025b2b9 100644 (file)
@@ -525,7 +525,10 @@ valgrind results are easier to interpret if you put "-q" in
 Sometimes a few tests may fail on some runs but not others.  This is
 usually a bug in the testsuite, not a bug in Open vSwitch itself.  If
 you find that a test fails intermittently, please report it, since the
-developers may not have noticed.
+developers may not have noticed.  You can make the testsuite
+automatically rerun tests that fail, by adding RECHECK=yes to the
+"make" command line, e.g.:
+      `make check TESTSUITEFLAGS=-j8 RECHECK=yes`
 
 OFTest
 ------
index cc17cd0fec477f6114c3009ae5e5daca7c58628b..2a70bd63f38c47ec8104bd303e936bc6fde5cea7 100755 (executable)
@@ -34,8 +34,7 @@ override_dh_auto_configure:
 
 override_dh_auto_test:
 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
-       if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL)' || \
-                               $(MAKE) check TESTSUITEFLAGS='--recheck'; then :; \
+       if $(MAKE) check TESTSUITEFLAGS='$(PARALLEL)' RECHECK=yes; then :; \
        else \
                cat tests/testsuite.log; \
                exit 1; \
index 34d8712722d09d8bffb33ad10ad4e7d495e7e1ef..9052354bab991698b5463285bf3fbf3ebb97eb41 100644 (file)
@@ -184,8 +184,7 @@ rm -f $RPM_BUILD_ROOT%{_bindir}/ovs-parse-backtrace \
 
 %check
 %if %{with check}
-    if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
-       make check TESTSUITEFLAGS='--recheck'; then :;
+    if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
     else
         cat tests/testsuite.log
         exit 1
index 05b9e4d281db94538acb9868acf3cb55c71af863..b86f5db26df06aa0ce64f1a43d134c64bc4ac7d9 100644 (file)
@@ -76,8 +76,7 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
 
 %check
 %if %{with check}
-    if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
-       make check TESTSUITEFLAGS='--recheck'; then :;
+    if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
     else
         cat tests/testsuite.log
         exit 1
index ef0a2f685d8fc93fc1c21d8fe46a59795631f377..592f64888b80ab6e320c6ae6de1ba94beaffa948 100644 (file)
@@ -115,7 +115,8 @@ DISTCLEANFILES += tests/atconfig tests/atlocal
 AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller
 
 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
-       $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
+       set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
+       "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 \f
 # Python Coverage support.
 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
index 8bc4a2c363d04c838712b163b7314363fbd275b5..313dc4ccdbba41f5700b41c9a9c43b3e3ed32458 100644 (file)
@@ -162,8 +162,7 @@ install -d -m 755 $RPM_BUILD_ROOT/var/lib/openvswitch
 
 %check
 %if %{with check}
-    if make check TESTSUITEFLAGS='%{_smp_mflags}' ||
-       make check TESTSUITEFLAGS='--recheck'; then :;
+    if make check TESTSUITEFLAGS='%{_smp_mflags}' RECHECK=yes; then :;
     else
         cat tests/testsuite.log
         exit 1