summaryrefslogtreecommitdiff
path: root/tests/ovsdb-idl.at
blob: d28dfc11e78626efb5e888c7fb74ef2b3e5b8443 (plain)
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
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
AT_BANNER([OVSDB -- interface description language (IDL)])

m4_divert_text([PREPARE_TESTS], [
# ovsdb_start_idltest [REMOTE] [SCHEMA]
#
# Creates a database using SCHEMA (default: idltest.ovsschema) and
# starts a database server listening on punix:socket and REMOTE (if
# specified).
ovsdb_start_idltest () {
    ovsdb-tool create db ${2:-$abs_srcdir/idltest.ovsschema} || return $?
    ovsdb-server -vconsole:warn --log-file --detach --no-chdir --pidfile --remote=punix:socket ${1:+--remote=$1} db || return $?
    on_exit 'kill `cat ovsdb-server.pid`'
}
])

# OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS],
#                   [FILTER])
#
# Creates a database with a schema derived from idltest.ovsidl, runs
# each PRE-IDL-TXN (if any), starts an ovsdb-server on that database,
# and runs "test-ovsdb idl" passing each of the TRANSACTIONS along.
#
# Checks that the overall output is OUTPUT.  Before comparison, the
# output is sorted (using "sort") and UUIDs in the output are replaced
# by markers of the form <N> where N is a number.  The first unique
# UUID is replaced by <0>, the next by <1>, and so on.  If a given
# UUID appears more than once it is always replaced by the same
# marker.  If FILTER is supplied then the output is also filtered
# through the specified program.
#
# TITLE is provided to AT_SETUP and KEYWORDS to AT_KEYWORDS.
m4_define([OVSDB_CHECK_IDL_C],
  [AT_SETUP([$1 - C])
   AT_KEYWORDS([ovsdb server idl positive $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

# same as OVSDB_CHECK_IDL but uses the Python IDL implementation.
m4_define([OVSDB_CHECK_IDL_PYN],
  [AT_SETUP([$1])
   AT_SKIP_IF([test $7 = no])
   AT_KEYWORDS([ovsdb server idl positive Python $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_PY],
   [OVSDB_CHECK_IDL_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON], [$PYTHON])
    OVSDB_CHECK_IDL_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON3], [$PYTHON3])])

m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN],
  [AT_SETUP([$1 - register_columns])
   AT_SKIP_IF([test $7 = no])
   AT_KEYWORDS([ovsdb server idl positive Python register_columns $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1 $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY],
   [OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON], [$PYTHON])
    OVSDB_CHECK_IDL_REGISTER_COLUMNS_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON3], [$PYTHON3])])

# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp
m4_define([OVSDB_CHECK_IDL_TCP_PYN],
  [AT_SETUP([$1 - tcp])
   AT_SKIP_IF([test $7 = no])
   AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
   AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
   PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])

   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact tcp:127.0.0.1:$TCP_PORT $2], [0], [ignore], [ignore])])
   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:127.0.0.1:$TCP_PORT $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_TCP_PY],
   [OVSDB_CHECK_IDL_TCP_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON], [$PYTHON])
    OVSDB_CHECK_IDL_TCP_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON3], [$PYTHON3])])

# same as OVSDB_CHECK_IDL but uses the Python IDL implementation with tcp6
m4_define([OVSDB_CHECK_IDL_TCP6_PYN],
  [AT_SETUP([$1 - tcp6])
   AT_SKIP_IF([test $7 = no])
   AT_SKIP_IF([test "$IS_WIN32" = "yes"])
   AT_SKIP_IF([test $HAVE_IPV6 = no])
   AT_KEYWORDS([ovsdb server idl positive Python with tcp6 socket $5])
   AT_CHECK([ovsdb_start_idltest "ptcp:0:[[::1]]"])
   PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
   echo "TCP_PORT=$TCP_PORT"

   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact "tcp:[[::1]]:$TCP_PORT" $2], [0], [ignore], [ignore])])
   AT_CHECK([$8 $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema tcp:[[::1]]:$TCP_PORT $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_TCP6_PY],
   [OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python2], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON], [$PYTHON])
    OVSDB_CHECK_IDL_TCP6_PYN([$1 - Python3], [$2], [$3], [$4], [$5], [$6],
                        [$HAVE_PYTHON3], [$PYTHON3])])

