1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970
|
AT_BANNER([OVSDB -- conditions])
OVSDB_CHECK_POSITIVE([null condition],
[[parse-conditions \
'{"columns": {"name": {"type": "string"}}}' \
'[]']],
[[[]]])
OVSDB_CHECK_POSITIVE([conditions on scalars],
[[parse-conditions \
'{"columns":
{"i": {"type": "integer"},
"r": {"type": "real"},
"b": {"type": "boolean"},
"s": {"type": "string"},
"u": {"type": "uuid"}}}' \
'[["i", "==", 0]]' \
'[["i", "!=", 1]]' \
'[["i", "<", 2]]' \
'[["i", "<=", 3]]' \
'[["i", ">", 4]]' \
'[["i", ">=", 5]]' \
'[["i", "includes", 6]]' \
'[["i", "excludes", 7]]' \
'[["r", "==", 0.5]]' \
'[["r", "!=", 1.5]]' \
'[["r", "<", 2.5]]' \
'[["r", "<=", 3.5]]' \
'[["r", ">", 4.5]]' \
'[["r", ">=", 5.5]]' \
'[["r", "includes", 6.5]]' \
'[["r", "excludes", 7.5]]' \
'[["b", "==", true]]' \
'[["b", "!=", false]]' \
'[["b", "includes", false]]' \
'[["b", "excludes", true]]' \
'[["s", "==", "a"]]' \
'[["s", "!=", "b"]]' \
'[["s", "includes", "c"]]' \
'[["s", "excludes", "d"]]' \
'[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
'[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
'[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
'[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']],
[[[["i","==",0]]
[["i","!=",1]]
[["i","<",2]]
[["i","<=",3]]
[["i",">",4]]
[["i",">=",5]]
[["i","includes",6]]
[["i","excludes",7]]
[["r","==",0.5]]
[["r","!=",1.5]]
[["r","<",2.5]]
[["r","<=",3.5]]
[["r",">",4.5]]
[["r",">=",5.5]]
[["r","includes",6.5]]
[["r","excludes",7.5]]
[["b","==",true]]
[["b","!=",false]]
[["b","includes",false]]
[["b","excludes",true]]
[["s","==","a"]]
[["s","!=","b"]]
[["s","includes","c"]]
[["s","excludes","d"]]
[["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]
[["u","!=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]]
[["u","includes",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]
[["u","excludes",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]]]],
[condition])
AT_SETUP([disallowed conditions on scalars])
AT_KEYWORDS([ovsdb negative condition])
AT_CHECK([[test-ovsdb parse-conditions \
'{"columns":
{"i": {"type": "integer"},
"r": {"type": "real"},
"b": {"type": "boolean"},
"s": {"type": "string"},
"u": {"type": "uuid"}}}' \
'[["b", ">", true]]' \
'[["b", ">=", false]]' \
'[["b", "<", false]]' \
'[["b", "<=", false]]' \
'[["s", ">", "a"]]' \
'[["s", ">=", "b"]]' \
'[["s", "<", "c"]]' \
'[["s", "<=", "d"]]' \
'[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
'[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
'[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
'[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \
'[["i", "==", ["set", []]]]' \
'[["i", "!=", ["set", []]]]' \
'[["i", ">", ["set", []]]]' \
'[["i", ">=", ["set", []]]]' \
'[["i", "<", ["set", []]]]' \
'[["i", "<=", ["set", []]]]' \
'[["i", "includes", ["set", []]]]' \
'[["i", "excludes", ["set", []]]]' \
'[["i", ">", ["set", []]]]' \
'[["i", "==", ["set", []]]]' \
'[["r", "==", ["set", []]]]' \
'[["r", "!=", ["set", []]]]' \
'[["r", ">", ["set", []]]]' \
'[["r", ">=", ["set", []]]]' \
'[["r", "<", ["set", []]]]' \
'[["r", "<=", ["set", []]]]' \
'[["r", "includes", ["set", []]]]' \
'[["r", "excludes", ["set", []]]]' \
'[["r", ">", ["set", []]]]' \
'[["r", "==", ["set", []]]]' \
'[["b", "==", ["set", []]]]' \
'[["b", "!=", ["set", []]]]' \
'[["b", ">", ["set", []]]]' \
'[["b", ">=", ["set", []]]]' \
'[["b", "<", ["set", []]]]' \
'[["b", "<=", ["set", []]]]' \
'[["b", "includes", ["set", []]]]' \
'[["b", "excludes", ["set", []]]]' \
'[["b", ">", ["set", []]]]' \
'[["b", "==", ["set", []]]]' \
'[["s", "==", ["set", []]]]' \
'[["s", "!=", ["set", []]]]' \
'[["s", ">", ["set", []]]]' \
'[["s", ">=", ["set", []]]]' \
'[["s", "<", ["set", []]]]' \
'[["s", "<=", ["set", []]]]' \
'[["s", "includes", ["set", []]]]' \
'[["s", "excludes", ["set", []]]]' \
'[["s", ">", ["set", []]]]' \
'[["s", "==", ["set", []]]]' \
'[["u", "==", ["set", []]]]' \
'[["u", "!=", ["set", []]]]' \
'[["u", ">", ["set", []]]]' \
'[["u", ">=", ["set", []]]]' \
'[["u", "<", ["set", []]]]' \
'[["u", "<=", ["set", []]]]' \
'[["u", "includes", ["set", []]]]' \
'[["u", "excludes", ["set", []]]]' \
'[["u", ">", ["set", []]]]' \
'[["u", "==", ["set", []]]]' \
]],
[1], [],
[[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string.
test-ovsdb: syntax "["u",">",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u",">=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u","<",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u","<=",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type boolean.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type string.
test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type string.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type string.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type uuid.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
]])
AT_CLEANUP
OVSDB_CHECK_POSITIVE([conditions on optional scalars],
[[parse-conditions \
'{"columns":
{"i": {"type": {"key": "integer", "min": 0, "max": 1}},
"r": {"type": {"key": "real", "min": 0, "max": 1}},
"b": {"type": {"key": "boolean", "min": 0, "max": 1}},
"s": {"type": {"key": "string", "min": 0, "max": 1}},
"u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \
'[["i", "==", 0]]' \
'[["i", "!=", 1]]' \
'[["i", "<", 2]]' \
'[["i", "<=", 3]]' \
'[["i", ">", 4]]' \
'[["i", ">=", 5]]' \
'[["i", "includes", 6]]' \
'[["i", "excludes", 7]]' \
'[["r", "==", 0.5]]' \
'[["r", "!=", 1.5]]' \
'[["r", "<", 2.5]]' \
'[["r", "<=", 3.5]]' \
'[["r", ">", 4.5]]' \
'[["r", ">=", 5.5]]' \
'[["r", "includes", 6.5]]' \
'[["r", "excludes", 7.5]]' \
'[["b", "==", true]]' \
'[["b", "!=", false]]' \
'[["b", "includes", false]]' \
'[["b", "excludes", true]]' \
'[["s", "==", "a"]]' \
'[["s", "!=", "b"]]' \
'[["s", "includes", "c"]]' \
'[["s", "excludes", "d"]]' \
'[["u", "==", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
'[["u", "!=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
'[["u", "includes", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
'[["u", "excludes", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]']],
[[[["i","==",0]]
[["i","!=",1]]
[["i","<",2]]
[["i","<=",3]]
[["i",">",4]]
[["i",">=",5]]
[["i","includes",6]]
[["i","excludes",7]]
[["r","==",0.5]]
[["r","!=",1.5]]
[["r","<",2.5]]
[["r","<=",3.5]]
[["r",">",4.5]]
[["r",">=",5.5]]
[["r","includes",6.5]]
[["r","excludes",7.5]]
[["b","==",true]]
[["b","!=",false]]
[["b","includes",false]]
[["b","excludes",true]]
[["s","==","a"]]
[["s","!=","b"]]
[["s","includes","c"]]
[["s","excludes","d"]]
[["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]
[["u","!=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]]
[["u","includes",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]
[["u","excludes",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]]]],
[condition])
AT_SETUP([disallowed conditions on optional scalars])
AT_KEYWORDS([ovsdb negative condition])
AT_CHECK([[test-ovsdb parse-conditions \
'{"columns":
{"i": {"type": {"key": "integer", "min": 0, "max": 1}},
"r": {"type": {"key": "real", "min": 0, "max": 1}},
"b": {"type": {"key": "boolean", "min": 0, "max": 1}},
"s": {"type": {"key": "string", "min": 0, "max": 1}},
"u": {"type": {"key": "uuid", "min": 0, "max": 1}}}}' \
'[["b", ">", true]]' \
'[["b", ">=", false]]' \
'[["b", "<", false]]' \
'[["b", "<=", false]]' \
'[["s", ">", "a"]]' \
'[["s", ">=", "b"]]' \
'[["s", "<", "c"]]' \
'[["s", "<=", "d"]]' \
'[["u", ">", ["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]' \
'[["u", ">=", ["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]' \
'[["u", "<", ["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]' \
'[["u", "<=", ["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]' \
'[["i", ">", ["set", []]]]' \
'[["i", ">=", ["set", []]]]' \
'[["i", "<", ["set", []]]]' \
'[["i", "<=", ["set", []]]]' \
'[["i", ">", ["set", []]]]' \
'[["r", ">", ["set", []]]]' \
'[["r", ">=", ["set", []]]]' \
'[["r", "<", ["set", []]]]' \
'[["r", "<=", ["set", []]]]' \
'[["r", ">", ["set", []]]]' \
'[["b", ">", ["set", []]]]' \
'[["b", ">=", ["set", []]]]' \
'[["b", "<", ["set", []]]]' \
'[["b", "<=", ["set", []]]]' \
'[["b", ">", ["set", []]]]' \
'[["s", ">", ["set", []]]]' \
'[["s", ">=", ["set", []]]]' \
'[["s", "<", ["set", []]]]' \
'[["s", "<=", ["set", []]]]' \
'[["s", ">", ["set", []]]]' \
'[["u", ">", ["set", []]]]' \
'[["u", ">=", ["set", []]]]' \
'[["u", "<", ["set", []]]]' \
'[["u", "<=", ["set", []]]]' \
'[["u", ">", ["set", []]]]' \
]],
[1], [], [[test-ovsdb: syntax "["b",">",true]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b",">=",false]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b","<",false]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b","<=",false]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["s",">","a"]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s",">=","b"]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s","<","c"]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s","<=","d"]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["u",">",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u",">=",["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u","<",["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u","<=",["uuid","62315898-64e0-40b9-b26f-ff74225303e6"]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["set",[]]": syntax error: set must have exactly one member but 0 are present
test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["b",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column b of type set of up to 1 booleans.
test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["s",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column s of type set of up to 1 strings.
test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u",">=",["set",[]]]": syntax error: Type mismatch: ">=" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u","<",["set",[]]]": syntax error: Type mismatch: "<" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u","<=",["set",[]]]": syntax error: Type mismatch: "<=" operator may not be applied to column u of type set of up to 1 uuids.
test-ovsdb: syntax "["u",">",["set",[]]]": syntax error: Type mismatch: ">" operator may not be applied to column u of type set of up to 1 uuids.
]])
AT_CLEANUP
OVSDB_CHECK_POSITIVE([conditions on sets],
[[parse-conditions \
'{"columns":
{"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}},
"r": {"type": {"key": "real", "min": 0, "max": "unlimited"}},
"b": {"type": {"key": "boolean", "min": 0, "max": "unlimited"}},
"s": {"type": {"key": "string", "min": 0, "max": "unlimited"}},
"u": {"type": {"key": "uuid", "min": 0, "max": "unlimited"}}}}' \
'[["i", "==", ["set", []]]]' \
'[["i", "!=", ["set", [1]]]]' \
'[["i", "includes", ["set", [1, 2]]]]' \
'[["i", "excludes", ["set", [1, 2, 3]]]]' \
'[["r", "==", ["set", []]]]' \
'[["r", "!=", ["set", [1.5]]]]' \
'[["r", "includes", ["set", [1.5, 2.5]]]]' \
'[["r", "excludes", ["set", [1.5, 2.5, 3.5]]]]' \
'[["b", "==", ["set", [true]]]]' \
'[["b", "!=", ["set", [false]]]]' \
'[["b", "includes", ["set", [false]]]]' \
'[["b", "excludes", ["set", [true, false]]]]' \
'[["s", "==", ["set", ["a"]]]]' \
'[["s", "!=", ["set", ["a", "b"]]]]' \
'[["s", "includes", ["set", ["c"]]]]' \
'[["s", "excludes", ["set", ["c", "d"]]]]' \
'[["u", "==",
["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]' \
'[["u", "==",
["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"],
["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"]]]]]' \
'[["u", "includes",
["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"],
["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"],
["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"]]]]]' \
'[["u", "excludes",
["set", [["uuid", "b10d28f7-af18-4a67-9e78-2a6394516c59"],
["uuid", "9179ca6d-6d65-400a-b455-3ad92783a099"],
["uuid", "ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],
["uuid", "62315898-64e0-40b9-b26f-ff74225303e6"]]]]]' \
]],
[[[["i","==",["set",[]]]]
[["i","!=",1]]
[["i","includes",["set",[1,2]]]]
[["i","excludes",["set",[1,2,3]]]]
[["r","==",["set",[]]]]
[["r","!=",1.5]]
[["r","includes",["set",[1.5,2.5]]]]
[["r","excludes",["set",[1.5,2.5,3.5]]]]
[["b","==",true]]
[["b","!=",false]]
[["b","includes",false]]
[["b","excludes",["set",[false,true]]]]
[["s","==","a"]]
[["s","!=",["set",["a","b"]]]]
[["s","includes","c"]]
[["s","excludes",["set",["c","d"]]]]
[["u","==",["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]
[["u","==",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]
[["u","includes",["set",[["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]
[["u","excludes",["set",[["uuid","62315898-64e0-40b9-b26f-ff74225303e6"],["uuid","9179ca6d-6d65-400a-b455-3ad92783a099"],["uuid","ad0fa355-8b84-4a36-a4b5-b2c1bfd91758"],["uuid","b10d28f7-af18-4a67-9e78-2a6394516c59"]]]]]]],
[condition])
OVSDB_CHECK_POSITIVE([condition sorting],
[[parse-conditions \
'{"columns": {"i": {"type": "integer"}}}' \
'[["i", "excludes", 7],
["i", "!=", 8],
["i", "==", 1],
["i", "includes", 2],
["i", "<=", 3],
["i", "<", 4],
["i", ">", 6],
["i", ">=", 5],
["_uuid", "==", ["uuid", "d50e85c6-8ae7-4b16-b69e-4395928bd9be"]]]']],
[[[["_uuid","==",["uuid","d50e85c6-8ae7-4b16-b69e-4395928bd9be"]],["i","==",1],["i","includes",2],["i","<=",3],["i","<",4],["i",">=",5],["i",">",6],["i","excludes",7],["i","!=",8]]]])
OVSDB_CHECK_POSITIVE([boolean condition],
[[parse-conditions \
'{"columns": {"name": {"type": "string"}}}' \
'[true]']],
[[[true]]])
OVSDB_CHECK_POSITIVE([boolean condition],
[[parse-conditions \
'{"columns": {"name": {"type": "string"}}}' \
'[false]']],
[[[false]]])
OVSDB_CHECK_POSITIVE([evaluating null condition],
[[evaluate-conditions \
'{"columns": {"i": {"type": "integer"}}}' \
'[[]]' \
'[{"i": 0},
{"i": 1},
{"i": 2}']]],
[condition 0: TTT])
OVSDB_CHECK_POSITIVE([evaluating conditions on integers],
[[evaluate-conditions \
'{"columns": {"i": {"type": "integer"}}}' \
'[[["i", "<", 1]],
[["i", "<=", 1]],
[["i", "==", 1]],
[["i", "!=", 1]],
[["i", ">=", 1]],
[["i", ">", 1]],
[["i", "includes", 1]],
[["i", "excludes", 1]],
[["i", ">", 0], ["i", "<", 2]]]' \
'[{"i": 0},
{"i": 1},
{"i": 2}']]],
[condition 0: T--
condition 1: TT-
condition 2: -T-
condition 3: T-T
condition 4: -TT
condition 5: --T
condition 6: -T-
condition 7: T-T
condition 8: -T-], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on reals],
[[evaluate-conditions \
'{"columns": {"r": {"type": "real"}}}' \
'[[["r", "<", 5.0]],
[["r", "<=", 5.0]],
[["r", "==", 5.0]],
[["r", "!=", 5.0]],
[["r", ">=", 5.0]],
[["r", ">", 5.0]],
[["r", "includes", 5.0]],
[["r", "excludes", 5.0]],
[["r", "!=", 0], ["r", "!=", 5.1]]]' \
'[{"r": 0},
{"r": 5.0},
{"r": 5.1}']]],
[condition 0: T--
condition 1: TT-
condition 2: -T-
condition 3: T-T
condition 4: -TT
condition 5: --T
condition 6: -T-
condition 7: T-T
condition 8: -T-], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on booleans],
[[evaluate-conditions \
'{"columns": {"b": {"type": "boolean"}}}' \
'[[["b", "==", true]],
[["b", "!=", true]],
[["b", "includes", true]],
[["b", "excludes", true]],
[["b", "==", false]],
[["b", "!=", false]],
[["b", "includes", false]],
[["b", "excludes", false]],
[["b", "==", true], ["b", "==", false]]]' \
'[{"b": true},
{"b": false}']]],
[condition 0: T-
condition 1: -T
condition 2: T-
condition 3: -T
condition 4: -T
condition 5: T-
condition 6: -T
condition 7: T-
condition 8: --], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on strings],
[[evaluate-conditions \
'{"columns": {"s": {"type": "string"}}}' \
'[[["s", "==", ""]],
[["s", "!=", ""]],
[["s", "includes", ""]],
[["s", "excludes", ""]],
[["s", "==", "foo"]],
[["s", "!=", "foo"]],
[["s", "includes", "foo"]],
[["s", "excludes", "foo"]],
[["s", "!=", "foo"], ["s", "!=", ""]]]' \
'[{"s": ""},
{"s": "foo"},
{"s": "xxx"}']]],
[condition 0: T--
condition 1: -TT
condition 2: T--
condition 3: -TT
condition 4: -T-
condition 5: T-T
condition 6: -T-
condition 7: T-T
condition 8: --T], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on UUIDs],
[[evaluate-conditions \
'{"columns": {"u": {"type": "uuid"}}}' \
'[[["u", "==", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]],
[["u", "!=", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]],
[["u", "includes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]],
[["u", "excludes", ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]]],
[["u", "==", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "includes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "excludes", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]]],
[["u", "!=", ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]],
["u", "!=", ["uuid", "cb160ed6-92a6-4503-a6aa-a09a09e01f0d"]]]]' \
'[{"u": ["uuid", "8a1dbdb8-416f-4ce9-affa-3332691714b6"]},
{"u": ["uuid", "06151f9d-62d6-4f59-8504-e9765107faa9"]},
{"u": ["uuid", "00000000-0000-0000-0000-000000000000"]}']]],
[condition 0: T--
condition 1: -TT
condition 2: T--
condition 3: -TT
condition 4: -T-
condition 5: T-T
condition 6: -T-
condition 7: T-T
condition 8: T-T], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on sets],
[[evaluate-conditions \
'{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": "unlimited"}}}}' \
'[[["i", "==", ["set", []]]],
[["i", "==", ["set", [0]]]],
[["i", "==", ["set", [1]]]],
[["i", "==", ["set", [0, 1]]]],
[["i", "==", ["set", [2]]]],
[["i", "==", ["set", [2, 0]]]],
[["i", "==", ["set", [2, 1]]]],
[["i", "==", ["set", [2, 1, 0]]]],
[["i", "!=", ["set", []]]],
[["i", "!=", ["set", [0]]]],
[["i", "!=", ["set", [1]]]],
[["i", "!=", ["set", [0, 1]]]],
[["i", "!=", ["set", [2]]]],
[["i", "!=", ["set", [2, 0]]]],
[["i", "!=", ["set", [2, 1]]]],
[["i", "!=", ["set", [2, 1, 0]]]],
[["i", "includes", ["set", []]]],
[["i", "includes", ["set", [0]]]],
[["i", "includes", ["set", [1]]]],
[["i", "includes", ["set", [0, 1]]]],
[["i", "includes", ["set", [2]]]],
[["i", "includes", ["set", [2, 0]]]],
[["i", "includes", ["set", [2, 1]]]],
[["i", "includes", ["set", [2, 1, 0]]]],
[["i", "excludes", ["set", []]]],
[["i", "excludes", ["set", [0]]]],
[["i", "excludes", ["set", [1]]]],
[["i", "excludes", ["set", [0, 1]]]],
[["i", "excludes", ["set", [2]]]],
[["i", "excludes", ["set", [2, 0]]]],
[["i", "excludes", ["set", [2, 1]]]],
[["i", "excludes", ["set", [2, 1, 0]]]],
[["i", "includes", ["set", [0]]],
["i", "includes", ["set", [1]]]]]' \
'[{"i": ["set", []]},
{"i": ["set", [0]]},
{"i": ["set", [1]]},
{"i": ["set", [0, 1]]},
{"i": ["set", [2]]},
{"i": ["set", [2, 0]]},
{"i": ["set", [2, 1]]},
{"i": ["set", [2, 1, 0]]}]']],
[dnl
condition 0: T---- ---
condition 1: -T--- ---
condition 2: --T-- ---
condition 3: ---T- ---
condition 4: ----T ---
condition 5: ----- T--
condition 6: ----- -T-
condition 7: ----- --T
condition 8: -TTTT TTT
condition 9: T-TTT TTT
condition 10: TT-TT TTT
condition 11: TTT-T TTT
condition 12: TTTT- TTT
condition 13: TTTTT -TT
condition 14: TTTTT T-T
condition 15: TTTTT TT-
condition 16: TTTTT TTT
condition 17: -T-T- T-T
condition 18: --TT- -TT
condition 19: ---T- --T
condition 20: ----T TTT
condition 21: ----- T-T
condition 22: ----- -TT
condition 23: ----- --T
condition 24: TTTTT TTT
condition 25: T-T-T -T-
condition 26: TT--T T--
condition 27: T---T ---
condition 28: TTTT- ---
condition 29: T-T-- ---
condition 30: TT--- ---
condition 31: T---- ---
condition 32: ---T- --T], [condition])
# This is the same as the "set" test except that it adds values,
# all of which always match.
OVSDB_CHECK_POSITIVE([evaluating conditions on maps (1)],
[[evaluate-conditions \
'{"columns": {"i": {"type": {"key": "integer",
"value": "boolean",
"min": 0,
"max": "unlimited"}}}}' \
'[[["i", "==", ["map", []]]],
[["i", "==", ["map", [[0, true]]]]],
[["i", "==", ["map", [[1, false]]]]],
[["i", "==", ["map", [[0, true], [1, false]]]]],
[["i", "==", ["map", [[2, true]]]]],
[["i", "==", ["map", [[2, true], [0, true]]]]],
[["i", "==", ["map", [[2, true], [1, false]]]]],
[["i", "==", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "!=", ["map", []]]],
[["i", "!=", ["map", [[0, true]]]]],
[["i", "!=", ["map", [[1, false]]]]],
[["i", "!=", ["map", [[0, true], [1, false]]]]],
[["i", "!=", ["map", [[2, true]]]]],
[["i", "!=", ["map", [[2, true], [0, true]]]]],
[["i", "!=", ["map", [[2, true], [1, false]]]]],
[["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "includes", ["map", []]]],
[["i", "includes", ["map", [[0, true]]]]],
[["i", "includes", ["map", [[1, false]]]]],
[["i", "includes", ["map", [[0, true], [1, false]]]]],
[["i", "includes", ["map", [[2, true]]]]],
[["i", "includes", ["map", [[2, true], [0, true]]]]],
[["i", "includes", ["map", [[2, true], [1, false]]]]],
[["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "excludes", ["map", []]]],
[["i", "excludes", ["map", [[0, true]]]]],
[["i", "excludes", ["map", [[1, false]]]]],
[["i", "excludes", ["map", [[0, true], [1, false]]]]],
[["i", "excludes", ["map", [[2, true]]]]],
[["i", "excludes", ["map", [[2, true], [0, true]]]]],
[["i", "excludes", ["map", [[2, true], [1, false]]]]],
[["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "includes", ["map", [[0, true]]]],
["i", "includes", ["map", [[1, false]]]]]]' \
'[{"i": ["map", []]},
{"i": ["map", [[0, true]]]},
{"i": ["map", [[1, false]]]},
{"i": ["map", [[0, true], [1, false]]]},
{"i": ["map", [[2, true]]]},
{"i": ["map", [[2, true], [0, true]]]},
{"i": ["map", [[2, true], [1, false]]]},
{"i": ["map", [[2, true], [1, false], [0, true]]]}]']],
[dnl
condition 0: T---- ---
condition 1: -T--- ---
condition 2: --T-- ---
condition 3: ---T- ---
condition 4: ----T ---
condition 5: ----- T--
condition 6: ----- -T-
condition 7: ----- --T
condition 8: -TTTT TTT
condition 9: T-TTT TTT
condition 10: TT-TT TTT
condition 11: TTT-T TTT
condition 12: TTTT- TTT
condition 13: TTTTT -TT
condition 14: TTTTT T-T
condition 15: TTTTT TT-
condition 16: TTTTT TTT
condition 17: -T-T- T-T
condition 18: --TT- -TT
condition 19: ---T- --T
condition 20: ----T TTT
condition 21: ----- T-T
condition 22: ----- -TT
condition 23: ----- --T
condition 24: TTTTT TTT
condition 25: T-T-T -T-
condition 26: TT--T T--
condition 27: T---T ---
condition 28: TTTT- ---
condition 29: T-T-- ---
condition 30: TT--- ---
condition 31: T---- ---
condition 32: ---T- --T], [condition])
# This is the same as the "set" test except that it adds values,
# and those values don't always match.
OVSDB_CHECK_POSITIVE([evaluating conditions on maps (2)],
[[evaluate-conditions \
'{"columns": {"i": {"type": {"key": "integer",
"value": "boolean",
"min": 0,
"max": "unlimited"}}}}' \
'[[["i", "==", ["map", []]]],
[["i", "==", ["map", [[0, true]]]]],
[["i", "==", ["map", [[1, false]]]]],
[["i", "==", ["map", [[0, true], [1, false]]]]],
[["i", "==", ["map", [[2, true]]]]],
[["i", "==", ["map", [[2, true], [0, true]]]]],
[["i", "==", ["map", [[2, true], [1, false]]]]],
[["i", "==", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "!=", ["map", []]]],
[["i", "!=", ["map", [[0, true]]]]],
[["i", "!=", ["map", [[1, false]]]]],
[["i", "!=", ["map", [[0, true], [1, false]]]]],
[["i", "!=", ["map", [[2, true]]]]],
[["i", "!=", ["map", [[2, true], [0, true]]]]],
[["i", "!=", ["map", [[2, true], [1, false]]]]],
[["i", "!=", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "includes", ["map", []]]],
[["i", "includes", ["map", [[0, true]]]]],
[["i", "includes", ["map", [[1, false]]]]],
[["i", "includes", ["map", [[0, true], [1, false]]]]],
[["i", "includes", ["map", [[2, true]]]]],
[["i", "includes", ["map", [[2, true], [0, true]]]]],
[["i", "includes", ["map", [[2, true], [1, false]]]]],
[["i", "includes", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "excludes", ["map", []]]],
[["i", "excludes", ["map", [[0, true]]]]],
[["i", "excludes", ["map", [[1, false]]]]],
[["i", "excludes", ["map", [[0, true], [1, false]]]]],
[["i", "excludes", ["map", [[2, true]]]]],
[["i", "excludes", ["map", [[2, true], [0, true]]]]],
[["i", "excludes", ["map", [[2, true], [1, false]]]]],
[["i", "excludes", ["map", [[2, true], [1, false], [0, true]]]]],
[["i", "includes", ["map", [[0, true]]]],
["i", "includes", ["map", [[1, false]]]]]]' \
'[{"i": ["map", []]},
{"i": ["map", [[0, true]]]},
{"i": ["map", [[0, false]]]},
{"i": ["map", [[1, false]]]},
{"i": ["map", [[1, true]]]},
{"i": ["map", [[0, true], [1, false]]]},
{"i": ["map", [[0, true], [1, true]]]},
{"i": ["map", [[2, true]]]},
{"i": ["map", [[2, false]]]},
{"i": ["map", [[2, true], [0, true]]]},
{"i": ["map", [[2, false], [0, true]]]},
{"i": ["map", [[2, true], [1, false]]]},
{"i": ["map", [[2, true], [1, true]]]},
{"i": ["map", [[2, true], [1, false], [0, true]]]},
{"i": ["map", [[2, true], [1, false], [0, false]]]}]']],
[dnl
condition 0: T---- ----- -----
condition 1: -T--- ----- -----
condition 2: ---T- ----- -----
condition 3: ----- T---- -----
condition 4: ----- --T-- -----
condition 5: ----- ----T -----
condition 6: ----- ----- -T---
condition 7: ----- ----- ---T-
condition 8: -TTTT TTTTT TTTTT
condition 9: T-TTT TTTTT TTTTT
condition 10: TTT-T TTTTT TTTTT
condition 11: TTTTT -TTTT TTTTT
condition 12: TTTTT TT-TT TTTTT
condition 13: TTTTT TTTT- TTTTT
condition 14: TTTTT TTTTT T-TTT
condition 15: TTTTT TTTTT TTT-T
condition 16: TTTTT TTTTT TTTTT
condition 17: -T--- TT--T T--T-
condition 18: ---T- T---- -T-TT
condition 19: ----- T---- ---T-
condition 20: ----- --T-T -TTTT
condition 21: ----- ----T ---T-
condition 22: ----- ----- -T-TT
condition 23: ----- ----- ---T-
condition 24: TTTTT TTTTT TTTTT
condition 25: T-TTT --TT- -TT-T
condition 26: TTT-T -TTTT T-T--
condition 27: T-T-T --TT- --T--
condition 28: TTTTT TT-T- T----
condition 29: T-TTT ---T- -----
condition 30: TTT-T -T-T- T----
condition 31: T-T-T ---T- -----
condition 32: ----- T---- ---T-], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on optional integers],
[[evaluate-conditions \
'{"columns": {"i": {"type": {"key": "integer", "min": 0, "max": 1}}}}' \
'[[["i", "<", 1]],
[["i", "<=", 1]],
[["i", "==", 1]],
[["i", "!=", 1]],
[["i", ">=", 1]],
[["i", ">", 1]],
[["i", "includes", 1]],
[["i", "excludes", 1]],
[["i", ">", 0], ["i", "<", 2]],
[["i", "==", ["set", []]]],
[["i", "!=", ["set", []]]],
[["i", "includes", ["set", []]]],
[["i", "excludes", ["set", []]]]]' \
'[{"i": ["set", []]},
{"i": ["set", [0]]},
{"i": ["set", [1]]},
{"i": ["set", [2]]}]']],
[dnl
condition 0: -T--
condition 1: -TT-
condition 2: --T-
condition 3: TT-T
condition 4: --TT
condition 5: ---T
condition 6: --T-
condition 7: TT-T
condition 8: --T-
condition 9: T---
condition 10: -TTT
condition 11: TTTT
condition 12: TTTT], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on optional strings],
[[evaluate-conditions \
'{"columns": {"s": {"type": {"key": "string", "min": 0, "max": 1}}}}' \
'[[["s", "==", ""]],
[["s", "!=", ""]],
[["s", "includes", ""]],
[["s", "excludes", ""]],
[["s", "==", "foo"]],
[["s", "!=", "foo"]],
[["s", "includes", "foo"]],
[["s", "excludes", "foo"]],
[["s", "!=", "foo"], ["s", "!=", ""]]]' \
'[{"s": ["set", [""]]},
{"s": ["set", ["foo"]]},
{"s": ["set", ["xxx"]]},
{"s": ["set", []]}]']],
[dnl
condition 0: T---
condition 1: -TTT
condition 2: T---
condition 3: -TTT
condition 4: -T--
condition 5: T-TT
condition 6: -T--
condition 7: T-TT
condition 8: --TT], [condition])
OVSDB_CHECK_POSITIVE([evaluating conditions on optional reals],
[[evaluate-conditions \
'{"columns": {"r": {"type": {"key": "real", "min": 0, "max": 1}}}}' \
'[[["r", "<", 5.0]],
[["r", "<=", 5.0]],
[["r", "==", 5.0]],
[["r", "!=", 5.0]],
[["r", ">=", 5.0]],
[["r", ">", 5.0]],
[["r", "includes", 5.0]],
[["r", "excludes", 5.0]],
[["r", "!=", 0], ["r", "!=", 5.1]],
[["r", "==", ["set", []]]],
[["r", "!=", ["set", []]]],
[["r", "includes", ["set", []]]],
[["r", "excludes", ["set", []]]]]' \
'[{"r": ["set", [0]]},
{"r": ["set", [5.0]]},
{"r": ["set", [5.1]]},
{"r": ["set", []]}]']],
[dnl
condition 0: T---
condition 1: TT--
condition 2: -T--
condition 3: T-TT
condition 4: -TT-
condition 5: --T-
condition 6: -T--
condition 7: T-TT
condition 8: -T-T
condition 9: ---T
condition 10: TTT-
condition 11: TTTT
condition 12: TTTT], [condition])
OVSDB_CHECK_POSITIVE([evaluating false boolean condition],
[[evaluate-conditions-any \
'{"columns": {"i": {"type": "integer"}}}' \
'[[false,["i","==",1]]]' \
'[{"i": 0},
{"i": 1},
{"i": 2}']]],
[condition 0: -T-])
OVSDB_CHECK_POSITIVE([evaluating true boolean condition],
[[evaluate-conditions-any \
'{"columns": {"i": {"type": "integer"}}}' \
'[[true,["i","==",1]]]' \
'[{"i": 0},
{"i": 1},
{"i": 2}']]],
[condition 0: TTT])
OVSDB_CHECK_POSITIVE([compare condition],
[[compare-conditions \
'{"columns": {"i": {"type": "integer"}}}' \
'[[true,["i","==",1],["i","==",2],["i","==",3]],
[["i","==",1],["i","==",3],["i","==",2],true],
[["i","==",1]],
[["i",">=",1]]']]],
[condition 0-1: 0
condition 1-2: 1
condition 2-3: -1])
|