python: Implement write support in Python IDL for OVSDB.
[sliver-openvswitch.git] / tests / ovsdb-idl-py.at
diff --git a/tests/ovsdb-idl-py.at b/tests/ovsdb-idl-py.at
deleted file mode 100644 (file)
index bbee0c3..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-AT_BANNER([OVSDB -- interface description language (IDL) - Python])
-
-# 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,
-# 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
-# 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_PY], 
-  [AT_SETUP([$1])
-   AT_SKIP_IF([test $HAVE_PYTHON = no])
-   AT_KEYWORDS([ovsdb server idl positive Python $5])
-   AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
-                  [0], [stdout], [ignore])
-   AT_CHECK([ovsdb-server '-vPATTERN:console:ovsdb-server|%c|%m' --detach --pidfile=$PWD/pid --remote=punix:socket --unixctl=$PWD/unixctl db], [0], [ignore], [ignore])
-   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 unix:socket $3], 
-            [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])
-
-OVSDB_CHECK_IDL_PY([simple idl, initially empty, no ops - Python],
-  [],
-  [],
-  [000: empty
-001: done
-])
-
-OVSDB_CHECK_IDL_PY([simple idl, initially empty, various ops - Python],
-  [],
-  [['["idltest",
-      {"op": "insert",
-       "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]],
-               "ba": ["set", [true]],
-               "sa": ["set", ["abc", "def"]], 
-               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
-                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
-      {"op": "insert",
-       "table": "simple",
-       "row": {}}]' \
-    '["idltest",
-      {"op": "update",
-       "table": "simple",
-       "where": [],
-       "row": {"b": true}}]' \
-    '["idltest",
-      {"op": "update",
-       "table": "simple",
-       "where": [],
-       "row": {"r": 123.5}}]' \
-    '["idltest",
-      {"op": "insert",
-       "table": "simple",
-       "row": {"i": -1,
-               "r": 125,
-               "b": false,
-               "s": "",
-               "ia": ["set", [1]],
-               "ra": ["set", [1.5]],
-               "ba": ["set", [false]],
-               "sa": ["set", []], 
-               "ua": ["set", []]}}]' \
-    '["idltest",
-      {"op": "update",
-       "table": "simple",
-       "where": [["i", "<", 1]],
-       "row": {"s": "newstring"}}]' \
-    '["idltest",
-      {"op": "delete",
-       "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>
-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>
-003: {"error":null,"result":[{"count":2}]}
-004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
-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>
-005: {"error":null,"result":[{"count":2}]}
-006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
-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>
-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>
-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>
-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>
-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>
-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>
-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>
-013: reconnect
-014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=false sa=[] ua=[] uuid=<6>
-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>
-015: done
-]])
-
-OVSDB_CHECK_IDL_PY([simple idl, initially populated - Python],
-  [['["idltest",
-      {"op": "insert",
-       "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]],
-               "ba": ["set", [true]],
-               "sa": ["set", ["abc", "def"]], 
-               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
-                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
-      {"op": "insert",
-       "table": "simple",
-       "row": {}}]']],
-  [['["idltest",
-      {"op": "update",
-       "table": "simple",
-       "where": [],
-       "row": {"b": true}}]']],
-  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
-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>
-001: {"error":null,"result":[{"count":2}]}
-002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
-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>
-003: done
-]])