m4_define([OVSDB_CHECK_IDL],
  [OVSDB_CHECK_IDL_C($@)
   OVSDB_CHECK_IDL_PY($@)
   OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY($@)
   OVSDB_CHECK_IDL_TCP_PY($@)
   OVSDB_CHECK_IDL_TCP6_PY($@)])

# This test uses the Python IDL implementation with passive tcp
m4_define([OVSDB_CHECK_IDL_PASSIVE_TCP_PY],
  [AT_SETUP([$1 - Python ptcp])
   AT_SKIP_IF([test $HAVE_PYTHON = no])
   AT_KEYWORDS([ovsdb server idl positive Python with tcp socket $5])
   # find free TCP port
   AT_CHECK([ovsdb_start_idltest "ptcp:0:127.0.0.1"])
   PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
   OVSDB_SERVER_SHUTDOWN
   rm -f db

   # start OVSDB server in passive mode
   AT_CHECK([ovsdb_start_idltest "tcp:127.0.0.1:$TCP_PORT"])
   AT_CHECK([$PYTHON $srcdir/test-ovsdb.py -t10 idl_passive $srcdir/idltest.ovsschema ptcp:127.0.0.1:$TCP_PORT $3],
      [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP
   ])

OVSDB_CHECK_IDL_PASSIVE_TCP_PY([simple passive idl, initially empty, select empty],
  [],
  [['["idltest",{"op":"select","table":"link1","where":[]}]']],
  [[000: empty
001: {"error":null,"result":[{"rows":[]}]}
002: done
]])

OVSDB_CHECK_IDL([simple idl, initially empty, no ops],
  [],
  [],
  [000: empty
001: done
])

OVSDB_CHECK_IDL([simple idl, initially empty, various ops],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": true}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"r": 123.5}}]' \
    '["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": -1,
               "r": 125,
               "b": false,
               "s": "",
               "ia": ["set", [1]],
               "ra": ["set", [1.5]],
               "ba": ["set", [false]],
               "sa": ["set", []],
               "ua": ["set", []]}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [["i", "<", 1]],
       "row": {"s": "newstring"}}]' \
    '["idltest",
      {"op": "delete",
       "table": "simple",
       "where": [["i", "==", 0]]}]' \
    'reconnect']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
003: {"error":null,"result":[{"count":2}]}
004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
005: {"error":null,"result":[{"count":2}]}
006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
009: {"error":null,"result":[{"count":2}]}
010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
011: {"error":null,"result":[{"count":1}]}
012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
013: reconnect
014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
015: done
]])

OVSDB_CHECK_IDL([simple idl, initially populated],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": true}}]']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
001: {"error":null,"result":[{"count":2}]}
002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
003: done
]])

OVSDB_CHECK_IDL([simple idl, writing via IDL],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \
    'insert 2, verify 2 i, verify 1 b, delete 1']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
001: commit, status=success
002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5>
003: commit, status=success
004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6>
005: done
]])

OVSDB_CHECK_IDL([simple idl, handling verification failure],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['set 0 b 1' \
    '+["idltest",
       {"op": "update",
        "table": "simple",
        "where": [["i", "==", 1]],
        "row": {"r": 5.0}}]' \
    '+verify 1 r, set 1 r 3' \
    'verify 1 r, set 1 r 3' \
    ]],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
001: commit, status=success
002: {"error":null,"result":[{"count":1}]}
003: commit, status=try again
004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
005: commit, status=success
006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
007: done
]])

