summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHan Zhou <hzhou8@ebay.com>2019-04-12 16:26:21 -0700
committerBen Pfaff <blp@ovn.org>2019-04-15 12:54:38 -0700
commit2bcb3b7052c8c7d110ac9db37ac20c26f98f2215 (patch)
tree70d0360b7e9c8330b914ae50e33c5bd1f2095598 /tests
parent91e2d982c7dc046b60764c0c003bcdf2bf708fff (diff)
downloadopenvswitch-2bcb3b7052c8c7d110ac9db37ac20c26f98f2215.tar.gz
ovsdb raft: Move ovsdb cluster tests to separate testsuite.
Tests in ovsdb-cluster.at are relatively slow, especially torture tests, and they will be changed in the future costing high CPU, to make the tests more effective. So we move the tests to a separate testsuite, so that we can execute them separately, probably with lower parallelism to avoid exhausting system resources. Signed-off-by: Han Zhou <hzhou8@ebay.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/automake.mk23
-rw-r--r--tests/ovsdb-cluster-testsuite.at15
-rw-r--r--tests/ovsdb.at1
3 files changed, 37 insertions, 2 deletions
diff --git a/tests/automake.mk b/tests/automake.mk
index 92d56b29d..017d2d416 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -6,11 +6,13 @@ EXTRA_DIST += \
$(SYSTEM_USERSPACE_TESTSUITE_AT) \
$(SYSTEM_OFFLOADS_TESTSUITE_AT) \
$(SYSTEM_DPDK_TESTSUITE_AT) \
+ $(OVSDB_CLUSTER_TESTSUITE_AT) \
$(TESTSUITE) \
$(SYSTEM_KMOD_TESTSUITE) \
$(SYSTEM_USERSPACE_TESTSUITE) \
$(SYSTEM_OFFLOADS_TESTSUITE) \
$(SYSTEM_DPDK_TESTSUITE) \
+ $(OVSDB_CLUSTER_TESTSUITE) \
tests/atlocal.in \
$(srcdir)/package.m4 \
$(srcdir)/tests/testsuite \
@@ -91,7 +93,6 @@ TESTSUITE_AT = \
tests/ovsdb-idl.at \
tests/ovsdb-lock.at \
tests/ovsdb-rbac.at \
- tests/ovsdb-cluster.at \
tests/ovs-vsctl.at \
tests/ovs-xapi-sync.at \
tests/stp.at \
@@ -141,6 +142,10 @@ $(srcdir)/tests/fuzz-regression-list.at: tests/automake.mk
echo "TEST_FUZZ_REGRESSION([$$basename])"; \
done > $@.tmp && mv $@.tmp $@
+OVSDB_CLUSTER_TESTSUITE_AT = \
+ tests/ovsdb-cluster-testsuite.at \
+ tests/ovsdb-cluster.at
+
SYSTEM_KMOD_TESTSUITE_AT = \
tests/system-common-macros.at \
tests/system-kmod-testsuite.at \
@@ -178,6 +183,7 @@ SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
SYSTEM_OFFLOADS_TESTSUITE = $(srcdir)/tests/system-offloads-testsuite
SYSTEM_DPDK_TESTSUITE = $(srcdir)/tests/system-dpdk-testsuite
+OVSDB_CLUSTER_TESTSUITE = $(srcdir)/tests/ovsdb-cluster-testsuite
DISTCLEANFILES += tests/atconfig tests/atlocal
AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):$(SSL_DIR):ovn/controller-vtep:ovn/northd:ovn/utilities:ovn/controller
@@ -260,6 +266,12 @@ check-valgrind: all $(valgrind_wrappers) $(check_DATA)
@echo '----------------------------------------------------------------------'
@echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
@echo '----------------------------------------------------------------------'
+check-ovsdb-cluster-valgrind: all $(valgrind_wrappers) $(check_DATA)
+ $(SHELL) '$(OVSDB_CLUSTER_TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS) -j1
+ @echo
+ @echo '----------------------------------------------------------------------'
+ @echo 'Valgrind output can be found in tests/ovsdb-cluster-testsuite.dir/*/valgrind.*'
+ @echo '----------------------------------------------------------------------'
check-kernel-valgrind: all $(valgrind_wrappers) $(check_DATA)
$(SHELL) '$(SYSTEM_KMOD_TESTSUITE)' -C tests VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS) -j1
@echo
@@ -312,6 +324,11 @@ check-dpdk: all
clean-local:
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
+
+# Run OVSDB cluster tests.
+check-ovsdb-cluster: all
+ set $(SHELL) '$(OVSDB_CLUSTER_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)'; \
+ "$$@" $(TESTSUITEFLAGS) -j1 || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
AUTOTEST = $(AUTOM4TE) --language=autotest
@@ -342,6 +359,10 @@ $(SYSTEM_DPDK_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_DPDK_TESTSU
$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
$(AM_V_at)mv $@.tmp $@
+$(OVSDB_CLUSTER_TESTSUITE): package.m4 $(OVSDB_CLUSTER_TESTSUITE_AT) $(COMMON_MACROS_AT)
+ $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+ $(AM_V_at)mv $@.tmp $@
+
# The `:;' works around a Bash 3.2 bug when the output is not writeable.
$(srcdir)/package.m4: $(top_srcdir)/configure.ac
$(AM_V_GEN):;{ \
diff --git a/tests/ovsdb-cluster-testsuite.at b/tests/ovsdb-cluster-testsuite.at
new file mode 100644
index 000000000..6c205c1f7
--- /dev/null
+++ b/tests/ovsdb-cluster-testsuite.at
@@ -0,0 +1,15 @@
+AT_INIT
+
+m4_ifdef([AT_COLOR_TESTS], [AT_COLOR_TESTS])
+
+m4_include([tests/ovs-macros.at])
+m4_include([tests/ovsdb-macros.at])
+m4_include([tests/ofproto-macros.at])
+
+# XXX: below dummy test is to invoke AT_SETUP before including any tests.
+# Without this, there will be error: possibly undefined macro: AT_capture_files
+# when parsing .at files that use OVS_START_SHELL_HELPERS.
+AT_SETUP([dummy])
+AT_CHECK([:])
+AT_CLEANUP
+m4_include([tests/ovsdb-cluster.at])
diff --git a/tests/ovsdb.at b/tests/ovsdb.at
index b388ccfbb..afefeffd8 100644
--- a/tests/ovsdb.at
+++ b/tests/ovsdb.at
@@ -19,4 +19,3 @@ m4_include([tests/ovsdb-monitor.at])
m4_include([tests/ovsdb-idl.at])
m4_include([tests/ovsdb-lock.at])
m4_include([tests/ovsdb-rbac.at])
-m4_include([tests/ovsdb-cluster.at])