X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Fovsdb-schema.at;h=d129093a216d1641b541d736196dbc4196599df8;hb=2ce949ba352d075703fe672cdefd7d020bd042bd;hp=6cd2fa20fc2efe59fd379805c657585f67696253;hpb=02dd3123a0e312f1d33403e744af52dd6096f12d;p=sliver-openvswitch.git diff --git a/tests/ovsdb-schema.at b/tests/ovsdb-schema.at index 6cd2fa20f..d129093a2 100644 --- a/tests/ovsdb-schema.at +++ b/tests/ovsdb-schema.at @@ -1,8 +1,9 @@ AT_BANNER([OVSDB -- schemas]) -OVSDB_CHECK_POSITIVE([schema with valid refTables], +OVSDB_CHECK_POSITIVE_CPY([schema with valid refTables], [[parse-schema \ '{"name": "mydb", + "version": "4.2.1", "tables": { "a": { "columns": { @@ -21,9 +22,21 @@ OVSDB_CHECK_POSITIVE([schema with valid refTables], "key": { "type": "uuid", "refTable": "a"}}}}}}}']], - [[{"name":"mydb","tables":{"a":{"columns":{"map":{"type":{"key":{"refTable":"b","type":"uuid"},"value":{"refTable":"a","type":"uuid"}}}}},"b":{"columns":{"aRef":{"type":{"key":{"refTable":"a","type":"uuid"}}}}}}}]]) + [[{"name":"mydb","tables":{"a":{"columns":{"map":{"type":{"key":{"refTable":"b","type":"uuid"},"value":{"refTable":"a","type":"uuid"}}}}},"b":{"columns":{"aRef":{"type":{"key":{"refTable":"a","type":"uuid"}}}}}},"version":"4.2.1"}]]) -OVSDB_CHECK_NEGATIVE([schema with invalid refTables], +dnl Schemas without version numbers are accepted for backward +dnl compatibility, but this is a deprecated feature. +OVSDB_CHECK_POSITIVE_CPY([schema without version number], + [[parse-schema \ + '{"name": "mydb", + "tables": { + "x": { + "columns": { + "y": { + "type": "integer"}}}}}']], + [{"name":"mydb","tables":{"x":{"columns":{"y":{"type":"integer"}}}}}]) + +OVSDB_CHECK_NEGATIVE_CPY([schema with invalid refTables], [[parse-schema \ '{"name": "mydb", "tables": { @@ -44,4 +57,15 @@ OVSDB_CHECK_NEGATIVE([schema with invalid refTables], "key": { "type": "uuid", "refTable": "a"}}}}}}}']], - [[test-ovsdb: syntax error: column map key refers to undefined table c]]) + [[syntax error: column map key refers to undefined table c]]) + +OVSDB_CHECK_NEGATIVE_CPY([schema with invalid version number], + [[parse-schema \ + '{"name": "mydb", + "tables": { + "x": { + "columns": { + "y": { + "type": "integer"}}}}, + "version": "xxx"}']], + [[schema version "xxx" not in format x.y.z]])