OVSDB_CHECK_IDL([simple idl, increment operation],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['set 0 r 2.0, increment 0']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
001: commit, status=success, increment=1
002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
003: done
]])

OVSDB_CHECK_IDL([simple idl, aborting],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['set 0 r 2.0, abort' \
'+set 0 b 1']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
001: commit, status=aborted
002: commit, status=success
003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: done
]])

OVSDB_CHECK_IDL([simple idl, destroy without commit or abort],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['set 0 r 2.0, destroy' \
'+set 0 b 1']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
001: destroy
002: commit, status=success
003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, false condition],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}}]']],
  [['condition simple []' \
    'condition simple [true]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, true condition],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}}]']],
  [['condition simple []' \
    'condition simple [true]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}},
       {"op": "insert",
       "table": "simple",
       "row": {"i": 2,
               "r": 3.0,
               "b": true}}]']],
  [['condition simple []' \
    'condition simple [["i","==",1],["i","==",2]]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
003: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
004: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}}]']],
  [['condition simple []' \
    'condition simple [["i","==",1]]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}}]']],
  [['condition simple []' \
    'condition simple [["i","==",1],["i","==",2]]' \
    'condition simple [["i","==",2]]' \
    '["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 2,
               "r": 3.0,
               "b": true}}]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: change conditions
005: empty
006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]}
007: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
008: done
]])

OVSDB_CHECK_IDL([simple idl, conditional, multiple tables],
  [['["idltest",
       {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true}},
       {"op": "insert",
       "table": "link1",
       "row": {"i": 0, "k": ["named-uuid", "self"]},
       "uuid-name": "self"},
        {"op": "insert",
       "table": "link2",
       "row": {"i": 2},
       "uuid-name": "row0"}]']],
  [['condition simple [];link1 [];link2 []' \
    'condition simple [["i","==",1]]' \
    'condition link1 [["i","==",0]]' \
    'condition link2 [["i","==",3]]' \
    '+["idltest",
       {"op": "insert",
       "table": "link2",
       "row": {"i": 3},
        "uuid-name": "row0"}]']],
  [[000: change conditions
001: empty
002: change conditions
003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: change conditions
005: i=0 k=0 ka=[] l2= uuid=<2>
005: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: change conditions
007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]}
008: i=0 k=0 ka=[] l2= uuid=<2>
008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
008: i=3 l1= uuid=<3>
009: done
]])

OVSDB_CHECK_IDL([self-linking idl, consistent ops],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 0, "k": ["named-uuid", "self"]},
       "uuid-name": "self"}]' \
    '["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 1, "k": ["named-uuid", "row2"]},
       "uuid-name": "row1"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 2, "k": ["named-uuid", "row1"]},
       "uuid-name": "row2"}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [["i", "==", 1]],
       "row": {"k": ["uuid", "#1#"]}}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [],
       "row": {"k": ["uuid", "#0#"]}}]']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
002: i=0 k=0 ka=[] l2= uuid=<0>
003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
004: i=0 k=0 ka=[] l2= uuid=<0>
004: i=1 k=2 ka=[] l2= uuid=<1>
004: i=2 k=1 ka=[] l2= uuid=<2>
005: {"error":null,"result":[{"count":1}]}
006: i=0 k=0 ka=[] l2= uuid=<0>
006: i=1 k=1 ka=[] l2= uuid=<1>
006: i=2 k=1 ka=[] l2= uuid=<2>
007: {"error":null,"result":[{"count":3}]}
008: i=0 k=0 ka=[] l2= uuid=<0>
008: i=1 k=0 ka=[] l2= uuid=<1>
008: i=2 k=0 ka=[] l2= uuid=<2>
009: done
]])

