aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-06-23 09:50:47 -0700
committerBen Pfaff <blp@nicira.com>2010-06-23 09:50:47 -0700
commit254604d84b48fde8e19299a10be7145adee52f98 (patch)
tree70f96da5286568459125f6d21eaaaeca32372904 /tests
parentdcf8b97b508423dac9a6050f7f42e99492f3059d (diff)
tests: Fix occasional failure of "self-linking idl, inconsistent ops" test.
Commit 97f7803 made this test nondeterministic: depending on the ordering of the random row UUIDs, the error message might mention one of two different nonexistent rows that are referenced. This commit fixes the problem by accepting either one of the two correct rows. Previous related fixes took a different approach, of instead making the test deterministic. But now I think that that is not as good an idea, because we need to be able to test that OVSDB works whether the query is deterministic or not. (Of course, every OVSDB test is nondeterministic, since the UUIDs are random. This test was just more nondeterministic than most.)
Diffstat (limited to 'tests')
-rw-r--r--tests/ovsdb-idl.at16
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
index 9223de3b..b184e9d9 100644
--- a/tests/ovsdb-idl.at
+++ b/tests/ovsdb-idl.at
@@ -1,6 +1,7 @@
AT_BANNER([OVSDB -- interface description language (IDL)])
-# OVSDB_CHECK_IDL(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS])
+# OVSDB_CHECK_IDL(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
+# [FILTER])
#
# Creates a database with a schema derived from idltest.ovsidl, runs
# each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
@@ -11,7 +12,8 @@ AT_BANNER([OVSDB -- interface description language (IDL)])
# 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.
+# marker. If FILTER is supplied then the output is also filtered
+# through the specified program.
#
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
m4_define([OVSDB_CHECK_IDL],
@@ -24,8 +26,8 @@ m4_define([OVSDB_CHECK_IDL],
[AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
[0], [stdout], [ignore], [kill `cat pid`])
- AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl], [0], [$4], [],
- [kill `cat pid`])
+ AT_CHECK([sort stdout | perl $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
+ [0], [$4], [], [kill `cat pid`])
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP])
@@ -269,14 +271,16 @@ OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
003: i=1 k=1 ka=[] l2= uuid=<2>
003: i=2 k=1 ka=[] l2= uuid=<3>
-004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
+004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
006: {"error":null,"result":[{"count":1}]}
007: i=1 k=1 ka=[] l2= uuid=<2>
008: {"error":null,"result":[{"count":1}]}
009: empty
010: done
-]])
+]],
+ [],
+ [[sed -e '/004:/s/row <[23]> references/row <x> references/']])
OVSDB_CHECK_IDL([self-linking idl, sets],
[],