2009-12-02 11:26:15 -08:00
|
|
|
AT_BANNER([OVSDB -- interface description language (IDL)])
|
|
|
|
|
|
2013-02-08 12:37:18 -08:00
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
2011-09-21 10:43:03 -07:00
|
|
|
# OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
|
|
|
|
|
# [FILTER])
|
2009-12-02 11:26:15 -08:00
|
|
|
#
|
|
|
|
|
# Creates a database with a schema derived from idltest.ovsidl, runs
|
|
|
|
|
# each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
|
|
|
|
|
# and runs "test-ovsdb idl" passing each of the TRANSACTIONS along.
|
|
|
|
|
#
|
|
|
|
|
# Checks that the overall output is OUTPUT. Before comparison, the
|
|
|
|
|
# output is sorted (using "sort") and 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
|
2010-06-23 09:50:47 -07:00
|
|
|
# marker. If FILTER is supplied then the output is also filtered
|
|
|
|
|
# through the specified program.
|
2009-12-02 11:26:15 -08:00
|
|
|
#
|
|
|
|
|
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
|
2011-09-21 10:43:03 -07:00
|
|
|
m4_define([OVSDB_CHECK_IDL_C],
|
|
|
|
|
[AT_SETUP([$1 - C])
|
2009-12-02 11:26:15 -08:00
|
|
|
AT_KEYWORDS([ovsdb server idl positive $5])
|
2013-02-08 12:37:18 -08:00
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
2010-02-01 14:04:25 -08:00
|
|
|
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
2010-01-07 15:52:58 -08:00
|
|
|
[0], [stdout], [ignore])
|
2012-08-14 13:18:03 -07:00
|
|
|
AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
|
2009-12-02 11:26:15 -08:00
|
|
|
m4_if([$2], [], [],
|
2010-02-02 14:16:06 -08:00
|
|
|
[AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
|
2011-09-21 10:43:03 -07:00
|
|
|
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
|
2010-02-02 14:16:06 -08:00
|
|
|
[0], [stdout], [ignore], [kill `cat pid`])
|
2013-04-22 22:20:07 +09:00
|
|
|
AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
|
2010-06-23 09:50:47 -07:00
|
|
|
[0], [$4], [], [kill `cat pid`])
|
2010-02-02 14:16:06 -08:00
|
|
|
OVSDB_SERVER_SHUTDOWN
|
2009-12-02 11:26:15 -08:00
|
|
|
AT_CLEANUP])
|
|
|
|
|
|
2011-09-21 10:43:03 -07:00
|
|
|
# same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
|
|
|
|
|
m4_define([OVSDB_CHECK_IDL_PY],
|
|
|
|
|
[AT_SETUP([$1 - Python])
|
|
|
|
|
AT_SKIP_IF([test $HAVE_PYTHON = no])
|
|
|
|
|
AT_KEYWORDS([ovsdb server idl positive Python $5])
|
2013-02-08 12:37:18 -08:00
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
2011-09-21 10:43:03 -07:00
|
|
|
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
|
|
|
|
[0], [stdout], [ignore])
|
2012-08-14 13:18:03 -07:00
|
|
|
AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
|
2011-09-21 10:43:03 -07:00
|
|
|
m4_if([$2], [], [],
|
|
|
|
|
[AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore], [kill `cat pid`])])
|
|
|
|
|
AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
|
|
|
|
|
[0], [stdout], [ignore], [kill `cat pid`])
|
2013-04-22 22:20:07 +09:00
|
|
|
AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
|
2011-09-21 10:43:03 -07:00
|
|
|
[0], [$4], [], [kill `cat pid`])
|
|
|
|
|
OVSDB_SERVER_SHUTDOWN
|
|
|
|
|
AT_CLEANUP])
|
|
|
|
|
|
2012-09-27 18:28:08 +09:00
|
|
|
# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
|
|
|
|
|
m4_define([OVSDB_CHECK_IDL_TCP_PY],
|
|
|
|
|
[AT_SETUP([$1 - Python tcp])
|
|
|
|
|
AT_SKIP_IF([test $HAVE_PYTHON = no])
|
|
|
|
|
AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
|
2013-02-08 12:37:18 -08:00
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
2013-04-03 13:30:18 -05:00
|
|
|
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
|
2012-09-27 18:28:08 +09:00
|
|
|
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
|
|
|
|
[0], [stdout], [ignore])
|
2013-04-03 13:30:18 -05:00
|
|
|
AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --remote=ptcp:0:127.0.0.1 --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
|
2014-05-19 11:58:14 -07:00
|
|
|
TCP_PORT=`parse_listening_port < ovsdb-server.log`
|
2013-04-03 13:30:18 -05:00
|
|
|
|
2012-09-27 18:28:08 +09:00
|
|
|
m4_if([$2], [], [],
|
|
|
|
|
[AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore], [kill `cat pid`])])
|
|
|
|
|
AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
|
|
|
|
|
[0], [stdout], [ignore], [kill `cat pid`])
|
2013-04-22 22:20:07 +09:00
|
|
|
AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
|
2012-09-27 18:28:08 +09:00
|
|
|
[0], [$4], [], [kill `cat pid`])
|
|
|
|
|
OVSDB_SERVER_SHUTDOWN
|
|
|
|
|
AT_CLEANUP])
|
|
|
|
|
|
2014-02-06 16:04:05 -08:00
|
|
|
# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
|
|
|
|
|
m4_define([OVSDB_CHECK_IDL_TCP6_PY],
|
|
|
|
|
[AT_SETUP([$1 - Python tcp6])
|
|
|
|
|
AT_SKIP_IF([test $HAVE_PYTHON = no])
|
|
|
|
|
AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
|
|
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
|
|
|
|
OVS_LOGDIR=`pwd`; export OVS_LOGDIR
|
|
|
|
|
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
|
|
|
|
|
[0], [stdout], [ignore])
|
|
|
|
|
AT_CHECK([ovsdb-server --log-file '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=ptcp:0:[[::1]] --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
|
2014-05-19 11:58:14 -07:00
|
|
|
TCP_PORT=`parse_listening_port < ovsdb-server.log`
|
2014-02-06 16:04:05 -08:00
|
|
|
echo "TCP_PORT=$TCP_PORT"
|
|
|
|
|
|
|
|
|
|
m4_if([$2], [], [],
|
|
|
|
|
[AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore], [kill `cat pid`])])
|
2014-02-07 15:38:07 -08:00
|
|
|
AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
|
2014-02-06 16:04:05 -08:00
|
|
|
[0], [stdout], [ignore], [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])
|
|
|
|
|
|
2011-09-21 10:43:03 -07:00
|
|
|
m4_define([OVSDB_CHECK_IDL],
|
|
|
|
|
[OVSDB_CHECK_IDL_C($@)
|
2012-09-27 18:28:08 +09:00
|
|
|
OVSDB_CHECK_IDL_PY($@)
|
2014-02-06 16:04:05 -08:00
|
|
|
OVSDB_CHECK_IDL_TCP_PY($@)
|
|
|
|
|
OVSDB_CHECK_IDL_TCP6_PY($@)])
|
2011-09-21 10:43:03 -07:00
|
|
|
|
2009-12-02 11:26:15 -08:00
|
|
|
OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
|
|
|
|
|
[],
|
|
|
|
|
[],
|
|
|
|
|
[000: empty
|
|
|
|
|
001: done
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
|
|
|
|
|
[],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": 1,
|
|
|
|
|
"r": 2.0,
|
|
|
|
|
"b": true,
|
|
|
|
|
"s": "mystring",
|
|
|
|
|
"u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
|
|
|
|
|
"ia": ["set", [1, 2, 3]],
|
|
|
|
|
"ra": ["set", [-0.5]],
|
2011-05-12 13:46:16 -07:00
|
|
|
"ba": ["set", [true]],
|
2011-09-21 10:43:03 -07:00
|
|
|
"sa": ["set", ["abc", "def"]],
|
2009-12-02 11:26:15 -08:00
|
|
|
"ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
|
|
|
|
|
["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"where": [],
|
|
|
|
|
"row": {"b": true}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"where": [],
|
|
|
|
|
"row": {"r": 123.5}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": -1,
|
|
|
|
|
"r": 125,
|
|
|
|
|
"b": false,
|
|
|
|
|
"s": "",
|
|
|
|
|
"ia": ["set", [1]],
|
|
|
|
|
"ra": ["set", [1.5]],
|
|
|
|
|
"ba": ["set", [false]],
|
2011-09-21 10:43:03 -07:00
|
|
|
"sa": ["set", []],
|
2009-12-02 11:26:15 -08:00
|
|
|
"ua": ["set", []]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"where": [["i", "<", 1]],
|
|
|
|
|
"row": {"s": "newstring"}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "delete",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"where": [["i", "==", 0]]}]' \
|
|
|
|
|
'reconnect']],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
|
|
|
|
|
002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
003: {"error":null,"result":[{"count":2}]}
|
|
|
|
|
004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
005: {"error":null,"result":[{"count":2}]}
|
|
|
|
|
006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
|
|
|
|
|
008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
|
|
|
|
|
008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
009: {"error":null,"result":[{"count":2}]}
|
|
|
|
|
010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
|
|
|
|
|
010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
011: {"error":null,"result":[{"count":1}]}
|
|
|
|
|
012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
|
2011-05-12 13:46:16 -07:00
|
|
|
012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
013: reconnect
|
|
|
|
|
014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
|
2011-05-12 13:46:16 -07:00
|
|
|
014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
|
2009-12-02 11:26:15 -08:00
|
|
|
015: done
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL([simple idl, initially populated],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": 1,
|
|
|
|
|
"r": 2.0,
|
|
|
|
|
"b": true,
|
|
|
|
|
"s": "mystring",
|
|
|
|
|
"u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
|
|
|
|
|
"ia": ["set", [1, 2, 3]],
|
|
|
|
|
"ra": ["set", [-0.5]],
|
2011-05-12 13:46:16 -07:00
|
|
|
"ba": ["set", [true]],
|
2011-09-21 10:43:03 -07:00
|
|
|
"sa": ["set", ["abc", "def"]],
|
2009-12-02 11:26:15 -08:00
|
|
|
"ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
|
|
|
|
|
["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]']],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-02 11:26:15 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"where": [],
|
|
|
|
|
"row": {"b": true}}]']],
|
|
|
|
|
[[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
|
2009-12-02 11:26:15 -08:00
|
|
|
001: {"error":null,"result":[{"count":2}]}
|
|
|
|
|
002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
|
2009-12-02 11:26:15 -08:00
|
|
|
003: done
|
|
|
|
|
]])
|
|
|
|
|
|
2009-12-07 17:08:04 -08:00
|
|
|
OVSDB_CHECK_IDL([simple idl, writing via IDL],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-07 17:08:04 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": 1,
|
|
|
|
|
"r": 2.0,
|
|
|
|
|
"b": true,
|
|
|
|
|
"s": "mystring",
|
|
|
|
|
"u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
|
|
|
|
|
"ia": ["set", [1, 2, 3]],
|
|
|
|
|
"ra": ["set", [-0.5]],
|
2011-05-12 13:46:16 -07:00
|
|
|
"ba": ["set", [true]],
|
2011-09-21 10:43:03 -07:00
|
|
|
"sa": ["set", ["abc", "def"]],
|
2009-12-07 17:08:04 -08:00
|
|
|
"ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
|
|
|
|
|
["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]']],
|
2010-10-22 12:52:44 -07:00
|
|
|
[['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
|
|
|
|
|
'insert 2, verify 2 i, verify 1 b, delete 1']],
|
2009-12-07 17:08:04 -08:00
|
|
|
[[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
|
2009-12-07 17:08:04 -08:00
|
|
|
001: commit, status=success
|
|
|
|
|
002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
2011-05-12 13:46:16 -07:00
|
|
|
002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
|
2009-12-07 17:08:04 -08:00
|
|
|
003: commit, status=success
|
|
|
|
|
004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
|
|
|
|
|
005: done
|
|
|
|
|
]])
|
|
|
|
|
|
2010-10-22 12:52:44 -07:00
|
|
|
OVSDB_CHECK_IDL([simple idl, handling verification failure],
|
|
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": 1,
|
|
|
|
|
"r": 2.0}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]']],
|
|
|
|
|
[['set 0 b 1' \
|
|
|
|
|
'+["idltest",
|
|
|
|
|
{"op": "update",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"where": [["i", "==", 1]],
|
|
|
|
|
"row": {"r": 5.0}}]' \
|
|
|
|
|
'+verify 1 r, set 1 r 3' \
|
|
|
|
|
'verify 1 r, set 1 r 3' \
|
|
|
|
|
]],
|
|
|
|
|
[[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
|
|
|
|
|
001: commit, status=success
|
|
|
|
|
002: {"error":null,"result":[{"count":1}]}
|
2012-04-12 08:25:10 -07:00
|
|
|
003: commit, status=try again
|
2010-10-22 12:52:44 -07:00
|
|
|
004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
|
|
|
|
|
005: commit, status=success
|
|
|
|
|
006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
|
|
|
|
|
007: done
|
|
|
|
|
]])
|
|
|
|
|
|
2009-12-16 16:26:17 -08:00
|
|
|
OVSDB_CHECK_IDL([simple idl, increment operation],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-16 16:26:17 -08:00
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]']],
|
2012-04-12 08:25:10 -07:00
|
|
|
[['set 0 r 2.0, increment 0']],
|
2009-12-16 16:26:17 -08:00
|
|
|
[[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
001: commit, status=success, increment=1
|
|
|
|
|
002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
003: done
|
|
|
|
|
]])
|
|
|
|
|
|
2011-06-20 16:17:44 -07:00
|
|
|
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
|
|
|
|
|
]])
|
|
|
|
|
|
2009-12-02 11:26:15 -08:00
|
|
|
OVSDB_CHECK_IDL([self-linking idl, consistent ops],
|
|
|
|
|
[],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"row": {"i": 0, "k": ["named-uuid", "self"]},
|
|
|
|
|
"uuid-name": "self"}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-07 11:47:48 -08:00
|
|
|
"row": {"i": 1, "k": ["named-uuid", "row2"]},
|
2009-12-02 11:26:15 -08:00
|
|
|
"uuid-name": "row1"},
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"row": {"i": 2, "k": ["named-uuid", "row1"]},
|
2009-12-07 11:47:48 -08:00
|
|
|
"uuid-name": "row2"}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"where": [["i", "==", 1]],
|
|
|
|
|
"row": {"k": ["uuid", "#1#"]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"where": [],
|
|
|
|
|
"row": {"k": ["uuid", "#0#"]}}]']],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
|
2009-12-03 10:35:45 -08:00
|
|
|
002: i=0 k=0 ka=[] l2= uuid=<0>
|
2010-02-08 16:03:21 -08:00
|
|
|
003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
|
2009-12-03 10:35:45 -08:00
|
|
|
004: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
004: i=1 k=2 ka=[] l2= uuid=<1>
|
|
|
|
|
004: i=2 k=1 ka=[] l2= uuid=<2>
|
2009-12-02 11:26:15 -08:00
|
|
|
005: {"error":null,"result":[{"count":1}]}
|
2009-12-03 10:35:45 -08:00
|
|
|
006: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
006: i=1 k=1 ka=[] l2= uuid=<1>
|
|
|
|
|
006: i=2 k=1 ka=[] l2= uuid=<2>
|
2009-12-02 11:26:15 -08:00
|
|
|
007: {"error":null,"result":[{"count":3}]}
|
2009-12-03 10:35:45 -08:00
|
|
|
008: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
008: i=1 k=0 ka=[] l2= uuid=<1>
|
|
|
|
|
008: i=2 k=0 ka=[] l2= uuid=<2>
|
2009-12-02 11:26:15 -08:00
|
|
|
009: done
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
|
|
|
|
|
[],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'+["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"uuid-name": "one",
|
|
|
|
|
"row": {"i": 1, "k": ["named-uuid", "one"]}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"where": [],
|
|
|
|
|
"row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'+["idltest",
|
|
|
|
|
{"op": "delete",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'+["idltest",
|
|
|
|
|
{"op": "delete",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "delete",
|
2010-02-08 14:09:41 -08:00
|
|
|
"table": "link1",
|
|
|
|
|
"where": []}]' \
|
2009-12-02 11:26:15 -08:00
|
|
|
]],
|
|
|
|
|
[[000: empty
|
2010-06-11 13:56:36 -07:00
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"details":"Table link1 column k row <0> references nonexistent row <1> in table link1.","error":"referential integrity violation"}]}
|
2010-02-08 14:09:41 -08:00
|
|
|
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>
|
2010-06-23 09:50:47 -07:00
|
|
|
004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
|
2010-02-08 14:09:41 -08:00
|
|
|
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
|
2010-06-23 09:50:47 -07:00
|
|
|
]],
|
|
|
|
|
[],
|
|
|
|
|
[[sed -e '/004:/s/row <[23]> references/row <x> references/']])
|
2009-12-02 11:26:15 -08:00
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL([self-linking idl, sets],
|
|
|
|
|
[],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
|
2009-12-02 11:26:15 -08:00
|
|
|
"uuid-name": "i0"},
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
|
2009-12-02 11:26:15 -08:00
|
|
|
"uuid-name": "i1"},
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
|
2009-12-02 11:26:15 -08:00
|
|
|
"uuid-name": "i2"},
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
|
2009-12-02 11:26:15 -08:00
|
|
|
"uuid-name": "i3"}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2009-12-02 11:26:15 -08:00
|
|
|
"where": [],
|
|
|
|
|
"row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link1",
|
2010-06-11 13:56:36 -07:00
|
|
|
"where": [["i", "==", 2]],
|
|
|
|
|
"row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
|
2010-02-09 10:17:58 -08:00
|
|
|
'+["idltest",
|
|
|
|
|
{"op": "delete",
|
2010-02-08 14:09:41 -08:00
|
|
|
"table": "link1",
|
|
|
|
|
"where": []}]']],
|
2009-12-02 11:26:15 -08:00
|
|
|
[[000: empty
|
|
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
|
2010-02-08 14:09:41 -08:00
|
|
|
002: i=0 k=0 ka=[0] l2= uuid=<0>
|
|
|
|
|
002: i=1 k=0 ka=[1] l2= uuid=<1>
|
|
|
|
|
002: i=2 k=0 ka=[2] l2= uuid=<2>
|
|
|
|
|
002: i=3 k=0 ka=[3] l2= uuid=<3>
|
2009-12-02 11:26:15 -08:00
|
|
|
003: {"error":null,"result":[{"count":4}]}
|
2010-02-08 14:09:41 -08:00
|
|
|
004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
|
|
|
|
|
004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
|
|
|
|
|
004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
|
|
|
|
|
004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
|
2010-06-11 13:56:36 -07:00
|
|
|
005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
|
2010-02-08 14:09:41 -08:00
|
|
|
006: {"error":null,"result":[{"count":4}]}
|
|
|
|
|
007: empty
|
|
|
|
|
008: done
|
2009-12-02 11:26:15 -08:00
|
|
|
]])
|
|
|
|
|
|
2009-12-03 10:35:45 -08:00
|
|
|
OVSDB_CHECK_IDL([external-linking idl, consistent ops],
|
|
|
|
|
[],
|
2010-02-09 10:17:58 -08:00
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
2009-12-03 10:35:45 -08:00
|
|
|
"table": "link2",
|
|
|
|
|
"row": {"i": 0},
|
|
|
|
|
"uuid-name": "row0"},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "link1",
|
2010-02-08 14:09:41 -08:00
|
|
|
"row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
|
2009-12-03 10:35:45 -08:00
|
|
|
"uuid-name": "row1"}]']],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
|
|
|
|
|
002: i=0 l1= uuid=<0>
|
2010-02-08 14:09:41 -08:00
|
|
|
002: i=1 k=1 ka=[] l2=0 uuid=<1>
|
2009-12-03 10:35:45 -08:00
|
|
|
003: done
|
|
|
|
|
]])
|
python/ovs/db/idl.py: Transaction._substitute doesn't handle list/tuple
Since Transaction._substitute doesn't substitute elements of list/tuple,
setting list references results in transaction error. Teach it such case.
Example:
{"op": "update",
"row":{"bridges":["set",[["uuid",
"1f42bc19-307f-42e7-a9c0-c12178bd8b51"],
["uuid",
"f97e0c76-7146-489d-9bed-29bc704f65fe"]]]},
"table": "Open_vSwitch",
"where":[["_uuid", "==", ["uuid",
"20c2a046-ae7e-4453-a576-11034db24985"]]]}
In the above case, uuid in "row" aren't replaced by "named-uuid" because
the function doesn't look into elements of lists.
When list/tuple is found, look into elements recursively.
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
2012-09-13 13:41:04 +09:00
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
|
|
|
|
|
[],
|
|
|
|
|
[['linktest']],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: commit, status=success
|
|
|
|
|
002: i=1 k=1 ka=[1] l2= uuid=<0>
|
|
|
|
|
002: i=2 k=1 ka=[1 2] l2= uuid=<1>
|
|
|
|
|
003: done
|
|
|
|
|
]])
|
2012-09-27 18:29:45 +09:00
|
|
|
|
|
|
|
|
OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
|
|
|
|
|
[],
|
|
|
|
|
[['getattrtest']],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: commit, status=success
|
|
|
|
|
002: i=2 k=2 ka=[] l2= uuid=<0>
|
|
|
|
|
003: done
|
|
|
|
|
]])
|
2015-03-19 23:45:42 -07:00
|
|
|
|
2015-04-25 14:57:44 -05:00
|
|
|
OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
|
|
|
|
|
[['["idltest",
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {"i": 1}},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "simple",
|
|
|
|
|
"row": {}}]']],
|
|
|
|
|
[['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
|
|
|
|
|
[[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
|
|
|
|
|
000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
|
|
|
|
|
001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
|
|
|
|
|
002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
|
|
|
|
|
002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
|
|
|
|
|
003: done
|
|
|
|
|
]])
|
|
|
|
|
|
2015-03-19 23:45:42 -07:00
|
|
|
AT_SETUP([idl handling of missing tables and columns - C])
|
|
|
|
|
AT_KEYWORDS([ovsdb server idl positive])
|
|
|
|
|
OVS_RUNDIR=`pwd`; export OVS_RUNDIR
|
|
|
|
|
|
|
|
|
|
# idltest2.ovsschema is the same as idltest.ovsschema, except that
|
|
|
|
|
# table link2 and column l2 have been deleted. But the IDL still
|
|
|
|
|
# expects them to be there, so this test checks that it properly
|
|
|
|
|
# tolerates them being missing.
|
|
|
|
|
AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest2.ovsschema],
|
|
|
|
|
[0], [stdout], [ignore])
|
|
|
|
|
AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --no-chdir --pidfile="`pwd`"/pid --remote=punix:socket --unixctl="`pwd`"/unixctl db], [0], [ignore], [ignore])
|
|
|
|
|
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"row": {"i": 0, "k": ["named-uuid", "self"]},
|
|
|
|
|
"uuid-name": "self"}]' \
|
|
|
|
|
'["idltest",
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"row": {"i": 1, "k": ["named-uuid", "row2"]},
|
|
|
|
|
"uuid-name": "row1"},
|
|
|
|
|
{"op": "insert",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"row": {"i": 2, "k": ["named-uuid", "row1"]},
|
|
|
|
|
"uuid-name": "row2"}]' \
|
|
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"where": [["i", "==", 1]],
|
|
|
|
|
"row": {"k": ["uuid", "#1#"]}}]' \
|
|
|
|
|
'["idltest",
|
|
|
|
|
{"op": "update",
|
|
|
|
|
"table": "link1",
|
|
|
|
|
"where": [],
|
|
|
|
|
"row": {"k": ["uuid", "#0#"]}}]']],
|
|
|
|
|
[0], [stdout], [stderr], [kill `cat pid`])
|
|
|
|
|
AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0],
|
|
|
|
|
[[000: empty
|
|
|
|
|
001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
|
|
|
|
|
002: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
|
|
|
|
|
004: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
004: i=1 k=2 ka=[] l2= uuid=<1>
|
|
|
|
|
004: i=2 k=1 ka=[] l2= uuid=<2>
|
|
|
|
|
005: {"error":null,"result":[{"count":1}]}
|
|
|
|
|
006: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
006: i=1 k=1 ka=[] l2= uuid=<1>
|
|
|
|
|
006: i=2 k=1 ka=[] l2= uuid=<2>
|
|
|
|
|
007: {"error":null,"result":[{"count":3}]}
|
|
|
|
|
008: i=0 k=0 ka=[] l2= uuid=<0>
|
|
|
|
|
008: i=1 k=0 ka=[] l2= uuid=<1>
|
|
|
|
|
008: i=2 k=0 ka=[] l2= uuid=<2>
|
|
|
|
|
009: done
|
|
|
|
|
]], [], [kill `cat pid`])
|
|
|
|
|
|
|
|
|
|
# Check that ovsdb-idl figured out that table link2 and column l2 are missing.
|
|
|
|
|
AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
|
|
|
|
|
test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
|
|
|
|
|
test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
# Check that ovsdb-idl sent on "monitor" request and that it didn't
|
|
|
|
|
# mention that table or column, and (for paranoia) that it did mention another
|
|
|
|
|
# table and column.
|
|
|
|
|
AT_CHECK([grep -c '"monitor"' stderr], [0], [1
|
|
|
|
|
])
|
|
|
|
|
AT_CHECK([grep '"monitor"' stderr | grep link2], [1])
|
|
|
|
|
AT_CHECK([grep '"monitor"' stderr | grep l2], [1])
|
|
|
|
|
AT_CHECK([grep '"monitor"' stderr | grep -c '"link1"'], [0], [1
|
|
|
|
|
])
|
|
|
|
|
AT_CHECK([grep '"monitor"' stderr | grep -c '"ua"'], [0], [1
|
|
|
|
|
])
|
|
|
|
|
OVSDB_SERVER_SHUTDOWN
|
|
|
|
|
AT_CLEANUP
|