OVSDB_CHECK_IDL([self-linking idl, inconsistent ops],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 0, "k": ["uuid", "cf197cc5-c8c9-42f5-82d5-c71a9f2cb96b"]}}]' \
    '+["idltest",
      {"op": "insert",
       "table": "link1",
       "uuid-name": "one",
       "row": {"i": 1, "k": ["named-uuid", "one"]}},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 2, "k": ["named-uuid", "one"]}}]' \
     '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [],
       "row": {"k": ["uuid", "c2fca39a-e69a-42a4-9c56-5eca85839ce9"]}}]' \
     '+["idltest",
      {"op": "delete",
       "table": "link1",
       "where": [["_uuid", "==", ["uuid", "#1#"]]]}]' \
     '+["idltest",
      {"op": "delete",
       "table": "link1",
       "where": [["_uuid", "==", ["uuid", "#2#"]]]}]' \
     '["idltest",
      {"op": "delete",
       "table": "link1",
       "where": []}]' \
]],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"details":"Table link1 column k row <0> references nonexistent row <1> in table link1.","error":"referential integrity violation"}]}
002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
003: i=1 k=1 ka=[] l2= uuid=<2>
003: i=2 k=1 ka=[] l2= uuid=<3>
004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row <x> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]}
006: {"error":null,"result":[{"count":1}]}
007: i=1 k=1 ka=[] l2= uuid=<2>
008: {"error":null,"result":[{"count":1}]}
009: empty
010: done
]],
  [],
  [[sed -e '/004:/s/row <[23]> references/row <x> references/']])

OVSDB_CHECK_IDL([self-linking idl, sets],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 0, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i0"]]]},
       "uuid-name": "i0"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 1, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i1"]]]},
       "uuid-name": "i1"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 2, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i2"]]]},
       "uuid-name": "i2"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 3, "k": ["named-uuid", "i0"], "ka": ["set", [["named-uuid", "i3"]]]},
       "uuid-name": "i3"}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [],
       "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "#1#"], ["uuid", "#2#"], ["uuid", "#3#"]]]}}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [["i", "==", 2]],
       "row": {"ka": ["set", [["uuid", "#0#"], ["uuid", "88702e78-845b-4a6e-ad08-cf68922ae84a"], ["uuid", "#2#"]]]}}]' \
    '+["idltest",
      {"op": "delete",
       "table": "link1",
       "where": []}]']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]}
002: i=0 k=0 ka=[0] l2= uuid=<0>
002: i=1 k=0 ka=[1] l2= uuid=<1>
002: i=2 k=0 ka=[2] l2= uuid=<2>
002: i=3 k=0 ka=[3] l2= uuid=<3>
003: {"error":null,"result":[{"count":4}]}
004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0>
004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1>
004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2>
004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3>
005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]}
006: {"error":null,"result":[{"count":4}]}
007: empty
008: done
]])

OVSDB_CHECK_IDL([external-linking idl, consistent ops],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "link2",
       "row": {"i": 0},
       "uuid-name": "row0"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 1, "k": ["named-uuid", "row1"], "l2": ["set", [["named-uuid", "row0"]]]},
       "uuid-name": "row1"}]']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: i=0 l1= uuid=<0>
002: i=1 k=1 ka=[] l2=0 uuid=<1>
003: done
]])

OVSDB_CHECK_IDL_PY([external-linking idl, insert ops],
  [],
  [['linktest']],
  [[000: empty
001: commit, status=success
002: i=1 k=1 ka=[1] l2= uuid=<0>
002: i=2 k=1 ka=[1 2] l2= uuid=<1>
003: done
]])

OVSDB_CHECK_IDL_PY([getattr idl, insert ops],
  [],
  [['getattrtest']],
  [[000: empty
001: commit, status=success
002: i=2 k=2 ka=[] l2= uuid=<0>
003: done
]])

OVSDB_CHECK_IDL_PY([row-from-json idl, whats this],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']],
  [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
001: commit, status=success, events=create|2|None, delete|0|None, update|1|b
002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2>
002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>
003: done
]])

