From 2096903b45d28594c04b47b592a5b7e62b5e1ccc Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 20 Jun 2011 16:17:44 -0700 Subject: 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. --- tests/ovsdb-idl.at | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests/ovsdb-idl.at') 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", -- cgit v1.2.1