aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-23 15:57:50 -0800
committerBen Pfaff <blp@nicira.com>2010-02-25 14:59:16 -0800
commit89521e3f79d53523fda9f284e74f0f7aa21332b4 (patch)
tree3e3463784a9fe29afb78df4cdc7e624c05e20317 /tests
parent867cc7bd395b32a3516112127a04d41d9f1b15fc (diff)
ovsdb: Drop regular expression constraints.
Regular expression constraints have caused nothing but trouble due to the lack of a ubiquitous regular expression library. PCRE is *almost* everywhere, but it has different versions, and different features, and different bugs, in different places. It is more trouble than it is worth. So this commit drops support.
Diffstat (limited to 'tests')
-rw-r--r--tests/ovs-vsctl.at8
-rw-r--r--tests/ovsdb-data.at31
-rw-r--r--tests/ovsdb-types.at25
3 files changed, 0 insertions, 64 deletions
diff --git a/tests/ovs-vsctl.at b/tests/ovs-vsctl.at
index ee2905b4..07244a82 100644
--- a/tests/ovs-vsctl.at
+++ b/tests/ovs-vsctl.at
@@ -590,14 +590,6 @@ AT_CHECK([RUN_OVS_VSCTL([set b br0 flood_vlans=-1])],
AT_CHECK([RUN_OVS_VSCTL([set b br0 flood_vlans=4096])],
[1], [], [ovs-vsctl: constraint violation: 4096 is not in the valid range 0 to 4095 (inclusive)
], [OVS_VSCTL_CLEANUP])
-if test "$HAVE_PCRE" = yes; then
- AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
- [1], [], [ovs-vsctl: constraint violation: "xyz" is not a either "in-band" or "out-of-band"
-], [OVS_VSCTL_CLEANUP])
-else
- AT_CHECK([RUN_OVS_VSCTL([set c br1 'connection-mode=xyz'])],
- [0], [], [], [OVS_VSCTL_CLEANUP])
-fi
AT_CHECK([RUN_OVS_VSCTL([set c br1 connection-mode:x=y])],
[1], [], [ovs-vsctl: cannot specify key to set for non-map column connection_mode
], [OVS_VSCTL_CLEANUP])
diff --git a/tests/ovsdb-data.at b/tests/ovsdb-data.at
index 5ca23cf1..031eee04 100644
--- a/tests/ovsdb-data.at
+++ b/tests/ovsdb-data.at
@@ -290,37 +290,6 @@ constraint violation: -11 is not in the valid range -10 to 10 (inclusive)
constraint violation: 11 is not in the valid range -10 to 10 (inclusive)
constraint violation: 123576 is not in the valid range -10 to 10 (inclusive)])
-AT_SETUP([strings matching /(a(b)?)c?/])
-AT_KEYWORDS([ovsdb positive])
-if test "$HAVE_PCRE" = yes; then
- b_out='constraint violation: "b" does not match regular expression /(a(b)?)?c?/'
- bc_out='constraint violation: "bc" does not match regular expression /(a(b)?)?c?/'
-else
- b_out='"b"'
- bc_out='"bc"'
-fi
-AT_CHECK_UNQUOTED(
- [[test-ovsdb parse-atoms '{"type": "string", "reMatch": "(a(b)?)?c?"}' \
- '[""]' \
- '["a"]' \
- '["ab"]' \
- '["abc"]' \
- '["ac"]' \
- '["b"]' \
- '["bc"]' \
- '["c"]']],
- [0],
- [[""
-"a"
-"ab"
-"abc"
-"ac"
-$b_out
-$bc_out
-"c"
-]])
-AT_CLEANUP
-
OVSDB_CHECK_POSITIVE([strings at least 2 characters long],
[[parse-atoms '{"type": "string", "minLength": 2}' \
'[""]' \
diff --git a/tests/ovsdb-types.at b/tests/ovsdb-types.at
index d0527766..2d981833 100644
--- a/tests/ovsdb-types.at
+++ b/tests/ovsdb-types.at
@@ -44,31 +44,6 @@ OVSDB_CHECK_NEGATIVE([real max may not be less than min],
OVSDB_CHECK_POSITIVE([boolean],
[[parse-base-type '[{"type": "boolean"}]' ]], ["boolean"])
-OVSDB_CHECK_POSITIVE([string reMatch],
- [[parse-base-type '{"type": "string", "reMatch": "\\d{3}-\\d{3}-\\d{4}"}']],
- [{"reMatch":"\\d{3}-\\d{3}-\\d{4}","type":"string"}])
-OVSDB_CHECK_POSITIVE([string reMatch + reComment],
- [[parse-base-type '{"type": "string", "reMatch": "\\d{3}-\\d{3}-\\d{4}", "reComment": "US-style telephone number"}']],
- [{"reComment":"US-style telephone number","reMatch":"\\d{3}-\\d{3}-\\d{4}","type":"string"}])
-
-AT_SETUP([reMatch must be a valid regexp])
-AT_KEYWORDS([ovsdb negative])
-if test "$HAVE_PCRE" = yes; then
- AT_CHECK(
- [[test-ovsdb parse-base-type \
- '{"type": "string", "reMatch": "x{2,1}"}']],
- [1], [],
- [[test-ovsdb: invalid regular expression: "x{2,1}" is not a valid regular expression: numbers out of order in {} quantifier
-]])
-else
- AT_CHECK(
- [[test-ovsdb parse-base-type \
- '{"type": "string", "reMatch": "x{2,1}"}']],
- [0], [[{"reMatch":"x{2,1}","type":"string"}
-]], [])
-fi
-AT_CLEANUP
-
OVSDB_CHECK_POSITIVE([string minLength],
[[parse-base-type '{"type": "string", "minLength": 1}']],
[{"minLength":1,"type":"string"}])