AT_SETUP([idl handling of missing tables and columns - C])
AT_KEYWORDS([ovsdb server idl positive])

# idltest2.ovsschema is the same as idltest.ovsschema, except that
# table link2 and column l2 have been deleted.  But the IDL still
# expects them to be there, so this test checks that it properly
# tolerates them being missing.
AT_CHECK([ovsdb_start_idltest "" "$abs_srcdir/idltest2.ovsschema"])
AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl unix:socket ['["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 0, "k": ["named-uuid", "self"]},
       "uuid-name": "self"}]' \
    '["idltest",
      {"op": "insert",
       "table": "link1",
       "row": {"i": 1, "k": ["named-uuid", "row2"]},
       "uuid-name": "row1"},
      {"op": "insert",
       "table": "link1",
       "row": {"i": 2, "k": ["named-uuid", "row1"]},
       "uuid-name": "row2"}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [["i", "==", 1]],
       "row": {"k": ["uuid", "#1#"]}}]' \
    '["idltest",
      {"op": "update",
       "table": "link1",
       "where": [],
       "row": {"k": ["uuid", "#0#"]}}]']],
	 [0], [stdout], [stderr])
AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl], [0],
    [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]}
002: i=0 k=0 ka=[] l2= uuid=<0>
003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]}
004: i=0 k=0 ka=[] l2= uuid=<0>
004: i=1 k=2 ka=[] l2= uuid=<1>
004: i=2 k=1 ka=[] l2= uuid=<2>
005: {"error":null,"result":[{"count":1}]}
006: i=0 k=0 ka=[] l2= uuid=<0>
006: i=1 k=1 ka=[] l2= uuid=<1>
006: i=2 k=1 ka=[] l2= uuid=<2>
007: {"error":null,"result":[{"count":3}]}
008: i=0 k=0 ka=[] l2= uuid=<0>
008: i=1 k=0 ka=[] l2= uuid=<1>
008: i=2 k=0 ka=[] l2= uuid=<2>
009: done
]])

# Check that ovsdb-idl figured out that table link2 and column l2 are missing.
AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl
test-ovsdb|ovsdb_idl|idltest database lacks link2 table (database needs upgrade?)
test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?)
])

# Check that ovsdb-idl sent on "monitor" request and that it didn't
# mention that table or column, and (for paranoia) that it did mention another
# table and column.
AT_CHECK([grep -c '"monitor\|monitor_cond"' stderr], [0], [1
])
AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep link2], [1])
AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep l2], [1])
AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"link1"'], [0], [1
])
AT_CHECK([grep '"monitor\|monitor_cond"' stderr | grep -c '"ua"'], [0], [1
])
OVSDB_SERVER_SHUTDOWN
AT_CLEANUP

m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS_PY],
  [AT_SETUP([$1 - Python fetch])
   AT_SKIP_IF([test $HAVE_PYTHON = no])
   AT_KEYWORDS([ovsdb server idl positive Python increment fetch $6])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([$PYTHON $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket [$3] $4],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$7],,, [[| $7]]),
            [0], [$5])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_FETCH_COLUMNS],
   [OVSDB_CHECK_IDL_FETCH_COLUMNS_PY($@)])

OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [?simple:i,r!],
  ['fetch 0 r'],
  [[000: i=0 uuid=<0>
000: i=1 uuid=<1>
001: commit, status=success
002: i=0 r=0 uuid=<0>
002: i=1 uuid=<1>
003: done
]])

m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND_PY],
  [AT_SETUP([$1 - Python])
   AT_SKIP_IF([test $HAVE_PYTHON = no])
   AT_KEYWORDS([ovsdb server idl Python monitor $4])
   AT_CHECK([ovsdb_start_idltest])
   AT_CHECK([ovs-appctl -t ovsdb-server ovsdb-server/disable-monitor-cond])
   AT_CHECK([$PYTHON $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
            [0], [stdout], [ignore], [kill `cat pid`])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
            [0], [$3], [], [kill `cat pid`])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])


