With this patch, kernel datapath testsuite can be run under valgrind by using
the "check-kernel-valgrind" target and the results can be found under directory
"tests/system-kmod-testsuite.dir/".

Signed-off-by: Yifeng Sun <pkusunyif...@gmail.com>
---
 Documentation/topics/testing.rst | 4 ++++
 tests/automake.mk                | 7 +++++++
 2 files changed, 11 insertions(+)

diff --git a/Documentation/topics/testing.rst b/Documentation/topics/testing.rst
index 85aa6a1fb495..6645b794a07f 100644
--- a/Documentation/topics/testing.rst
+++ b/Documentation/topics/testing.rst
@@ -118,6 +118,10 @@ valgrind by using the ``check-valgrind`` target::
 When you do this, the "valgrind" results for test ``<N>`` are reported in files
 named ``tests/testsuite.dir/<N>/valgrind.*``.
 
+To test the testsuite of kernel datapath under valgrind, you can use the
+``check-kernel-valgrind`` target and find the "valgrind" results under
+directory ``tests/system-kmod-testsuite.dir/``.
+
 All the same options are available via TESTSUITEFLAGS.
 
 .. hint::
diff --git a/tests/automake.mk b/tests/automake.mk
index 7eed1064e82b..0acafca100d3 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -214,6 +214,13 @@ check-valgrind: all $(valgrind_wrappers) $(check_DATA)
        @echo 
'----------------------------------------------------------------------'
        @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
        @echo 
'----------------------------------------------------------------------'
+check-kernel-valgrind: all $(valgrind_wrappers) $(check_DATA)
+       set $(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests VALGRIND='$(VALGRIND)' 
AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS) -j1; \
+       "$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+       @echo
+       @echo 
'----------------------------------------------------------------------'
+       @echo 'Valgrind output can be found in 
tests/system-kmod-testsuite.dir/*/valgrind.*'
+       @echo 
'----------------------------------------------------------------------'
 check-helgrind: all $(valgrind_wrappers) $(check_DATA)
        -$(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true 
VALGRIND='$(HELGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d 
$(TESTSUITEFLAGS)
 
-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to