1 AT_BANNER([OVSDB -- triggers])
3 # This is like OVSDB_CHECK_POSITIVE, except that UUIDs in the output
4 # are replaced by markers of the form <N> where N is a number. The
5 # first unique UUID is replaced by <0>, the next by <1>, and so on.
6 # If a given UUID appears more than once it is always replaced by the
8 m4_define([OVSDB_CHECK_TRIGGER],
10 AT_KEYWORDS([ovsdb execute execution trigger positive $4])
11 OVS_CHECK_LCOV([test-ovsdb trigger $2], [0], [stdout], [])
12 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [$3])
15 OVSDB_CHECK_TRIGGER([trigger fires immediately],
19 "row": {"number": 0, "name": "zero"}},
22 "row": {"number": 1, "name": "one"}},
27 "columns": ["name", "number"],
29 "rows": [{"name": "zero", "number": 0},
30 {"name": "one", "number": 1}]},
33 "row": {"number": 2, "name": "two"}}]']],
34 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{},{"uuid":["uuid","<2>"]}]
37 OVSDB_CHECK_TRIGGER([trigger times out],
41 "row": {"number": 0, "name": "zero"}},
44 "row": {"number": 1, "name": "one"}},
49 "columns": ["name", "number"],
51 "rows": [{"name": "zero", "number": 0},
52 {"name": "one", "number": 1},
53 {"name": "two", "number": 2}]}]' \
56 t=10: trigger 0 (delayed): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"wait\" timed out after 10 ms","error":"timed out"}]
59 OVSDB_CHECK_TRIGGER([trigger fires after delay],
63 "row": {"number": 0, "name": "zero"}},
66 "row": {"number": 1, "name": "one"}}]' \
72 "columns": ["name", "number"],
74 "rows": [{"name": "zero", "number": 0},
75 {"name": "one", "number": 1},
76 {"name": "two", "number": 2}]}]' \
80 "row": {"number": 2, "name": "two"}}]']],
81 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
83 t=10: trigger 2 (immediate): [{"uuid":["uuid","<2>"]}]
84 t=10: trigger 1 (delayed): [{}]
87 OVSDB_CHECK_TRIGGER([delayed trigger modifies database],
91 "row": {"number": 0, "name": "zero"}},
94 "row": {"number": 1, "name": "one"}}]' \
100 "columns": ["name", "number"],
102 "rows": [{"name": "zero", "number": 0},
103 {"name": "one", "number": 1},
104 {"name": "two", "number": 2}]},
107 "where": [["number", "<", 2]]}]' \
111 "row": {"number": 2, "name": "two"}}]' \
116 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
118 t=10: trigger 2 (immediate): [{"uuid":["uuid","<2>"]}]
119 t=10: trigger 1 (delayed): [{},{"count":2}]
120 t=15: trigger 3 (immediate): [{"rows":[{"_uuid":["uuid","<2>"],"_version":["uuid","<3>"],"name":"two","number":2}]}]
123 OVSDB_CHECK_TRIGGER([one delayed trigger wakes up another],
127 "row": {"number": 0, "name": "zero"}},
130 "row": {"number": 1, "name": "one"}}]' \
136 "columns": ["name", "number"],
138 "rows": [{"name": "two", "number": 2}]},
141 "where": [["number", "==", 2]]},
144 "row": {"number": 3, "name": "three"}}]' \
149 "columns": ["name", "number"],
151 "rows": [{"name": "zero", "number": 0},
152 {"name": "one", "number": 1},
153 {"name": "two", "number": 2}]},
156 "where": [["number", "<", 2]]}]' \
160 "row": {"number": 2, "name": "two"}}]' \
165 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
168 t=10: trigger 3 (immediate): [{"uuid":["uuid","<2>"]}]
169 t=10: trigger 2 (delayed): [{},{"count":2}]
170 t=15: trigger 1 (delayed): [{},{"count":1},{"uuid":["uuid","<3>"]}]
171 t=15: trigger 4 (immediate): [{"rows":[{"_uuid":["uuid","<3>"],"_version":["uuid","<4>"],"name":"three","number":3}]}]