m4_define([OVSDB_CHECK_IDL_WO_MONITOR_COND],
   [OVSDB_CHECK_IDL_WO_MONITOR_COND_PY($@)])


OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": true}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"r": 123.5}}]' \
    '["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": -1,
               "r": 125,
               "b": false,
               "s": "",
               "ia": ["set", [1]],
               "ra": ["set", [1.5]],
               "ba": ["set", [false]],
               "sa": ["set", []],
               "ua": ["set", []]}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [["i", "<", 1]],
       "row": {"s": "newstring"}}]' \
    '["idltest",
      {"op": "delete",
       "table": "simple",
       "where": [["i", "==", 0]]}]' \
    'reconnect']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
003: {"error":null,"result":[{"count":2}]}
004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
005: {"error":null,"result":[{"count":2}]}
006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
009: {"error":null,"result":[{"count":2}]}
010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
011: {"error":null,"result":[{"count":1}]}
012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
013: reconnect
014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
015: done
]])

m4_define([OVSDB_CHECK_IDL_TRACK_C],
  [AT_SETUP([$1 - C])
   AT_KEYWORDS([ovsdb server idl tracking positive $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl unix:socket $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_TRACK],
  [OVSDB_CHECK_IDL_TRACK_C($@)])

OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]']],
  [['["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": true}}]']],
  [[000: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3>
000: updated columns: b ba i ia r ra s sa u ua
001: {"error":null,"result":[{"count":2}]}
002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5>
002: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3>
002: updated columns: b
003: done
]])

OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops],
  [],
  [['["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": true}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"r": 123.5}}]' \
    '["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": -1,
               "r": 125,
               "b": false,
               "s": "",
               "ia": ["set", [1]],
               "ra": ["set", [1.5]],
               "ba": ["set", [false]],
               "sa": ["set", []],
               "ua": ["set", []]}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [["i", "<", 1]],
       "row": {"s": "newstring"}}]' \
    '["idltest",
      {"op": "delete",
       "table": "simple",
       "where": [["i", "==", 0]]}]' \
    'reconnect']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
002: updated columns: b ba i ia r ra s sa u ua
003: {"error":null,"result":[{"count":2}]}
004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: updated columns: b
005: {"error":null,"result":[{"count":2}]}
006: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
006: updated columns: r
006: updated columns: r
007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
008: updated columns: ba i ia r ra
009: {"error":null,"result":[{"count":2}]}
010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
010: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
010: updated columns: s
010: updated columns: s
011: {"error":null,"result":[{"count":1}]}
012: ##deleted## uuid=<1>
013: reconnect
014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
014: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0>
014: updated columns: b ba i ia r ra s sa u ua
014: updated columns: ba i ia r ra s
015: done
]])

m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN],
  [AT_SETUP([$1 - C])
   AT_KEYWORDS([ovsdb server idl partial update map column positive $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-map-column unix:socket $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

OVSDB_CHECK_IDL_PARTIAL_UPDATE_MAP_COLUMN([map, simple2 idl-partial-update-map-column, initially populated],
[['["idltest", {"op":"insert", "table":"simple2",
                "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
],
[],
[[000: Getting records
001: name=myString1 smap=[[key1 : value1],[key2 : value2]] imap=[]
002: After insert element
003: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
004: After insert duplicated element
005: name=String2 smap=[[key1 : myList1],[key2 : value2]] imap=[[3 : myids2]]
006: After delete element
007: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
008: After trying to delete a deleted element
009: name=String2 smap=[[key2 : value2]] imap=[[3 : myids2]]
010: End test
]])

OVSDB_CHECK_IDL_PY([partial-map idl],
[['["idltest", {"op":"insert", "table":"simple2",
                "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]']
],
  [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapinsertmultipleelements' 'partialmapdelelements' 'partialmapmutatenew'],
[[000: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[]
001: commit, status=success
002: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)]
003: commit, status=success
004: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)]
005: commit, status=success
006: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
007: commit, status=success
008: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)]
008: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[]
009: done
]])

