$ make check TESTSUITEFLAGS=-j8 RECHECK=yes
+Debugging unit tests
+++++++++++++++++++++
+
+To initiate debugging from artifacts generated from `make check` run, set the
+``OVS_PAUSE_TEST`` environment variable to 1. For example, to run test case
+139 and pause on error::
+
+ $ OVS_PAUSE_TEST=1 make check TESTSUITEFLAGS='-v 139'
+
+When error occurs, above command would display something like this::
+
+ Set environment variable to use various ovs utilities
+ export OVS_RUNDIR=<dir>/ovs/_build-gcc/tests/testsuite.dir/0139
+ Press ENTER to continue:
+
+And from another window, one can execute ovs-xxx commands like::
+
+ export OVS_RUNDIR=/opt/vdasari/Developer/ovs/_build-gcc/tests/testsuite.dir/0139
+ $ ovs-ofctl dump-ports br0
+ .
+ .
+
+Once done with investigation, press ENTER to perform cleanup operation.
+
.. _testing-coverage:
Coverage
The results of the testsuite are in ``tests/system-userspace-testsuite.dir``.
+All the features documented under `Unit Tests`_ are available for the userspace
+datapath testsuite.
+
DPDK datapath
'''''''''''''
.. _Configure hugepages: http://doc.dpdk.org/guides/linux_gsg/sys_reqs.html
+All the features documented under `Unit Tests`_ are available for the DPDK
+datapath testsuite.
+
Kernel datapath
'''''''''''''''
The results of the testsuite are in ``tests/system-kmod-testsuite.dir``.
+All the features documented under `Unit Tests`_ are available for the kernel
+datapath testsuite.
+
.. _testing-static-analysis:
Static Code Analysis
# directory.
ovs_init() {
ovs_base=`pwd`
- trap '. "$ovs_base/cleanup"' 0
+ trap ovs_on_exit 0
: > cleanup
ovs_setenv
}
+# Catch testsuite error condition and cleanup test environment by tearing down
+# all interfaces and processes spawned.
+# User has an option to leave the test environment in error state so that system
+# can be poked around to get more information. User can enable this option by setting
+# environment variable OVS_PAUSE_TEST=1. User needs to press CTRL-D to resume the
+# cleanup operation.
+ovs_pause() {
+ echo "====================================================="
+ echo "Set following environment variable to use various ovs utilities"
+ echo "export OVS_RUNDIR=$ovs_base"
+ echo "Press ENTER to continue: "
+ read
+}
+
+ovs_on_exit () {
+ if [ ! -z "${OVS_PAUSE_TEST}" ] && [ -z $at_verbose ]; then
+ trap '' INT
+ ovs_pause
+ fi
+ . "$ovs_base/cleanup"
+}
+
# With no parameter or an empty parameter, sets the OVS_*DIR
# environment variables to point to $ovs_base, the base directory in
# which the test is running.