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 AT_CHECK([test-ovsdb trigger $2], [0], [stdout], [])
12 AT_CHECK([perl $srcdir/uuidfilt.pl stdout], [0], [$3])
15 OVSDB_CHECK_TRIGGER([trigger fires immediately],
16 ["`ordinal_schema`" [\
20 "row": {"number": 0, "name": "zero"}},
23 "row": {"number": 1, "name": "one"}},
28 "columns": ["name", "number"],
30 "rows": [{"name": "zero", "number": 0},
31 {"name": "one", "number": 1}]},
34 "row": {"number": 2, "name": "two"}}]']],
35 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{},{"uuid":["uuid","<2>"]}]
38 OVSDB_CHECK_TRIGGER([trigger times out],
39 ["`ordinal_schema`" [\
43 "row": {"number": 0, "name": "zero"}},
46 "row": {"number": 1, "name": "one"}},
51 "columns": ["name", "number"],
53 "rows": [{"name": "zero", "number": 0},
54 {"name": "one", "number": 1},
55 {"name": "two", "number": 2}]}]' \
58 t=10: trigger 0 (delayed): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"details":"\"wait\" timed out after 10 ms","error":"timed out"}]
61 OVSDB_CHECK_TRIGGER([trigger fires after delay],
62 ["`ordinal_schema`" [\
66 "row": {"number": 0, "name": "zero"}},
69 "row": {"number": 1, "name": "one"}}]' \
76 "columns": ["name", "number"],
78 "rows": [{"name": "zero", "number": 0},
79 {"name": "one", "number": 1},
80 {"name": "two", "number": 2}]}]' \
85 "row": {"number": 2, "name": "two"}}]']],
86 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
88 t=10: trigger 2 (immediate): [{"uuid":["uuid","<2>"]}]
89 t=10: trigger 1 (delayed): [{}]
92 OVSDB_CHECK_TRIGGER([delayed trigger modifies database],
93 ["`ordinal_schema`" [\
97 "row": {"number": 0, "name": "zero"}},
100 "row": {"number": 1, "name": "one"}}]' \
107 "columns": ["name", "number"],
109 "rows": [{"name": "zero", "number": 0},
110 {"name": "one", "number": 1},
111 {"name": "two", "number": 2}]},
114 "where": [["number", "<", 2]]}]' \
119 "row": {"number": 2, "name": "two"}}]' \
125 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
127 t=10: trigger 2 (immediate): [{"uuid":["uuid","<2>"]}]
128 t=10: trigger 1 (delayed): [{},{"count":2}]
129 t=15: trigger 3 (immediate): [{"rows":[{"_uuid":["uuid","<2>"],"_version":["uuid","<3>"],"name":"two","number":2}]}]
132 OVSDB_CHECK_TRIGGER([one delayed trigger wakes up another],
133 ["`ordinal_schema`" [\
137 "row": {"number": 0, "name": "zero"}},
140 "row": {"number": 1, "name": "one"}}]' \
147 "columns": ["name", "number"],
149 "rows": [{"name": "two", "number": 2}]},
152 "where": [["number", "==", 2]]},
155 "row": {"number": 3, "name": "three"}}]' \
161 "columns": ["name", "number"],
163 "rows": [{"name": "zero", "number": 0},
164 {"name": "one", "number": 1},
165 {"name": "two", "number": 2}]},
168 "where": [["number", "<", 2]]}]' \
173 "row": {"number": 2, "name": "two"}}]' \
179 [[t=0: trigger 0 (immediate): [{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]
182 t=10: trigger 3 (immediate): [{"uuid":["uuid","<2>"]}]
183 t=10: trigger 2 (delayed): [{},{"count":2}]
184 t=15: trigger 1 (delayed): [{},{"count":1},{"uuid":["uuid","<3>"]}]
185 t=15: trigger 4 (immediate): [{"rows":[{"_uuid":["uuid","<3>"],"_version":["uuid","<4>"],"name":"three","number":3}]}]