/ovs-pki.log
/pki/
/system-kmod-testsuite
+/system-userspace-testsuite
/test-aes128
/test-atomic
/test-bundle
EXTRA_DIST += \
$(COMMON_MACROS_AT) \
$(TESTSUITE_AT) \
+ $(SYSTEM_TESTSUITE_AT) \
$(SYSTEM_KMOD_TESTSUITE_AT) \
+ $(SYSTEM_USERSPACE_TESTSUITE_AT) \
$(TESTSUITE) \
$(SYSTEM_KMOD_TESTSUITE) \
+ $(SYSTEM_USERSPACE_TESTSUITE) \
tests/atlocal.in \
$(srcdir)/package.m4 \
$(srcdir)/tests/testsuite \
SYSTEM_KMOD_TESTSUITE_AT = \
tests/system-common-macros.at \
tests/system-kmod-testsuite.at \
- tests/system-kmod-macros.at \
+ tests/system-kmod-macros.at
+
+SYSTEM_USERSPACE_TESTSUITE_AT = \
+ tests/system-userspace-testsuite.at \
+ tests/system-userspace-macros.at
+
+SYSTEM_TESTSUITE_AT = \
+ tests/system-common-macros.at \
tests/system-traffic.at
TESTSUITE = $(srcdir)/tests/testsuite
TESTSUITE_PATCH = $(srcdir)/tests/testsuite.patch
SYSTEM_KMOD_TESTSUITE = $(srcdir)/tests/system-kmod-testsuite
+SYSTEM_USERSPACE_TESTSUITE = $(srcdir)/tests/system-userspace-testsuite
DISTCLEANFILES += tests/atconfig tests/atlocal
AUTOTEST_PATH = utilities:vswitchd:ovsdb:vtep:tests:$(PTHREAD_WIN32_DIR_DLL)
modprobe -r openvswitch
$(MAKE) check-kernel
+check-system-userspace: all tests/atconfig tests/atlocal $(SYSTEM_USERSPACE_TESTSUITE)
+ $(SHELL) '$(SYSTEM_USERSPACE_TESTSUITE)' -C tests AUTOTEST_PATH='$(AUTOTEST_PATH)' $(TESTSUITEFLAGS)
+
clean-local:
test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
$(AM_V_at)mv $@.tmp $@
endif
-$(SYSTEM_KMOD_TESTSUITE): package.m4 $(SYSTEM_KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT)
+$(SYSTEM_KMOD_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT)
+ $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+ $(AM_V_at)mv $@.tmp $@
+
+$(SYSTEM_USERSPACE_TESTSUITE): package.m4 $(SYSTEM_TESTSUITE_AT) $(SYSTEM_USERSPACE_TESTSUITE_AT) $(COMMON_MACROS_AT)
$(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
$(AM_V_at)mv $@.tmp $@
m4_define([ADD_VETH],
[ AT_CHECK([ip link add $1 type veth peer name ovs-$1])
AT_CHECK([ip link set $1 netns $2])
- AT_CHECK([ovs-vsctl add-port $3 ovs-$1])
AT_CHECK([ip link set dev ovs-$1 up])
+ AT_CHECK([ovs-vsctl add-port $3 ovs-$1])
NS_CHECK_EXEC([$2], [ip addr add $4 dev $1])
NS_CHECK_EXEC([$2], [ip link set dev $1 up])
+ ON_EXIT([ip link del ovs-$1])
]
)
-# OVS_KMOD_VSWITCHD_START([vsctl-args], [vsctl-output], [=override])
+# ADD_BR([name])
+#
+# Expands into the proper ovs-vsctl commands to create a bridge with the
+# appropriate type
+m4_define([ADD_BR], [[add-br $1]])
+
+# OVS_TRAFFIC_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
# output (e.g. because it includes "create" commands) then 'vsctl-output'
# specifies the expected output after filtering through uuidfilt.pl.
#
-m4_define([OVS_KMOD_VSWITCHD_START],
+m4_define([OVS_TRAFFIC_VSWITCHD_START],
[ AT_CHECK([modprobe openvswitch])
ON_EXIT([modprobe -r openvswitch])
_OVS_VSWITCHD_START([])
dnl Add bridges, ports, etc.
- AT_CHECK([ovs-vsctl -- add-br br0 -- set bridge br0 protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2])
+ AT_CHECK([ovs-vsctl -- ADD_BR([br0]) -- set bridge br0 protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2])
])
-#
-#
-# OVS_KMOD_VSWITCHD_STOP([WHITELIST], [extra_cmds])
+
+# OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds])
#
# Gracefully stops ovs-vswitchd and ovsdb-server, checking their log files
# for messages with severity WARN or higher and signaling an error if any
# is present. The optional WHITELIST may contain shell-quoted "sed"
# commands to delete any warnings that are actually expected, e.g.:
#
-# OVS_KMOD_VSWITCHD_STOP(["/expected error/d"])
+# OVS_TRAFFIC_VSWITCHD_STOP(["/expected error/d"])
#
# 'extra_cmds' are shell commands to be executed afte OVS_VSWITCHD_STOP() is
# invoked. They can be used to perform additional cleanups such as name space
-AT_BANNER([kmod-sanity])
+AT_BANNER([datapath-sanity])
-AT_SETUP([kmod - ping between two ports])
-OVS_KMOD_VSWITCHD_START(
+AT_SETUP([datapath - ping between two ports])
+OVS_TRAFFIC_VSWITCHD_START(
[set-fail-mode br0 standalone -- ])
ADD_NAMESPACES(at_ns0, at_ns1)
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
-OVS_KMOD_VSWITCHD_STOP
+OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP
-AT_SETUP([kmod - ping between two ports on vlan])
-OVS_KMOD_VSWITCHD_START(
+AT_SETUP([datapath - ping between two ports on vlan])
+OVS_TRAFFIC_VSWITCHD_START(
[set-fail-mode br0 standalone -- ])
ADD_NAMESPACES(at_ns0, at_ns1)
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
-OVS_KMOD_VSWITCHD_STOP
+OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP
-AT_SETUP([kmod - ping6 between two ports])
-OVS_KMOD_VSWITCHD_START(
+AT_SETUP([datapath - ping6 between two ports])
+OVS_TRAFFIC_VSWITCHD_START(
[set-fail-mode br0 standalone -- ])
ADD_NAMESPACES(at_ns0, at_ns1)
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
-OVS_KMOD_VSWITCHD_STOP
+OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP
-AT_SETUP([kmod - ping6 between two ports on vlan])
-OVS_KMOD_VSWITCHD_START(
+AT_SETUP([datapath - ping6 between two ports on vlan])
+OVS_TRAFFIC_VSWITCHD_START(
[set-fail-mode br0 standalone -- ])
ADD_NAMESPACES(at_ns0, at_ns1)
3 packets transmitted, 3 received, 0% packet loss, time 0ms
])
-OVS_KMOD_VSWITCHD_STOP
+OVS_TRAFFIC_VSWITCHD_STOP
AT_CLEANUP
--- /dev/null
+# ADD_BR([name])
+#
+# Expands into the proper ovs-vsctl commands to create a bridge with the
+# appropriate type
+m4_define([ADD_BR], [[add-br $1 -- set Bridge $1 datapath_type="netdev" ]])
+
+# OVS_TRAFFIC_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
+# br0 with predictable settings, passing 'vsctl-args' as additional
+# commands to ovs-vsctl. If 'vsctl-args' causes ovs-vsctl to provide
+# output (e.g. because it includes "create" commands) then 'vsctl-output'
+# specifies the expected output after filtering through uuidfilt.pl.
+m4_define([OVS_TRAFFIC_VSWITCHD_START],
+ [
+ _OVS_VSWITCHD_START([--disable-system])
+ dnl Add bridges, ports, etc.
+ AT_CHECK([ovs-vsctl -- ADD_BR([br0]) -- set bridge br0 protocols=[[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13,OpenFlow14,OpenFlow15]] fail-mode=secure -- $1 m4_if([$2], [], [], [| ${PERL} $srcdir/uuidfilt.pl])], [0], [$2])
+])
+
+# OVS_TRAFFIC_VSWITCHD_STOP([WHITELIST], [extra_cmds])
+#
+# Gracefully stops ovs-vswitchd and ovsdb-server, checking their log files
+# for messages with severity WARN or higher and signaling an error if any
+# is present. The optional WHITELIST may contain shell-quoted "sed"
+# commands to delete any warnings that are actually expected, e.g.:
+#
+# OVS_TRAFFIC_VSWITCHD_STOP(["/expected error/d"])
+#
+# 'extra_cmds' are shell commands to be executed afte OVS_VSWITCHD_STOP() is
+# invoked. They can be used to perform additional cleanups such as name space
+# removal.
+m4_define([OVS_TRAFFIC_VSWITCHD_STOP],
+ [AT_CHECK([ovs-vsctl del-br br0])
+ OVS_VSWITCHD_STOP([dnl
+"/netdev_linux.*obtaining netdev stats via vport failed/d
+/dpif_netlink.*Generic Netlink family 'ovs_datapath' does not exist. The Open vSwitch kernel module is probably not loaded./d"])
+ AT_CHECK([:; $2])
+ ])
--- /dev/null
+AT_INIT
+
+AT_COPYRIGHT([Copyright (c) 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/system-userspace-macros.at])
+m4_include([tests/system-common-macros.at])
+
+m4_include([tests/system-traffic.at])