Use Autotest for the Open vSwitch test suite.
authorBen Pfaff <blp@nicira.com>
Mon, 27 Jul 2009 23:40:11 +0000 (16:40 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 29 Jul 2009 19:33:32 +0000 (12:33 -0700)
Autotest doesn't provide a lot of benefit by itself but it does allow us
to easily put a wrapper around each test by using a macro to invoke it.
(To do that with the built-in Automake test framework you need to write
or generate a separate wrapper script for each test, which is a pain.)
The next commit will take advantage of this possibility by adding support
for code coverage analysis.

24 files changed:
.gitignore
Makefile.am
configure.ac
tests/.gitignore
tests/atlocal.in [new file with mode: 0644]
tests/automake.mk
tests/library.at [new file with mode: 0644]
tests/stp.at [new file with mode: 0644]
tests/test-flows.sh [deleted file]
tests/test-stp-ieee802.1d-1998 [deleted file]
tests/test-stp-ieee802.1d-2004-fig17.4 [deleted file]
tests/test-stp-ieee802.1d-2004-fig17.6 [deleted file]
tests/test-stp-ieee802.1d-2004-fig17.7 [deleted file]
tests/test-stp-iol-io-1.1 [deleted file]
tests/test-stp-iol-io-1.2 [deleted file]
tests/test-stp-iol-io-1.4 [deleted file]
tests/test-stp-iol-io-1.5 [deleted file]
tests/test-stp-iol-op-1.1 [deleted file]
tests/test-stp-iol-op-1.4 [deleted file]
tests/test-stp-iol-op-3.1 [deleted file]
tests/test-stp-iol-op-3.3 [deleted file]
tests/test-stp-iol-op-3.4 [deleted file]
tests/test-stp.sh [deleted file]
tests/testsuite.at [new file with mode: 0644]

index 480615a..3230266 100644 (file)
@@ -36,6 +36,7 @@
 /depcomp
 /install-sh
 /missing
+/package.m4
 /stamp-h1
 Module.symvers
 TAGS
index 1b40cde..dccb8cf 100644 (file)
@@ -32,8 +32,6 @@ EXTRA_DIST = INSTALL.bridge \
        INSTALL.OpenFlow \
        INSTALL.SSL \
        INSTALL.XenServer 
-TESTS =
-TESTS_ENVIRONMENT =
 bin_PROGRAMS =
 sbin_PROGRAMS =
 bin_SCRIPTS =
index 27f9da5..1628146 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-AC_PREREQ(2.60)
+AC_PREREQ(2.63)
 AC_INIT(openvswitch, 0.90.3, bugs@openvswitch.org)
 NX_BUILDNR
 AC_CONFIG_SRCDIR([datapath/datapath.c])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([build-aux])
 AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_TESTDIR([tests])
 AM_INIT_AUTOMAKE
 
 AC_PROG_CC
@@ -84,6 +85,7 @@ AC_CONFIG_FILES([Makefile
 datapath/Makefile 
 datapath/linux-2.6/Kbuild
 datapath/linux-2.6/Makefile
-datapath/linux-2.6/Makefile.main])
+datapath/linux-2.6/Makefile.main
+tests/atlocal])
 
 AC_OUTPUT
index 1112503..706aa14 100644 (file)
@@ -8,3 +8,4 @@
 /test-list
 /test-stp
 /test-type-props
