diff mbox

[ovs-dev,06/10] automake.mk: New target 'check-pmd'.

Message ID 1457968700-23125-7-git-send-email-i.maximets@samsung.com
State Superseded
Headers show

Commit Message

Ilya Maximets March 14, 2016, 3:18 p.m. UTC
New target 'make check-pmd' introduced to run many of existing tests
with new dummy_pmd interfaces. This is reasonable because many parts
of code uses pmd_id or alters their behavior for PMD netdevs.
Later will be added new PMD specific tests.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 NEWS                      |  1 +
 tests/automake.mk         | 17 ++++++++++++++---
 tests/completion.at       |  3 ++-
 tests/dummy-macros.at     |  8 ++++++++
 tests/dummy-pmd-macros.at |  8 ++++++++
 tests/ofproto-macros.at   | 12 ++++++------
 tests/testsuite-pmd.at    | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 tests/testsuite.at        |  1 +
 8 files changed, 86 insertions(+), 10 deletions(-)
 create mode 100644 tests/dummy-macros.at
 create mode 100644 tests/dummy-pmd-macros.at
 create mode 100644 tests/testsuite-pmd.at
diff mbox

Patch

diff --git a/NEWS b/NEWS
index 38f6b56..41cf567 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,7 @@  Post-v2.5.0
        for 2.7+.
    - SELinux:
      * Introduced SELinux policy package.
+   - New target 'make check-pmd' to test work with PMD interfaces.
 
 v2.5.0 - xx xxx xxxx
 ---------------------
diff --git a/tests/automake.mk b/tests/automake.mk
index 3c5c848..211eddf 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -5,20 +5,25 @@  EXTRA_DIST += \
 	$(SYSTEM_KMOD_TESTSUITE_AT) \
 	$(SYSTEM_USERSPACE_TESTSUITE_AT) \
 	$(TESTSUITE) \
+	$(TESTSUITE_PMD) \
 	$(SYSTEM_KMOD_TESTSUITE) \
 	$(SYSTEM_USERSPACE_TESTSUITE) \
 	tests/atlocal.in \
 	$(srcdir)/package.m4 \
 	$(srcdir)/tests/testsuite \
+	$(srcdir)/tests/testsuite-pmd \
 	$(srcdir)/tests/testsuite.patch
 
 COMMON_MACROS_AT = \
 	tests/ovsdb-macros.at \
 	tests/ovs-macros.at \
-	tests/ofproto-macros.at
+	tests/ofproto-macros.at \
+	tests/dummy-macros.at \
+	tests/dummy-pmd-macros.at
 
 TESTSUITE_AT = \
 	tests/testsuite.at \
+	tests/testsuite-pmd.at \
 	tests/completion.at \
 	tests/library.at \
 	tests/heap.at \
@@ -107,6 +112,7 @@  SYSTEM_TESTSUITE_AT = \
 	tests/system-traffic.at
 
 TESTSUITE = $(srcdir)/tests/testsuite
+TESTSUITE_PMD = $(srcdir)/tests/testsuite-pmd
 TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
 SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
 SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
@@ -117,6 +123,10 @@  AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL):ovn
 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
 	set $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
 	"$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
+
+check-pmd: tests/atconfig tests/atlocal $(TESTSUITE_PMD) $(check_DATA)
+	set $(SHELL) '$(TESTSUITE_PMD)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS); \
+	"$$@" || (test X'$(RECHECK)' = Xyes && "$$@" --recheck)
 
 # Python Coverage support.
 # Requires coverage.py http://nedbatchelder.com/code/coverage/.
@@ -222,16 +232,17 @@  check-system-userspace: all tests/atconfig tests/atlocal $(SYSTEM_USERSPACE_TEST
 
 clean-local:
 	test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
+	test ! -f '$(TESTSUITE_PMD)' || $(SHELL) '$(TESTSUITE_PMD)' -C tests --clean
 
 AUTOTEST = $(AUTOM4TE) --language=autotest
 
 if WIN32
-$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH)
+$(TESTSUITE) $(TESTSUITE_PMD): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH)
 	$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o testsuite.tmp $@.at
 	patch -p0 testsuite.tmp $(TESTSUITE_PATCH)
 	$(AM_V_at)mv testsuite.tmp $@
 else
-$(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT)
+$(TESTSUITE) $(TESTSUITE_PMD): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT)
 	$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
 	$(AM_V_at)mv $@.tmp $@
 endif
diff --git a/tests/completion.at b/tests/completion.at
index 79093f9..a8401f4 100644
--- a/tests/completion.at
+++ b/tests/completion.at
@@ -679,7 +679,8 @@  AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager "],
 ${MATCH}
 ])
 # filename completion on unix, punix.