m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN],
  [AT_SETUP([$1 - C])
   AT_KEYWORDS([ovsdb server idl partial update set column positive $5])
   AT_CHECK([ovsdb_start_idltest])
   m4_if([$2], [], [],
     [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])])
   AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 -c idl-partial-update-set-column unix:socket $3],
            [0], [stdout], [ignore])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$6],,, [[| $6]]),
            [0], [$4])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-column, initially populated],
[['["idltest", {"op":"insert", "table":"simple3",
                "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ], [ "uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff" ]]]} }]']
],
[],
[[000: Getting records
001: name=mySet1 uset=[[<0>],[<1>]] uref=[]
002: After rename+add new value
003: name=String2 uset=[[<0>],[<1>],[<2>]] uref=[]
004: After add new value
005: name=String2 uset=[[<0>],[<1>],[<2>],[<3>]] uref=[]
006: After delete value
007: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
008: After trying to delete a deleted value
009: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[]
010: After add to other table + set of strong ref
011: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[[<4>]]
012: End test
]])

OVSDB_CHECK_IDL_PY([partial-set idl],
[['["idltest", {"op":"insert", "table":"simple3", "uuid-name":"newrow",
                    "row":{"name":"mySet1","uset":["set", [[ "uuid", "0005b872-f9e5-43be-ae02-3184b9680e75" ]]]} },
               {"op":"insert", "table":"simple4", "row":{"name":"seed"}},
               {"op":"mutate", "table":"simple3", "where":[["_uuid", "==", ["named-uuid", "newrow"]]],
                    "mutations": [["uset", "insert", ["set", [["uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff"]]]]]}]']
],
  ['partialrenamesetadd' 'partialduplicateadd' 'partialsetdel' 'partialsetref' 'partialsetoverrideops' 'partialsetadddelete' 'partialsetmutatenew'],
[[000: name=mySet1 uset=[<0> <1>]
001: commit, status=success
002: name=String2 uset=[<0> <1> <2>]
003: commit, status=success
004: name=String2 uset=[<0> <1> <2> <3>]
005: commit, status=success
006: name=String2 uset=[<0> <1> <3>]
007: commit, status=success
008: name=String2 uset=[<0> <1> <3>]
009: commit, status=success
010: name=String2 uset=[<3>]
011: commit, status=success
012: name=String2 uset=[<4> <5>]
013: commit, status=success
014: name=String2 uset=[<4> <5>]
014: name=String3 uset=[<6>]
015: done
]])