+/testsuite
diff --git a/tests/atlocal.in b/tests/atlocal.in
new file mode 100644 (file)
index 0000000..1328d4a
--- /dev/null
@@ -0,0 +1,2 @@
+# -*- shell-script -*-
+PERL='@PERL@'
index e251317..6dc109d 100644 (file)
@@ -1,40 +1,68 @@
-TESTS += tests/test-classifier
+EXTRA_DIST += \
+       $(TESTSUITE_AT) \
+       $(TESTSUITE) \
+       tests/atlocal.in \
+       $(srcdir)/package.m4 \
+       $(srcdir)/tests/testsuite
+TESTSUITE_AT = \
+       tests/testsuite.at \
+       tests/library.at \
+       tests/stp.at
+TESTSUITE = $(srcdir)/tests/testsuite
+DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
+
+check-local: tests/atconfig tests/atlocal $(TESTSUITE)
+       $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH='utilities:vswitchd:tests' $(TESTSUITEFLAGS)
+
+clean-local:
+       test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
+
+AUTOM4TE = autom4te
+AUTOTEST = $(AUTOM4TE) --language=autotest
+$(TESTSUITE): package.m4 $(TESTSUITE_AT)
+       $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+       mv $@.tmp $@
+
+# The `:;' works around a Bash 3.2 bug when the output is not writeable.
+$(srcdir)/package.m4: $(top_srcdir)/configure.ac
+       :;{ \
+         echo '# Signature of the current package.' && \
+         echo 'm4_define([AT_PACKAGE_NAME],      [@PACKAGE_NAME@])' && \
+         echo 'm4_define([AT_PACKAGE_TARNAME],   [@PACKAGE_TARNAME@])' && \
+         echo 'm4_define([AT_PACKAGE_VERSION],   [@PACKAGE_VERSION@])' && \
+         echo 'm4_define([AT_PACKAGE_STRING],    [@PACKAGE_STRING@])' && \
+         echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
+       } >'$(srcdir)/package.m4'
+
 noinst_PROGRAMS += tests/test-classifier
 tests_test_classifier_SOURCES = tests/test-classifier.c
 tests_test_classifier_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-csum
 noinst_PROGRAMS += tests/test-csum
 tests_test_csum_SOURCES = tests/test-csum.c
 tests_test_csum_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-flows.sh
 noinst_PROGRAMS += tests/test-flows
 tests_test_flows_SOURCES = tests/test-flows.c
 tests_test_flows_LDADD = lib/libopenvswitch.a
-dist_check_SCRIPTS = tests/test-flows.sh tests/flowgen.pl
+dist_check_SCRIPTS = tests/flowgen.pl
 
-TESTS += tests/test-hash
 noinst_PROGRAMS += tests/test-hash
 tests_test_hash_SOURCES = tests/test-hash.c
 tests_test_hash_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-hmap
 noinst_PROGRAMS += tests/test-hmap
 tests_test_hmap_SOURCES = tests/test-hmap.c
 tests_test_hmap_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-list
 noinst_PROGRAMS += tests/test-list
 tests_test_list_SOURCES = tests/test-list.c
 tests_test_list_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-sha1
 noinst_PROGRAMS += tests/test-sha1
 tests_test_sha1_SOURCES = tests/test-sha1.c
 tests_test_sha1_LDADD = lib/libopenvswitch.a
 
-TESTS += tests/test-type-props
 noinst_PROGRAMS += tests/test-type-props
 tests_test_type_props_SOURCES = tests/test-type-props.c
 
@@ -42,30 +70,10 @@ noinst_PROGRAMS += tests/test-dhcp-client
 tests_test_dhcp_client_SOURCES = tests/test-dhcp-client.c
 tests_test_dhcp_client_LDADD = lib/libopenvswitch.a $(FAULT_LIBS)
 
-TESTS += tests/test-stp.sh
-EXTRA_DIST += tests/test-stp.sh
 noinst_PROGRAMS += tests/test-stp
-
 tests_test_stp_SOURCES = tests/test-stp.c
 tests_test_stp_LDADD = lib/libopenvswitch.a
-stp_files = \
-       tests/test-stp-ieee802.1d-1998 \
-       tests/test-stp-ieee802.1d-2004-fig17.4 \
-       tests/test-stp-ieee802.1d-2004-fig17.6 \
-       tests/test-stp-ieee802.1d-2004-fig17.7 \
-       tests/test-stp-iol-op-1.1 \
-       tests/test-stp-iol-op-1.4 \
-       tests/test-stp-iol-op-3.1 \
-       tests/test-stp-iol-op-3.3 \
-       tests/test-stp-iol-io-1.1 \
-       tests/test-stp-iol-io-1.2 \
-       tests/test-stp-iol-io-1.4 \
-       tests/test-stp-iol-io-1.5
-TESTS_ENVIRONMENT += stp_files='$(stp_files)'
-
-EXTRA_DIST += $(stp_files)
-
-TESTS += tests/test-vconn
+
 noinst_PROGRAMS += tests/test-vconn
 tests_test_vconn_SOURCES = tests/test-vconn.c
 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
