X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-table.at;h=26ff90e7a28ef790bda06ebb7bf060f5591cfa96;hb=c5cf10598f8c9f4428291e9df3ecd72a05fb1ccf;hp=cf206c4237b38d6216727181d24987ac8af08e8f;hpb=c5f341ab193b9126dffef8c77bf8ed35e91290fd;p=sliver-openvswitch.git diff --git a/tests/ovsdb-table.at b/tests/ovsdb-table.at index cf206c423..26ff90e7a 100644 --- a/tests/ovsdb-table.at +++ b/tests/ovsdb-table.at @@ -31,6 +31,31 @@ OVSDB_CHECK_POSITIVE_CPY([table with maxRows of 2], "maxRows": 2}']], [[{"columns":{"name":{"type":"string"}},"maxRows":2}]]) +OVSDB_CHECK_POSITIVE_CPY([table with index], + [[parse-table mytable '{"columns": {"a": {"type": "integer"}, + "b": {"type": "string"}}, + "indexes": [["b", "a"]]}']], + [[{"columns":{"a":{"type":"integer"},"b":{"type":"string"}},"indexes":[["b","a"]]}]]) + +OVSDB_CHECK_NEGATIVE_CPY([table with syntax error in index], + [[parse-table mytable '{"columns": {"a": {"type": "integer"}, + "b": {"type": "string"}}, + "indexes": [["b", "a"], [0]]}']], + [[array of distinct column names expected]]) + +OVSDB_CHECK_NEGATIVE_CPY([table with empty index], + [[parse-table mytable '{"columns": {"a": {"type": "integer"}, + "b": {"type": "string"}}, + "indexes": [[]]}']], + [[index must have at least one column]]) + +OVSDB_CHECK_NEGATIVE_CPY([table with index of ephemeral column], + [[parse-table mytable '{"columns": {"a": {"type": "integer", + "ephemeral": true}, + "b": {"type": "string"}}, + "indexes": [["b", "a"]]}']], + [[ephemeral columns (such as a) may not be indexed]]) + OVSDB_CHECK_NEGATIVE_CPY([column names may not begin with _], [[parse-table mytable \ '{"columns": {"_column": {"type": "integer"}}}']],