m4_define([OVSDB_CHECK_IDL_NOTIFY_PY],
  [AT_SETUP([$1 - Python])
   AT_SKIP_IF([test $HAVE_PYTHON = no])
   AT_KEYWORDS([ovsdb server idl Python notify $4])
   AT_CHECK([ovsdb_start_idltest])
   AT_CHECK([$PYTHON $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema unix:socket $2],
            [0], [stdout], [ignore], [kill `cat pid`])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
            [0], [$3], [], [kill `cat pid`])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

# This test uses the Python IDL implementation with ssl
m4_define([OVSDB_CHECK_IDL_NOTIFY_SSL_PY],
  [AT_SETUP([$1 - SSL])
   AT_SKIP_IF([test "$HAVE_OPENSSL" = no])
   AT_SKIP_IF([test $HAVE_PYTHON = no])
   $PYTHON -m OpenSSL.SSL
   SSL_PRESENT=$?
   AT_SKIP_IF([test $SSL_PRESENT != 0])
   AT_KEYWORDS([ovsdb server idl Python notify - ssl socket])
   AT_CHECK([ovsdb-tool create db $abs_srcdir/idltest.ovsschema],
             [0], [stdout], [ignore])
   PKIDIR=$abs_top_builddir/tests
   AT_CHECK([ovsdb-server -vconsole:warn --log-file --detach --no-chdir \
             --pidfile \
             --private-key=$PKIDIR/testpki-privkey2.pem \
             --certificate=$PKIDIR/testpki-cert2.pem \
             --ca-cert=$PKIDIR/testpki-cacert.pem \
             --remote=pssl:0:127.0.0.1 db])
   on_exit 'kill `cat ovsdb-server.pid`'
   PARSE_LISTENING_PORT([ovsdb-server.log], [TCP_PORT])
   AT_CHECK([$PYTHON $srcdir/test-ovsdb.py  -t10 idl $srcdir/idltest.ovsschema \
             ssl:127.0.0.1:$TCP_PORT $PKIDIR/testpki-privkey.pem \
             $PKIDIR/testpki-cert.pem $PKIDIR/testpki-cacert.pem $2],
            [0], [stdout], [ignore], [kill `cat pid`])
   AT_CHECK([sort stdout | ${PERL} $srcdir/uuidfilt.pl]m4_if([$5],,, [[| $5]]),
            [0], [$3], [], [kill `cat pid`])
   OVSDB_SERVER_SHUTDOWN
   AT_CLEANUP])

m4_define([OVSDB_CHECK_IDL_NOTIFY],
   [OVSDB_CHECK_IDL_NOTIFY_PY($@)
    OVSDB_CHECK_IDL_NOTIFY_SSL_PY($@)])

OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify],
  [['track-notify' \
    '["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": 1,
               "r": 2.0,
               "b": true,
               "s": "mystring",
               "u": ["uuid", "84f5c8f5-ac76-4dbc-a24f-8860eb407fc1"],
               "ia": ["set", [1, 2, 3]],
               "ra": ["set", [-0.5]],
               "ba": ["set", [true]],
               "sa": ["set", ["abc", "def"]],
               "ua": ["set", [["uuid", "69443985-7806-45e2-b35f-574a04e720f9"],
                              ["uuid", "aad11ef0-816a-4b01-93e6-03b8b4256b98"]]]}},
      {"op": "insert",
       "table": "simple",
       "row": {}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"b": false}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [],
       "row": {"r": 123.5}}]' \
    '["idltest",
      {"op": "insert",
       "table": "simple",
       "row": {"i": -1,
               "r": 125,
               "b": false,
               "s": "",
               "ia": ["set", [1]],
               "ra": ["set", [1.5]],
               "ba": ["set", [false]],
               "sa": ["set", []],
               "ua": ["set", []]}}]' \
    '["idltest",
      {"op": "update",
       "table": "simple",
       "where": [["i", "<", 1]],
       "row": {"s": "newstring"}}]' \
    '["idltest",
      {"op": "delete",
       "table": "simple",
       "where": [["i", "==", 0]]}]' \
    'reconnect']],
  [[000: empty
001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]}
002: event:create, row={i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
002: event:create, row={i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates=None
002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
003: {"error":null,"result":[{"count":2}]}
004: event:update, row={i=1 r=2 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates={b=true uuid=<0>}
004: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
004: i=1 r=2 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
005: {"error":null,"result":[{"count":2}]}
006: event:update, row={i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates={r=0 uuid=<1>}
006: event:update, row={i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates={r=2 uuid=<0>}
006: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
006: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]}
008: event:create, row={i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates=None
008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
008: i=0 r=123.5 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
008: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
009: {"error":null,"result":[{"count":2}]}
010: event:update, row={i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates={s= uuid=<6>}
010: event:update, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates={s= uuid=<1>}
010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
010: i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>
010: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
011: {"error":null,"result":[{"count":1}]}
012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1>}, updates=None
012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
012: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
013: reconnect
014: event:create, row={i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>}, updates=None
014: event:create, row={i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>}, updates=None
014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6>
014: i=1 r=123.5 b=false s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0>
015: done
]])