-MATCH="$(PREPARE_MATCH_NOSPACE(testsuite.log))"
+TMP="$(ls testsuite*.log)"
+MATCH="$(PREPARE_MATCH_NOSPACE(${TMP}))"
 AT_CHECK_UNQUOTED([ovs-vsctl-bashcomp.bash test "set-manager unix:test"],
 [0], [dnl
 ${MATCH}
diff --git a/tests/dummy-macros.at b/tests/dummy-macros.at
new file mode 100644
index 0000000..57514a1
--- /dev/null
+++ b/tests/dummy-macros.at
@@ -0,0 +1,8 @@ 
+# OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
+#
+# Calls __OVS_VSWITCHD_START with non-pmd dummy.
+m4_define([OVS_VSWITCHD_START],
+  [AS_IF([test -n "$3"],
+             __OVS_VSWITCHD_START([$1], [$2], [$3,non-pmd]),
+             __OVS_VSWITCHD_START([$1], [$2], [=non-pmd]))
+])
diff --git a/tests/dummy-pmd-macros.at b/tests/dummy-pmd-macros.at
new file mode 100644
index 0000000..988a79d
--- /dev/null
+++ b/tests/dummy-pmd-macros.at
@@ -0,0 +1,8 @@ 
+# OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
+#
+# Calls __OVS_VSWITCHD_START with dummy-pmd.
+m4_define([OVS_VSWITCHD_START],
+  [AS_IF([test -n "$3"],
+             __OVS_VSWITCHD_START([$1], [$2], [$3,pmd]),
+             __OVS_VSWITCHD_START([$1], [$2], [=pmd]))
+])
diff --git a/tests/ofproto-macros.at b/tests/ofproto-macros.at
index 18114d9..f493332 100644
--- a/tests/ofproto-macros.at
+++ b/tests/ofproto-macros.at
@@ -285,7 +285,7 @@  m4_define([_OVS_VSWITCHD_START],
 /ofproto|INFO|datapath ID changed to fedcba9876543210/d']])
 ])
 
-# OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
+# __OVS_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
 #
 # Creates a database and starts ovsdb-server, starts ovs-vswitchd
 # connected to that database, calls ovs-vsctl to create a bridge named
@@ -298,20 +298,20 @@  m4_define([_OVS_VSWITCHD_START],
 # =override (literally) as the third argument.  Otherwise, system devices
 # won't work at all (which makes sense because tests should not access a
 # system's real Ethernet devices).
-m4_define([OVS_VSWITCHD_START],
+m4_define([__OVS_VSWITCHD_START],
   [_OVS_VSWITCHD_START([--enable-dummy$3 --disable-system])
    AT_CHECK([add_of_br 0 $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2])
 ])
 
-# check_logs scans through all *.log files (except '*.log' and testsuite.log)
-# and reports all WARN, ERR, EMER log entries.  User can add custom sed filters
-# in $1.
+# check_logs scans through all *.log files (except '*.log', testsuite.log and
+# testsuite-pmd.log) and reports all WARN, ERR, EMER log entries.  User can add
+# custom sed filters in $1.
 m4_divert_push([PREPARE_TESTS])
 check_logs () {
     local logs
     for log in *.log; do
         case ${log} in # (
-            '*.log'|testsuite.log) ;; # (
+            '*.log'|testsuite.log|testsuite-pmd.log) ;; # (
             *) logs="${logs} ${log}" ;;
         esac
     done
diff --git a/tests/testsuite-pmd.at b/tests/testsuite-pmd.at
new file mode 100644
index 0000000..4897f47
--- /dev/null
+++ b/tests/testsuite-pmd.at
@@ -0,0 +1,46 @@ 
+AT_INIT
+
+AT_COPYRIGHT([Copyright (c) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at:
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.])
+
+m4_include([tests/ovs-macros.at])
+m4_include([tests/ovsdb-macros.at])
+m4_include([tests/ofproto-macros.at])
+m4_include([tests/dummy-pmd-macros.at])
+
+m4_include([tests/completion.at])
+m4_include([tests/bfd.at])
+m4_include([tests/cfm.at])
+m4_include([tests/lacp.at])
+m4_include([tests/bundle.at])
+m4_include([tests/classifier.at])
+m4_include([tests/ofp-actions.at])
+m4_include([tests/ovs-ofctl.at])
+m4_include([tests/mpls-xlate.at])
+m4_include([tests/learn.at])
+m4_include([tests/unixctl-py.at])
+m4_include([tests/tunnel.at])
+m4_include([tests/tunnel-push-pop.at])
+m4_include([tests/tunnel-push-pop-ipv6.at])
+m4_include([tests/ovs-vswitchd.at])
+m4_include([tests/ofproto.at])
+m4_include([tests/dpif-netdev.at])
+m4_include([tests/dpctl.at])
+m4_include([tests/ofproto-dpif.at])
+m4_include([tests/bridge.at])
+m4_include([tests/vlan-splinters.at])
+m4_include([tests/ovs-vsctl.at])
+m4_include([tests/interface-reconfigure.at])
+m4_include([tests/stp.at])
+m4_include([tests/rstp.at])
diff --git a/tests/testsuite.at b/tests/testsuite.at
index 7e3f193..c164ee6 100644
--- a/tests/testsuite.at
+++ b/tests/testsuite.at
@@ -17,6 +17,7 @@  limitations under the License.])
 m4_include([tests/ovs-macros.at])
 m4_include([tests/ovsdb-macros.at])
 m4_include([tests/ofproto-macros.at])
+m4_include([tests/dummy-macros.at])
 
 m4_include([tests/completion.at])
 m4_include([tests/bfd.at])