summaryrefslogtreecommitdiff
path: root/tests/ovsdb-idl.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-20 16:17:44 -0700
committerBen Pfaff <blp@nicira.com>2011-06-21 15:09:56 -0700
commit2096903b45d28594c04b47b592a5b7e62b5e1ccc (patch)
treee73d3727fbb85a584f4a9c49476f92f97338df99 /tests/ovsdb-idl.at
parente2eed6a7581193da43210a26ad182fb2a697eaf5 (diff)
downloadopenvswitch-2096903b45d28594c04b47b592a5b7e62b5e1ccc.tar.gz
ovsdb-idl: Plug hole in state machine.
The state machine didn't have a proper state for "not yet committed or aborted", which meant that destroying an ovsdb_idl_txn without committing or aborting it caused a segfault. This fixes the problem by adding a new state TXN_UNCOMMITTED to the state machine. This is related to commit 79554078d "ovsdb-idl: Fix bad logic in ovsdb_idl_txn_commit() state transitions", which fixed a related bug. Bug #2438.
Diffstat (limited to 'tests/ovsdb-idl.at')
-rw-r--r--tests/ovsdb-idl.at28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at
index 5956f72db..f9c8286f7 100644
--- a/tests/ovsdb-idl.at
+++ b/tests/ovsdb-idl.at
@@ -221,6 +221,34 @@ OVSDB_CHECK_IDL([simple idl, increment operation],
003: done
]])
+OVSDB_CHECK_IDL([simple idl, aborting],
+ [['["idltest",
+ {"op": "insert",
+ "table": "simple",
+ "row": {}}]']],
+ [['set 0 r 2.0, abort' \
+'+set 0 b 1']],
+ [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
+001: commit, status=aborted
+002: commit, status=success
+003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
+004: done
+]])
+
+OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
+ [['["idltest",
+ {"op": "insert",
+ "table": "simple",
+ "row": {}}]']],
+ [['set 0 r 2.0, destroy' \
+'+set 0 b 1']],
+ [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
+001: destroy
+002: commit, status=success
+003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
+004: done
+]])
+
OVSDB_CHECK_IDL([self-linking idl, consistent ops],
[],
[['["idltest",