summaryrefslogtreecommitdiff
path: root/tests/ovsdb-server.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-03-16 16:31:52 -0700
committerBen Pfaff <blp@nicira.com>2010-03-17 14:24:56 -0700
commit9ff373db19ef8e1e93f60a4da26bdaefdbb76ede (patch)
tree76b0caad6a993e8400ea810ec18a122335e9548e /tests/ovsdb-server.at
parent939ff2674caa93d15b607bc514932533490ff2a0 (diff)
downloadopenvswitch-9ff373db19ef8e1e93f60a4da26bdaefdbb76ede.tar.gz
ovsdb: Add tests for transient ovsdb-server.
This variant of the ovsdb execution tests runs each transaction against a separately started ovsdb-server. The idea is that this should help to ferret out any differences between what ovsdb-server has in memory and what actually gets committed to disk. There should not be any such differences, but we need to test for that.
Diffstat (limited to 'tests/ovsdb-server.at')
-rw-r--r--tests/ovsdb-server.at38
1 files changed, 37 insertions, 1 deletions
diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at
index 8d81e1123..c32bc3a0d 100644
--- a/tests/ovsdb-server.at
+++ b/tests/ovsdb-server.at
@@ -21,7 +21,7 @@ m4_define([OVSDB_SERVER_SHUTDOWN],
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
m4_define([OVSDB_CHECK_EXECUTION],
[AT_SETUP([$1])
- AT_KEYWORDS([ovsdb server positive $5])
+ AT_KEYWORDS([ovsdb server positive unix $5])
AT_DATA([schema], [$2
])
AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
@@ -128,3 +128,39 @@ cat stdout >> output
AT_CLEANUP])
EXECUTION_EXAMPLES
+
+AT_BANNER([OVSDB -- transactions on transient ovsdb-server])
+
+# OVSDB_CHECK_EXECUTION(TITLE, SCHEMA, TRANSACTIONS, OUTPUT, [KEYWORDS])
+#
+# Creates a database with the given SCHEMA and runs each of the
+# TRANSACTIONS (which should be a quoted list of quoted strings)
+# against it with ovsdb-client one at a time. Each ovsdb-client
+# is run against a separately started ovsdb-server that executes
+# only that single transaction. (The idea is that this should
+# help to ferret out any differences between what ovsdb-server has
+# in memory and what actually gets committed to disk.)
+#
+# Checks that the overall output is OUTPUT, but UUIDs in the output
+# are replaced by markers of the form <N> where N is a number. The
+# first unique UUID is replaced by <0>, the next by <1>, and so on.
+# If a given UUID appears more than once it is always replaced by the
+# same marker.
+#
+# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
+m4_define([OVSDB_CHECK_EXECUTION],
+ [AT_SETUP([$1])
+ AT_KEYWORDS([ovsdb server positive transient $5])
+ AT_DATA([schema], [$2
+])
+ AT_CHECK([ovsdb-tool create db schema], [0], [stdout], [ignore])
+ m4_foreach([txn], [$3],
+ [AT_DATA([txnfile], [ovsdb-client transact unix:socket 'txn'
+])
+ AT_CHECK([ovsdb-server --remote=punix:socket --unixctl=$PWD/unixctl db --run="sh txnfile"], [0], [stdout], [ignore])
+ cat stdout >> output
+])
+ AT_CHECK([perl $srcdir/uuidfilt.pl output], [0], [$4], [ignore])
+ AT_CLEANUP])
+
+EXECUTION_EXAMPLES