X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-table.at;h=26ff90e7a28ef790bda06ebb7bf060f5591cfa96;hb=3ba9c6a5a5468626dcfeb1f9a750bb0efc8c6a7a;hp=70f8ac252d206e70d73aad32febcd2da8cc515d9;hpb=991559357f6a03c3a5b70c053c8c2554aa8d5ee4;p=sliver-openvswitch.git diff --git a/tests/ovsdb-table.at b/tests/ovsdb-table.at index 70f8ac252..26ff90e7a 100644 --- a/tests/ovsdb-table.at +++ b/tests/ovsdb-table.at @@ -1,6 +1,6 @@ AT_BANNER([OVSDB -- tables]) -OVSDB_CHECK_POSITIVE_CPY([table with one column], +OVSDB_CHECK_POSITIVE_CPY([non-root table with one column], [[parse-table mytable '{"columns": {"name": {"type": "string"}}}']], [[{"columns":{"name":{"type":"string"}}}]]) @@ -10,11 +10,52 @@ OVSDB_CHECK_POSITIVE_CPY([immutable table with one column], "mutable": false}']], [[{"columns":{"name":{"type":"string"}},"mutable":false}]]) +OVSDB_CHECK_POSITIVE_CPY([root table with one column], + [[parse-table mytable \ + '{"columns": {"name": {"type": "string"}}, + "isRoot": true}']], + [[{"columns":{"name":{"type":"string"}},"isRoot":true}]]) + +OVSDB_CHECK_POSITIVE_CPY([non-root table with default_is_root=true], + [[parse-table mytable '{"columns": {"name": {"type": "string"}}}' true]], + [[{"columns":{"name":{"type":"string"}},"isRoot":false}]]) + +OVSDB_CHECK_POSITIVE_CPY([root table with default_is_root=true], + [[parse-table mytable \ + '{"columns": {"name": {"type": "string"}}, + "isRoot": true}' true]], + [[{"columns":{"name":{"type":"string"}}}]]) + OVSDB_CHECK_POSITIVE_CPY([table with maxRows of 2], [[parse-table mytable '{"columns": {"name": {"type": "string"}}, "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"}}}']],