diff --git a/tests/library.at b/tests/library.at
new file mode 100644 (file)
index 0000000..c703241
--- /dev/null
@@ -0,0 +1,39 @@
+AT_BANNER([library unit tests])
+
+AT_SETUP([test flow extractor])
+AT_CHECK([$PERL `which flowgen.pl` >/dev/null 3>flows 4>pcap])
+AT_CHECK([test-flows <flows 3<pcap], [0], [checked 247 packets, 0 errors
+])
+AT_CLEANUP
+
+AT_SETUP([test TCP/IP checksumming])
+AT_CHECK([test-csum], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test flow classifier])
+AT_CHECK([test-classifier], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test hash functions])
+AT_CHECK([test-hash], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test hash map])
+AT_CHECK([test-hmap], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test linked lists])
+AT_CHECK([test-list], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test SHA-1])
+AT_CHECK([test-sha1], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test type properties])
+AT_CHECK([test-type-props], [0], [ignore])
+AT_CLEANUP
+
+AT_SETUP([test vconn library])
+AT_CHECK([test-vconn], [0], [ignore])
+AT_CLEANUP
diff --git a/tests/stp.at b/tests/stp.at
new file mode 100644 (file)
index 0000000..4e25af7
--- /dev/null
@@ -0,0 +1,303 @@
+AT_BANNER([Spanning Tree Protocol unit tests])
+
+AT_SETUP([STP example from IEEE 802.1D-1998])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-ieee802.1d-1998],
+[bridge 0 0x42 = a b
+bridge 1 0x97 = c:5 a d:5
+bridge 2 0x45 = b e
+bridge 3 0x57 = b:5 e:5
+bridge 4 0x83 = a:5 e:5
+run 1000
+check 0 = root
+check 1 = F F:10 F
+check 2 = F:10 B
+check 3 = F:5 F
+check 4 = F:5 B
+])
+AT_CHECK([test-stp test-stp-ieee802.1d-1998])
+AT_CLEANUP
+
+AT_SETUP([STP example from IEEE 802.1D-2004 figures 17.4 and 17.5])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-ieee802.1d-2004-fig17.4],
+[bridge 0 0x111 = a b e c
+bridge 1 0x222 = a b d f
+bridge 2 0x333 = c d l j h g
+bridge 3 0x444 = e f n m k i
+bridge 4 0x555 = g i 0 0
+bridge 5 0x666 = h k 0 0
+bridge 6 0x777 = j m 0 0
+bridge 7 0x888 = l n 0 0
+run 1000
+check 0 = root
+check 1 = F:10 B F F
+check 2 = F:10 B F F F F
+check 3 = F:10 B F F F F
+check 4 = F:20 B F F
+check 5 = F:20 B F F
+check 6 = F:20 B F F
+check 7 = F:20 B F F
+
+# Now connect two ports of bridge 7 to the same LAN.
+bridge 7 = l n o o
+# Same results except for bridge 7:
+run 1000
+check 0 = root
+check 1 = F:10 B F F
+check 2 = F:10 B F F F F
+check 3 = F:10 B F F F F
+check 4 = F:20 B F F
+check 5 = F:20 B F F
+check 6 = F:20 B F F
+check 7 = F:20 B F B
+])
+AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.4])
+AT_CLEANUP
+
+AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.6])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-ieee802.1d-2004-fig17.6],
+[bridge 0 0x111 = a b l
+bridge 1 0x222 = b c d
+bridge 2 0x333 = d e f
+bridge 3 0x444 = f g h
+bridge 4 0x555 = j h i
+bridge 5 0x666 = l j k
+run 1000
+check 0 = root
+check 1 = F:10 F F
+check 2 = F:20 F F
+check 3 = F:30 F B
+check 4 = F:20 F F
+check 5 = F:10 F F
+])
+AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.6])
+AT_CLEANUP
+
+AT_SETUP([STP example from IEEE 802.1D-2004 figure 17.7])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-ieee802.1d-2004-fig17.7],
+[bridge 0 0xaa = b
+bridge 1 0x111 = a b d f h g e c
+bridge 2 0x222 = g h j l n m k i
+run 1000
+check 0 = root
+check 1 = F F:10 F F F F F F
+check 2 = B F:20 F F F F F F
+
+# This is not the port priority change described in that figure,
+# but I don't understand what port priority change would cause
+# that change.
+bridge 2 = g X j l n m k i
+run 1000
+check 0 = root
+check 1 = F F:10 F F F F F F
+check 2 = F:20 D F F F F F F
+])
+AT_CHECK([test-stp test-stp-ieee802.1d-2004-fig17.7])
+AT_CLEANUP
+
+AT_SETUP([STP.io.1.1: Link Failure])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-io-1.1],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Interoperability Test Suite
+# Version 1.5":
+# 
+# STP.io.1.1: Link Failure
+bridge 0 0x111 = a b c
+bridge 1 0x222 = a b c
+run 1000
+check 0 = root
+check 1 = F:10 B B
+bridge 1 = 0 _ _
+run 1000
+check 0 = root
+check 1 = F F:10 B
+bridge 1 = X _ _
+run 1000
+check 0 = root
+check 1 = D F:10 B
+bridge 1 = _ 0 _
+run 1000
+check 0 = root
+check 1 = D F F:10
+bridge 1 = _ X _
+run 1000
+check 0 = root
+check 1 = D D F:10
+])
+AT_CHECK([test-stp test-stp-iol-io-1.1])
+AT_CLEANUP
+
+AT_SETUP([STP.io.1.2: Repeated Network])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-io-1.2],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Interoperability Test Suite
+# Version 1.5":
+# STP.io.1.2: Repeated Network
+bridge 0 0x111 = a a
+bridge 1 0x222 = a a
+run 1000
+check 0 = rootid:0x111 F B
+check 1 = rootid:0x111 F:10 B
+bridge 1 = a^0x90 _
+run 1000
+check 0 = rootid:0x111 F B
+check 1 = rootid:0x111 B F:10
+])
+AT_CHECK([test-stp test-stp-iol-io-1.2])
+AT_CLEANUP
+
+AT_SETUP([STP.io.1.4: Network Initialization])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-io-1.4],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Interoperability Test Suite
+# Version 1.5":
+# STP.io.1.4: Network Initialization
+bridge 0 0x111 = a b c
+bridge 1 0x222 = b d e
+bridge 2 0x333 = a d f
+bridge 3 0x444 = c e f
+run 1000
+check 0 = root
+check 1 = F:10 F F
+check 2 = F:10 B F
+check 3 = F:10 B B
+])
+AT_CHECK([test-stp test-stp-iol-io-1.4])
+AT_CLEANUP
+
+AT_SETUP([STP.io.1.5: Topology Change])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-io-1.5],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Interoperability Test Suite
+# Version 1.5":
+# STP.io.1.5: Topology Change
+bridge 0 0x111 = a b d c
+bridge 1 0x222 = a b f e
+bridge 2 0x333 = c d g h
+bridge 3 0x444 = e f g h
+run 1000
+check 0 = root
+check 1 = F:10 B F F
+check 2 = B F:10 F F
+check 3 = B F:20 B B
+bridge 1^0x7000
+run 1000
+check 0 = F:10 B F F
+check 1 = root
+check 2 = B F:20 B B
+check 3 = B F:10 F F
+bridge 2^0x6000
+run 1000
+check 0 = F F B F:10
+check 1 = F:20 B B B
+check 2 = root
+check 3 = F F F:10 B
+bridge 3^0x5000
+run 1000
+check 0 = B B B F:20
+check 1 = F F B F:10
+check 2 = F F F:10 B
+check 3 = root
+bridge 0^0x4000
+bridge 1^0x4001
+bridge 2^0x4002
+bridge 3^0x4003
+run 1000
+check 0 = root
+check 1 = F:10 B F F
+check 2 = B F:10 F F
+check 3 = B F:20 B B
+])
+AT_CHECK([test-stp test-stp-iol-io-1.5])
+AT_CLEANUP
+
+AT_SETUP([STP.op.1.1 and STP.op.1.2])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-op-1.1],
+[# This test file approximates the following tests from "Bridge
+# Functions Consortium Spanning Tree Protocol Operations Test Suite
+# Version 2.3":
+# Test STP.op.1.1: Root ID Initialized to Bridge ID
+# Test STP.op.1.2: Root Path Cost Initialized to Zero
+bridge 0 0x123 =
+check 0 = root
+])
+AT_CHECK([test-stp test-stp-iol-op-1.1])
+AT_CLEANUP
+
+AT_SETUP([STP.op.1.4: All Ports Initialized to Designated Ports])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-op-1.4],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Protocol Operations Test Suite
+# Version 2.3":
+# Test STP.op.1.4: All Ports Initialized to Designated Ports
+bridge 0 0x123 = a b c d e f
+check 0 = Li Li Li Li Li Li
+run 1000
+check 0 = F F F F F F
+])
+AT_CHECK([test-stp test-stp-iol-op-1.4])
+AT_CLEANUP
+
+AT_SETUP([STP.op.3.1: Root Bridge Selection: Root ID Values])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-op-3.1],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Protocol Operations Test Suite
+# Version 2.3":
+# Test STP.op.3.1: Root Bridge Selection: Root ID Values
+bridge 0 0x111 = a
+bridge 1 0x222 = a
+check 0 = rootid:0x111 Li
+check 1 = rootid:0x222 Li
+run 1000
+check 0 = rootid:0x111 root
+check 1 = rootid:0x111 F:10
+])
+AT_CHECK([test-stp test-stp-iol-op-3.1])
+AT_CLEANUP
+
+AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-op-3.3],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Protocol Operations Test Suite
+# Version 2.3":
+# Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
+bridge 0 0x333^0x6000 = a
+bridge 1 0x222^0x7000 = b
+bridge 2 0x111 = a b
+run 1000
+check 0 = rootid:0x333^0x6000 root
+check 1 = rootid:0x333^0x6000 F:20
+check 2 = rootid:0x333^0x6000 F:10 F
+])
+AT_CHECK([test-stp test-stp-iol-op-3.3])
+AT_CLEANUP
+
+AT_SETUP([STP.op.3.3: Root Bridge Selection: Bridge ID Values])
+AT_KEYWORDS([STP])
+AT_DATA([test-stp-iol-op-3.4],
+[# This test file approximates the following test from "Bridge
+# Functions Consortium Spanning Tree Protocol Operations Test Suite
+# Version 2.3":
+# Test STP.op.3.3: Root Bridge Selection: Bridge ID Values
+bridge 0 0x333^0x6000 = a
+bridge 1 0x222^0x7000 = b
+bridge 2 0x111 = a b
+run 1000
+check 0 = rootid:0x333^0x6000 root
+check 1 = rootid:0x333^0x6000 F:20
+check 2 = rootid:0x333^0x6000 F:10 F
+])
+AT_CHECK([test-stp test-stp-iol-op-3.4])
+AT_CLEANUP
+
diff --git a/tests/test-flows.sh b/tests/test-flows.sh
deleted file mode 100755 (executable)
index 833f28e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#! /bin/sh -e
-
-# Copyright (c) 2009 Nicira Networks.
-#
-# 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.
-
-srcdir=`cd $srcdir && pwd`
-trap 'rm -f flows$$ pcap$$ out$$' 0 1 2 13 15
-cd tests
-"$srcdir"/tests/flowgen.pl >/dev/null 3>flows$$ 4>pcap$$
-./test-flows <flows$$ 3<pcap$$ >out$$ || true
-diff -u - out$$ <<EOF
-checked 247 packets, 0 errors
-EOF
diff --git a/tests/test-stp-ieee802.1d-1998 b/tests/test-stp-ieee802.1d-1998
deleted file mode 100644 (file)
index f1982a0..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# This is the STP example from IEEE 802.1D-1998.
-bridge 0 0x42 = a b
-bridge 1 0x97 = c:5 a d:5
-bridge 2 0x45 = b e
-bridge 3 0x57 = b:5 e:5
-bridge 4 0x83 = a:5 e:5
-run 1000
-check 0 = root
-check 1 = F F:10 F
-check 2 = F:10 B
-check 3 = F:5 F
-check 4 = F:5 B
diff --git a/tests/test-stp-ieee802.1d-2004-fig17.4 b/tests/test-stp-ieee802.1d-2004-fig17.4
deleted file mode 100644 (file)
index 1f70863..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# This is the STP example from IEEE 802.1D-2004 figures 17.4 and 17.5.
-bridge 0 0x111 = a b e c
-bridge 1 0x222 = a b d f
-bridge 2 0x333 = c d l j h g
-bridge 3 0x444 = e f n m k i
-bridge 4 0x555 = g i 0 0
-bridge 5 0x666 = h k 0 0
-bridge 6 0x777 = j m 0 0
-bridge 7 0x888 = l n 0 0
-run 1000
-check 0 = root
-check 1 = F:10 B F F
-check 2 = F:10 B F F F F
-check 3 = F:10 B F F F F
-check 4 = F:20 B F F
-check 5 = F:20 B F F
-check 6 = F:20 B F F
-check 7 = F:20 B F F
-
-# Now connect two ports of bridge 7 to the same LAN.
-bridge 7 = l n o o
-# Same results except for bridge 7:
-run 1000
-check 0 = root
-check 1 = F:10 B F F
-check 2 = F:10 B F F F F
-check 3 = F:10 B F F F F
-check 4 = F:20 B F F
-check 5 = F:20 B F F
-check 6 = F:20 B F F
-check 7 = F:20 B F B
diff --git a/tests/test-stp-ieee802.1d-2004-fig17.6 b/tests/test-stp-ieee802.1d-2004-fig17.6
deleted file mode 100644 (file)
index 6ed5917..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# This is the STP example from IEEE 802.1D-2004 figure 17.6.
-bridge 0 0x111 = a b l
-bridge 1 0x222 = b c d
-bridge 2 0x333 = d e f
-bridge 3 0x444 = f g h
-bridge 4 0x555 = j h i
-bridge 5 0x666 = l j k
-run 1000
-check 0 = root
-check 1 = F:10 F F
-check 2 = F:20 F F
-check 3 = F:30 F B
-check 4 = F:20 F F
-check 5 = F:10 F F
diff --git a/tests/test-stp-ieee802.1d-2004-fig17.7 b/tests/test-stp-ieee802.1d-2004-fig17.7
deleted file mode 100644 (file)
index daa0cdf..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# This is the STP example from IEEE 802.1D-2004 figure 17.7.
-bridge 0 0xaa = b
-bridge 1 0x111 = a b d f h g e c
-bridge 2 0x222 = g h j l n m k i
-run 1000
-check 0 = root
-check 1 = F F:10 F F F F F F
-check 2 = B F:20 F F F F F F
-
-# This is not the port priority change described in that figure,
-# but I don't understand what port priority change would cause
-# that change.
-bridge 2 = g X j l n m k i
-run 1000
-check 0 = root
-check 1 = F F:10 F F F F F F
-check 2 = F:20 D F F F F F F
diff --git a/tests/test-stp-iol-io-1.1 b/tests/test-stp-iol-io-1.1
deleted file mode 100644 (file)
index 186d6c4..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Interoperability Test Suite
-# Version 1.5":
-# STP.io.1.1: Link Failure
-bridge 0 0x111 = a b c
-bridge 1 0x222 = a b c
-run 1000
-check 0 = root
-check 1 = F:10 B B
-bridge 1 = 0 _ _
-run 1000
-check 0 = root
-check 1 = F F:10 B
-bridge 1 = X _ _
-run 1000
-check 0 = root
-check 1 = D F:10 B
-bridge 1 = _ 0 _
-run 1000
-check 0 = root
-check 1 = D F F:10
-bridge 1 = _ X _
-run 1000
-check 0 = root
-check 1 = D D F:10
diff --git a/tests/test-stp-iol-io-1.2 b/tests/test-stp-iol-io-1.2
deleted file mode 100644 (file)
index 285bbd8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Interoperability Test Suite
-# Version 1.5":
-# STP.io.1.2: Repeated Network
-bridge 0 0x111 = a a
-bridge 1 0x222 = a a
-run 1000
-check 0 = rootid:0x111 F B
-check 1 = rootid:0x111 F:10 B
-bridge 1 = a^0x90 _
-run 1000
-check 0 = rootid:0x111 F B
-check 1 = rootid:0x111 B F:10
-
diff --git a/tests/test-stp-iol-io-1.4 b/tests/test-stp-iol-io-1.4
deleted file mode 100644 (file)
index 0065aaf..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Interoperability Test Suite
-# Version 1.5":
-# STP.io.1.4: Network Initialization
-bridge 0 0x111 = a b c
-bridge 1 0x222 = b d e
-bridge 2 0x333 = a d f
-bridge 3 0x444 = c e f
-run 1000
-check 0 = root
-check 1 = F:10 F F
-check 2 = F:10 B F
-check 3 = F:10 B B
diff --git a/tests/test-stp-iol-io-1.5 b/tests/test-stp-iol-io-1.5
deleted file mode 100644 (file)
index 285d29d..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Interoperability Test Suite
-# Version 1.5":
-# STP.io.1.5: Topology Change
-bridge 0 0x111 = a b d c
-bridge 1 0x222 = a b f e
-bridge 2 0x333 = c d g h
-bridge 3 0x444 = e f g h
-run 1000
-check 0 = root
-check 1 = F:10 B F F
-check 2 = B F:10 F F
-check 3 = B F:20 B B
-bridge 1^0x7000
-run 1000
-check 0 = F:10 B F F
-check 1 = root
-check 2 = B F:20 B B
-check 3 = B F:10 F F
-bridge 2^0x6000
-run 1000
-check 0 = F F B F:10
-check 1 = F:20 B B B
-check 2 = root
-check 3 = F F F:10 B
-bridge 3^0x5000
-run 1000
-check 0 = B B B F:20
-check 1 = F F B F:10
-check 2 = F F F:10 B
-check 3 = root
-bridge 0^0x4000
-bridge 1^0x4001
-bridge 2^0x4002
-bridge 3^0x4003
-run 1000
-check 0 = root
-check 1 = F:10 B F F
-check 2 = B F:10 F F
-check 3 = B F:20 B B
diff --git a/tests/test-stp-iol-op-1.1 b/tests/test-stp-iol-op-1.1
deleted file mode 100644 (file)
index 8432bf3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# This test file approximates the following tests from "Bridge
-# Functions Consortium Spanning Tree Protocol Operations Test Suite
-# Version 2.3":
-# Test STP.op.1.1 ­ Root ID Initialized to Bridge ID
-# Test STP.op.1.2 ­ Root Path Cost Initialized to Zero
-bridge 0 0x123 =
-check 0 = root
diff --git a/tests/test-stp-iol-op-1.4 b/tests/test-stp-iol-op-1.4
deleted file mode 100644 (file)
index 6a12116..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Protocol Operations Test Suite
-# Version 2.3":
-# Test STP.op.1.4 ­ All Ports Initialized to Designated Ports
-bridge 0 0x123 = a b c d e f
-check 0 = Li Li Li Li Li Li
-run 1000
-check 0 = F F F F F F
diff --git a/tests/test-stp-iol-op-3.1 b/tests/test-stp-iol-op-3.1
deleted file mode 100644 (file)
index 3e1099c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Protocol Operations Test Suite
-# Version 2.3":
-# Test STP.op.3.1 ­ Root Bridge Selection: Root ID Values
-bridge 0 0x111 = a
-bridge 1 0x222 = a
-check 0 = rootid:0x111 Li
-check 1 = rootid:0x222 Li
-run 1000
-check 0 = rootid:0x111 root
-check 1 = rootid:0x111 F:10
diff --git a/tests/test-stp-iol-op-3.3 b/tests/test-stp-iol-op-3.3
deleted file mode 100644 (file)
index 2bcd45e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Protocol Operations Test Suite
-# Version 2.3":
-# Test STP.op.3.3 ­ Root Bridge Selection: Bridge ID Values
-bridge 0 0x333^0x6000 = a
-bridge 1 0x222^0x7000 = b
-bridge 2 0x111 = a b
-run 1000
-check 0 = rootid:0x333^0x6000 root
-check 1 = rootid:0x333^0x6000 F:20
-check 2 = rootid:0x333^0x6000 F:10 F
diff --git a/tests/test-stp-iol-op-3.4 b/tests/test-stp-iol-op-3.4
deleted file mode 100644 (file)
index 2bcd45e..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# This test file approximates the following test from "Bridge
-# Functions Consortium Spanning Tree Protocol Operations Test Suite
-# Version 2.3":
-# Test STP.op.3.3 ­ Root Bridge Selection: Bridge ID Values
-bridge 0 0x333^0x6000 = a
-bridge 1 0x222^0x7000 = b
-bridge 2 0x111 = a b
-run 1000
-check 0 = rootid:0x333^0x6000 root
-check 1 = rootid:0x333^0x6000 F:20
-check 2 = rootid:0x333^0x6000 F:10 F
diff --git a/tests/test-stp.sh b/tests/test-stp.sh
deleted file mode 100755 (executable)
index 4f194ac..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#! /bin/sh
-
-# Copyright (c) 2008 Nicira Networks.
-#
-# 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.
-
-set -e
-progress=
-for d in ${stp_files}; do
-    echo "Testing $d..."
-    $SUPERVISOR ./tests/test-stp ${srcdir}/$d
-done
diff --git a/tests/testsuite.at b/tests/testsuite.at
new file mode 100644 (file)
index 0000000..0ad34c2
--- /dev/null
@@ -0,0 +1,20 @@
+AT_INIT
+
+AT_COPYRIGHT([Copyright (c) 2009 Nicira Networks.
+
+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.])
+
+AT_TESTED([ovs-vswitchd])
+
+m4_include([tests/library.at])
+m4_include([tests/stp.at])