]> git.proxmox.com Git - ovs.git/blame - tests/ovn.at
ovs-vsctl: Remove redundant checks.
[ovs.git] / tests / ovn.at
CommitLineData
10b1662b
BP
1AT_BANNER([OVN])
2
3AT_SETUP([ovn -- lexer])
4dnl For lines without =>, input and expected output are identical.
5dnl For lines with =>, input precedes => and expected output follows =>.
6AT_DATA([test-cases.txt], [dnl
7foo bar baz quuxquuxquux _abcd_ a.b.c.d a123_.456
8"abc\u0020def" => "abc def"
9" => error("Input ends inside quoted string.")dnl "
10
11a/*b*/c => a c
12a//b c => a
13a/**/b => a b
14a/*/b => a error("`/*' without matching `*/'.")
15a/*/**/b => a b
16a/b => a error("`/' is only valid as part of `//' or `/*'.") b
17
180 1 12345 18446744073709551615
1918446744073709551616 => error("Decimal constants must be less than 2**64.")
209999999999999999999999 => error("Decimal constants must be less than 2**64.")
2101 => error("Decimal constants must not have leading zeros.")
22
230/0
240/1
251/0 => error("Value contains unmasked 1-bits.")
261/1
27128/384
281/3
291/ => error("Integer constant expected.")
30
311/0x123 => error("Value and mask have incompatible formats.")
32
330x1234
340x01234 => 0x1234
350x0 => 0
360x000 => 0
370xfedcba9876543210
380XFEDCBA9876543210 => 0xfedcba9876543210
390xfedcba9876543210fedcba9876543210
10b1662b
BP
400x0000fedcba9876543210fedcba9876543210 => 0xfedcba9876543210fedcba9876543210
410x => error("Hex digits expected following 0x.")
420X => error("Hex digits expected following 0X.")
430x0/0x0 => 0/0
440x0/0x1 => 0/0x1
450x1/0x0 => error("Value contains unmasked 1-bits.")
460xffff/0x1ffff
470x. => error("Invalid syntax in hexadecimal constant.")
48
49192.168.128.1 1.2.3.4 255.255.255.255 0.0.0.0
50256.1.2.3 => error("Invalid numeric constant.")
51192.168.0.0/16
52192.168.0.0/255.255.0.0 => 192.168.0.0/16
53192.168.0.0/255.255.255.0 => 192.168.0.0/24
54192.168.0.0/255.255.0.255
55192.168.0.0/255.0.0.0 => error("Value contains unmasked 1-bits.")
56192.168.0.0/32
57192.168.0.0/255.255.255.255 => 192.168.0.0/32
58
59::
60::1
61ff00::1234 => ff00::1234
622001:db8:85a3::8a2e:370:7334
632001:db8:85a3:0:0:8a2e:370:7334 => 2001:db8:85a3::8a2e:370:7334
642001:0db8:85a3:0000:0000:8a2e:0370:7334 => 2001:db8:85a3::8a2e:370:7334
65::ffff:192.0.2.128
66::ffff:c000:0280 => ::ffff:192.0.2.128
67::1/::1
68::1/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff => ::1/128
69::1/128
70ff00::/8
71ff00::/ff00:: => ff00::/8
72
7301:23:45:67:ab:cd
7401:23:45:67:AB:CD => 01:23:45:67:ab:cd
75fe:dc:ba:98:76:54
76FE:DC:ba:98:76:54 => fe:dc:ba:98:76:54
7701:00:00:00:00:00/01:00:00:00:00:00
78ff:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff
79fe:ff:ff:ff:ff:ff/ff:ff:ff:ff:ff:ff
80ff:ff:ff:ff:ff:ff/fe:ff:ff:ff:ff:ff => error("Value contains unmasked 1-bits.")
81fe:x => error("Invalid numeric constant.")
8200:01:02:03:04:x => error("Invalid numeric constant.")
83
84(){}[[]]==!=<<=>>=!&&||..,;= => ( ) { } [[ ]] == != < <= > >= ! && || .. , ; =
85& => error("`&' is only valid as part of `&&'.")
86| => error("`|' is only valid as part of `||'.")
87
88^ => error("Invalid character `^' in input.")
89])
90AT_CAPTURE_FILE([input.txt])
91sed 's/ =>.*//' test-cases.txt > input.txt
92sed 's/.* => //' test-cases.txt > expout
93AT_CHECK([ovstest test-ovn lex < input.txt], [0], [expout])
94AT_CLEANUP
e0840f11
BP
95
96AT_SETUP([ovn -- expression parser])
97dnl For lines without =>, input and expected output are identical.
98dnl For lines with =>, input precedes => and expected output follows =>.
99AT_DATA([test-cases.txt], [[
100eth.type == 0x800
101eth.type==0x800 => eth.type == 0x800
102eth.type[0..15] == 0x800 => eth.type == 0x800
103
104vlan.present
105vlan.present == 1 => vlan.present
106!(vlan.present == 0) => vlan.present
107!(vlan.present != 1) => vlan.present
108!vlan.present
109vlan.present == 0 => !vlan.present
110vlan.present != 1 => !vlan.present
111!(vlan.present == 1) => !vlan.present
112!(vlan.present != 0) => !vlan.present
113
114eth.dst[0]
115eth.dst[0] == 1 => eth.dst[0]
116eth.dst[0] != 0 => eth.dst[0]
117!(eth.dst[0] == 0) => eth.dst[0]
118!(eth.dst[0] != 1) => eth.dst[0]
119
120!eth.dst[0]
121eth.dst[0] == 0 => !eth.dst[0]
122eth.dst[0] != 1 => !eth.dst[0]
123!(eth.dst[0] == 1) => !eth.dst[0]
124!(eth.dst[0] != 0) => !eth.dst[0]
125
126vlan.tci[12..15] == 0x3
127vlan.tci == 0x3000/0xf000 => vlan.tci[12..15] == 0x3
128vlan.tci[12..15] != 0x3
129vlan.tci != 0x3000/0xf000 => vlan.tci[12..15] != 0x3
130
131!vlan.pcp => vlan.pcp == 0
132!(vlan.pcp) => vlan.pcp == 0
133vlan.pcp == 0x4
134vlan.pcp != 0x4
135vlan.pcp > 0x4
136vlan.pcp >= 0x4
137vlan.pcp < 0x4
138vlan.pcp <= 0x4
139!(vlan.pcp != 0x4) => vlan.pcp == 0x4
140!(vlan.pcp == 0x4) => vlan.pcp != 0x4
141!(vlan.pcp <= 0x4) => vlan.pcp > 0x4
142!(vlan.pcp < 0x4) => vlan.pcp >= 0x4
143!(vlan.pcp >= 0x4) => vlan.pcp < 0x4
144!(vlan.pcp > 0x4) => vlan.pcp <= 0x4
1450x4 == vlan.pcp => vlan.pcp == 0x4
1460x4 != vlan.pcp => vlan.pcp != 0x4
1470x4 < vlan.pcp => vlan.pcp > 0x4
1480x4 <= vlan.pcp => vlan.pcp >= 0x4
1490x4 > vlan.pcp => vlan.pcp < 0x4
1500x4 >= vlan.pcp => vlan.pcp <= 0x4
151!(0x4 != vlan.pcp) => vlan.pcp == 0x4
152!(0x4 == vlan.pcp) => vlan.pcp != 0x4
153!(0x4 >= vlan.pcp) => vlan.pcp > 0x4
154!(0x4 > vlan.pcp) => vlan.pcp >= 0x4
155!(0x4 <= vlan.pcp) => vlan.pcp < 0x4
156!(0x4 < vlan.pcp) => vlan.pcp <= 0x4
157
1581 < vlan.pcp < 4 => vlan.pcp > 0x1 && vlan.pcp < 0x4
1591 <= vlan.pcp <= 4 => vlan.pcp >= 0x1 && vlan.pcp <= 0x4
1601 < vlan.pcp <= 4 => vlan.pcp > 0x1 && vlan.pcp <= 0x4
1611 <= vlan.pcp < 4 => vlan.pcp >= 0x1 && vlan.pcp < 0x4
1621 <= vlan.pcp <= 4 => vlan.pcp >= 0x1 && vlan.pcp <= 0x4
1634 > vlan.pcp > 1 => vlan.pcp < 0x4 && vlan.pcp > 0x1
1644 >= vlan.pcp > 1 => vlan.pcp <= 0x4 && vlan.pcp > 0x1
1654 > vlan.pcp >= 1 => vlan.pcp < 0x4 && vlan.pcp >= 0x1
1664 >= vlan.pcp >= 1 => vlan.pcp <= 0x4 && vlan.pcp >= 0x1
167!(1 < vlan.pcp < 4) => vlan.pcp <= 0x1 || vlan.pcp >= 0x4
168!(1 <= vlan.pcp <= 4) => vlan.pcp < 0x1 || vlan.pcp > 0x4
169!(1 < vlan.pcp <= 4) => vlan.pcp <= 0x1 || vlan.pcp > 0x4
170!(1 <= vlan.pcp < 4) => vlan.pcp < 0x1 || vlan.pcp >= 0x4
171!(1 <= vlan.pcp <= 4) => vlan.pcp < 0x1 || vlan.pcp > 0x4
172!(4 > vlan.pcp > 1) => vlan.pcp >= 0x4 || vlan.pcp <= 0x1
173!(4 >= vlan.pcp > 1) => vlan.pcp > 0x4 || vlan.pcp <= 0x1
174!(4 > vlan.pcp >= 1) => vlan.pcp >= 0x4 || vlan.pcp < 0x1
175!(4 >= vlan.pcp >= 1) => vlan.pcp > 0x4 || vlan.pcp < 0x1
176
177vlan.pcp == {1, 2, 3, 4} => vlan.pcp == 0x1 || vlan.pcp == 0x2 || vlan.pcp == 0x3 || vlan.pcp == 0x4
178vlan.pcp == 1 || ((vlan.pcp == 2 || vlan.pcp == 3) || vlan.pcp == 4) => vlan.pcp == 0x1 || vlan.pcp == 0x2 || vlan.pcp == 0x3 || vlan.pcp == 0x4
179
180vlan.pcp != {1, 2, 3, 4} => vlan.pcp != 0x1 && vlan.pcp != 0x2 && vlan.pcp != 0x3 && vlan.pcp != 0x4
181vlan.pcp == 1 && ((vlan.pcp == 2 && vlan.pcp == 3) && vlan.pcp == 4) => vlan.pcp == 0x1 && vlan.pcp == 0x2 && vlan.pcp == 0x3 && vlan.pcp == 0x4
182
183vlan.pcp == 1 && !((vlan.pcp == 2 && vlan.pcp == 3) && vlan.pcp == 4) => vlan.pcp == 0x1 && (vlan.pcp != 0x2 || vlan.pcp != 0x3 || vlan.pcp != 0x4)
184vlan.pcp == 1 && (!(vlan.pcp == 2 && vlan.pcp == 3) && vlan.pcp == 4) => vlan.pcp == 0x1 && (vlan.pcp != 0x2 || vlan.pcp != 0x3) && vlan.pcp == 0x4
185vlan.pcp == 1 && !(!(vlan.pcp == 2 && vlan.pcp == 3) && vlan.pcp == 4) => vlan.pcp == 0x1 && ((vlan.pcp == 0x2 && vlan.pcp == 0x3) || vlan.pcp != 0x4)
186
187ip4.src == {10.0.0.0/8, 192.168.0.0/16, 172.16.20.0/24, 8.8.8.8} => ip4.src[24..31] == 0xa || ip4.src[16..31] == 0xc0a8 || ip4.src[8..31] == 0xac1014 || ip4.src == 0x8080808
188ip6.src == ::1 => ip6.src == 0x1
189
190ip4.src == 1.2.3.4 => ip4.src == 0x1020304
191ip4.src == ::1.2.3.4/::ffff:ffff => ip4.src == 0x1020304
192ip6.src == ::1 => ip6.src == 0x1
193
1941
1950
196!1 => 0
197!0 => 1
198
199inport == "eth0"
200!(inport != "eth0") => inport == "eth0"
201
3b7cb7e1
BP
202ip4.src == "eth0" => Integer field ip4.src is not compatible with string constant.
203inport == 1 => String field inport is not compatible with integer constant.
e0840f11
BP
204
205ip4.src > {1, 2, 3} => Only == and != operators may be used with value sets.
206eth.type > 0x800 => Only == and != operators may be used with nominal field eth.type.
207vlan.present > 0 => Only == and != operators may be used with Boolean field vlan.present.
208
209inport != "eth0" => Nominal field inport may only be tested for equality (taking enclosing `!' operators into account).
210!(inport == "eth0") => Nominal field inport may only be tested for equality (taking enclosing `!' operators into account).
211eth.type != 0x800 => Nominal field eth.type may only be tested for equality (taking enclosing `!' operators into account).
212!(eth.type == 0x800) => Nominal field eth.type may only be tested for equality (taking enclosing `!' operators into account).
213
214123 == 123 => Syntax error at `123' expecting field name.
215
216123 == xyzzy => Syntax error at `xyzzy' expecting field name.
217xyzzy == 1 => Syntax error at `xyzzy' expecting field name.
218
219inport[1] == 1 => Cannot select subfield of string field inport.
220
221eth.type[] == 1 => Syntax error at `@:>@' expecting small integer.
222eth.type[::1] == 1 => Syntax error at `::1' expecting small integer.
223eth.type[18446744073709551615] == 1 => Syntax error at `18446744073709551615' expecting small integer.
224
225eth.type[5!] => Syntax error at `!' expecting `@:>@'.
226
227eth.type[5..1] => Invalid bit range 5 to 1.
228
229eth.type[12..16] => Cannot select bits 12 to 16 of 16-bit field eth.type.
230
231eth.type[10] == 1 => Cannot select subfield of nominal field eth.type.
232
233eth.type => Explicit `!= 0' is required for inequality test of multibit field against 0.
234
235!(!(vlan.pcp)) => Explicit `!= 0' is required for inequality test of multibit field against 0.
236
237123 => Syntax error at end of input expecting relational operator.
238
239123 x => Syntax error at `x' expecting relational operator.
240
241{1, "eth0"} => Syntax error at `"eth0"' expecting integer.
242
243eth.type == xyzzy => Syntax error at `xyzzy' expecting constant.
244
245(1 x) => Syntax error at `x' expecting `)'.
246
247!0x800 != eth.type => Missing parentheses around operand of !.
248
249eth.type == 0x800 || eth.type == 0x86dd && ip.proto == 17 => && and || must be parenthesized when used together.
250
251eth.dst == {} => Syntax error at `}' expecting constant.
252
253eth.src > 00:00:00:00:11:11/00:00:00:00:ff:ff => Only == and != operators may be used with masked constants. Consider using subfields instead (e.g. eth.src[0..15] > 0x1111 in place of eth.src > 00:00:00:00:11:11/00:00:00:00:ff:ff).
254
3b7cb7e1 255ip4.src == ::1 => 128-bit constant is not compatible with 32-bit field ip4.src.
e0840f11
BP
256
2571 == eth.type == 2 => Range expressions must have the form `x < field < y' or `x > field > y', with each `<' optionally replaced by `<=' or `>' by `>=').
258]])
259sed 's/ =>.*//' test-cases.txt > input.txt
260sed 's/.* => //' test-cases.txt > expout
261AT_CHECK([ovstest test-ovn parse-expr < input.txt], [0], [expout])
262AT_CLEANUP
263
264AT_SETUP([ovn -- expression annotation])
265dnl Input precedes =>, expected output follows =>.
266AT_DATA([test-cases.txt], [[
267ip4.src == 1.2.3.4 => ip4.src == 0x1020304 && eth.type == 0x800
268ip4.src != 1.2.3.4 => ip4.src != 0x1020304 && eth.type == 0x800
269ip.proto == 123 => ip.proto == 0x7b && (eth.type == 0x800 || eth.type == 0x86dd)
270ip.proto == {123, 234} => (ip.proto == 0x7b && (eth.type == 0x800 || eth.type == 0x86dd)) || (ip.proto == 0xea && (eth.type == 0x800 || eth.type == 0x86dd))
271ip4.src == 1.2.3.4 && ip4.dst == 5.6.7.8 => ip4.src == 0x1020304 && eth.type == 0x800 && ip4.dst == 0x5060708 && eth.type == 0x800
272
273ip => eth.type == 0x800 || eth.type == 0x86dd
274ip == 1 => eth.type == 0x800 || eth.type == 0x86dd
275ip[0] == 1 => eth.type == 0x800 || eth.type == 0x86dd
276ip > 0 => Only == and != operators may be used with nominal field ip.
277!ip => Nominal predicate ip may only be tested positively, e.g. `ip' or `ip == 1' but not `!ip' or `ip == 0'.
278ip == 0 => Nominal predicate ip may only be tested positively, e.g. `ip' or `ip == 1' but not `!ip' or `ip == 0'.
279
280vlan.present => vlan.tci[12]
281!vlan.present => !vlan.tci[12]
282
283!vlan.pcp => vlan.tci[13..15] == 0 && vlan.tci[12]
284vlan.pcp == 1 && vlan.vid == 2 => vlan.tci[13..15] == 0x1 && vlan.tci[12] && vlan.tci[0..11] == 0x2 && vlan.tci[12]
285!reg0 && !reg1 && !reg2 && !reg3 => xreg0[32..63] == 0 && xreg0[0..31] == 0 && xreg1[32..63] == 0 && xreg1[0..31] == 0
286
287ip.first_frag => ip.frag[0] && (eth.type == 0x800 || eth.type == 0x86dd) && (!ip.frag[1] || (eth.type != 0x800 && eth.type != 0x86dd))
288!ip.first_frag => !ip.frag[0] || (eth.type != 0x800 && eth.type != 0x86dd) || (ip.frag[1] && (eth.type == 0x800 || eth.type == 0x86dd))
289ip.later_frag => ip.frag[1] && (eth.type == 0x800 || eth.type == 0x86dd)
290
291bad_prereq != 0 => Error parsing expression `xyzzy' encountered as prerequisite or predicate of initial expression: Syntax error at `xyzzy' expecting field name.
292self_recurse != 0 => Error parsing expression `self_recurse != 0' encountered as prerequisite or predicate of initial expression: Recursive expansion of symbol `self_recurse'.
293mutual_recurse_1 != 0 => Error parsing expression `mutual_recurse_2 != 0' encountered as prerequisite or predicate of initial expression: Error parsing expression `mutual_recurse_1 != 0' encountered as prerequisite or predicate of initial expression: Recursive expansion of symbol `mutual_recurse_1'.
294mutual_recurse_2 != 0 => Error parsing expression `mutual_recurse_1 != 0' encountered as prerequisite or predicate of initial expression: Error parsing expression `mutual_recurse_2 != 0' encountered as prerequisite or predicate of initial expression: Recursive expansion of symbol `mutual_recurse_2'.
295]])
296sed 's/ =>.*//' test-cases.txt > input.txt
297sed 's/.* => //' test-cases.txt > expout
298AT_CHECK([ovstest test-ovn annotate-expr < input.txt], [0], [expout])
299AT_CLEANUP
300
301AT_SETUP([ovn -- expression conversion (1)])
302AT_CHECK([ovstest test-ovn exhaustive --operation=convert 1], [0],
303 [Tested converting all 1-terminal expressions with 2 vars each of 3 bits in terms of operators == != < <= > >=.
304])
305AT_CLEANUP
306
307AT_SETUP([ovn -- expression conversion (2)])
308AT_CHECK([ovstest test-ovn exhaustive --operation=convert 2], [0],
309 [Tested converting 562 expressions of 2 terminals with 2 vars each of 3 bits in terms of operators == != < <= > >=.
310])
311AT_CLEANUP
312
313AT_SETUP([ovn -- expression conversion (3)])
314AT_CHECK([ovstest test-ovn exhaustive --operation=convert --bits=2 3], [0],
315 [Tested converting 57618 expressions of 3 terminals with 2 vars each of 2 bits in terms of operators == != < <= > >=.
316])
317AT_CLEANUP
318
319AT_SETUP([ovn -- expression simplification])
320AT_CHECK([ovstest test-ovn exhaustive --operation=simplify --vars=2 3], [0],
321 [Tested simplifying 477138 expressions of 3 terminals with 2 vars each of 3 bits in terms of operators == != < <= > >=.
322])
323AT_CLEANUP
324
325AT_SETUP([ovn -- expression normalization (1)])
326AT_CHECK([ovstest test-ovn exhaustive --operation=normalize --vars=3 --bits=1 4], [0],
327 [Tested normalizing 1207162 expressions of 4 terminals with 3 vars each of 1 bits in terms of operators == != < <= > >=.
328])
329AT_CLEANUP
330
331AT_SETUP([ovn -- expression normalization (1)])
332AT_CHECK([ovstest test-ovn exhaustive --operation=normalize --vars=3 --bits=1 --relops='==' 5], [0],
333 [Tested normalizing 368550 expressions of 5 terminals with 3 vars each of 1 bits in terms of operators ==.
334])
335AT_CLEANUP
336
337AT_SETUP([ovn -- converting expressions to flows (1)])
338AT_CHECK([ovstest test-ovn exhaustive --operation=flow --vars=2 --bits=2 --relops='==' 4], [0],
339 [Tested converting to flows 128282 expressions of 4 terminals with 2 vars each of 2 bits in terms of operators ==.
340])
341AT_CLEANUP
342
343AT_SETUP([ovn -- converting expressions to flows (2)])
344AT_CHECK([ovstest test-ovn exhaustive --operation=flow --vars=3 --bits=3 --relops='==' 3], [0],
345 [Tested converting to flows 38394 expressions of 3 terminals with 3 vars each of 3 bits in terms of operators ==.
346])
347AT_CLEANUP
f386a8a7
BP
348
349AT_SETUP([ovn -- converting expressions to flows -- string fields])
350expr_to_flow () {
351 echo "$1" | ovstest test-ovn expr-to-flows | sort
352}
3b7cb7e1 353AT_CHECK([expr_to_flow 'inport == "eth0"'], [0], [reg6=0x5
f386a8a7 354])
3b7cb7e1 355AT_CHECK([expr_to_flow 'inport == "eth1"'], [0], [reg6=0x6
f386a8a7
BP
356])
357AT_CHECK([expr_to_flow 'inport == "eth2"'], [0], [(no flows)
358])
359AT_CHECK([expr_to_flow 'inport == "eth0" && ip'], [0], [dnl
3b7cb7e1
BP
360ip,reg6=0x5
361ipv6,reg6=0x5
f386a8a7
BP
362])
363AT_CHECK([expr_to_flow 'inport == "eth1" && ip'], [0], [dnl
3b7cb7e1
BP
364ip,reg6=0x6
365ipv6,reg6=0x6
f386a8a7
BP
366])
367AT_CHECK([expr_to_flow 'inport == "eth2" && ip'], [0], [(no flows)
368])
369AT_CHECK([expr_to_flow 'inport == {"eth0", "eth1", "eth2", "LOCAL"}'], [0],
3b7cb7e1
BP
370[reg6=0x5
371reg6=0x6
372reg6=0xfffe
f386a8a7
BP
373])
374AT_CHECK([expr_to_flow 'inport == {"eth0", "eth1", "eth2"} && ip'], [0], [dnl
3b7cb7e1
BP
375ip,reg6=0x5
376ip,reg6=0x6
377ipv6,reg6=0x5
378ipv6,reg6=0x6
f386a8a7
BP
379])
380AT_CLEANUP
3b7cb7e1
BP
381
382AT_SETUP([ovn -- action parsing])
383dnl Text before => is input, text after => is expected output.
384AT_DATA([test-cases.txt], [[
385# Positive tests.
386drop; => actions=drop, prereqs=1
387next; => actions=resubmit(,11), prereqs=1
388output; => actions=resubmit(,64), prereqs=1
389outport="eth0"; next; outport="LOCAL"; next; => actions=set_field:0x5->reg7,resubmit(,11),set_field:0xfffe->reg7,resubmit(,11), prereqs=1
390tcp.dst=80; => actions=set_field:80->tcp_dst, prereqs=ip.proto == 0x6 && (eth.type == 0x800 || eth.type == 0x86dd)
391eth.dst[40] = 1; => actions=set_field:01:00:00:00:00:00/01:00:00:00:00:00->eth_dst, prereqs=1
392vlan.pcp = 2; => actions=set_field:0x4000/0xe000->vlan_tci, prereqs=vlan.tci[12]
393vlan.tci[13..15] = 2; => actions=set_field:0x4000/0xe000->vlan_tci, prereqs=1
394
395## Negative tests.
396
397; => Syntax error at `;'.
398xyzzy; => Syntax error at `xyzzy' expecting action.
399next; 123; => Syntax error at `123'.
400next; xyzzy; => Syntax error at `xyzzy' expecting action.
401
402# "drop;" must be on its own:
403drop; next; => Syntax error at `next' expecting end of input.
404next; drop; => Syntax error at `drop' expecting action.
405
406# Missing ";":
407next => Syntax error at end of input expecting ';'.
408
409inport[1] = 1; => Cannot select subfield of string field inport.
410ip.proto[1] = 1; => Cannot select subfield of nominal field ip.proto.
411eth.dst[40] == 1; => Syntax error at `==' expecting `='.
412ip = 1; => Can't assign to predicate symbol ip.
413ip.proto = 6; => Field ip.proto is not modifiable.
414inport = {"a", "b"}; => Assignments require a single value.
415inport = {}; => Syntax error at `}' expecting constant.
416bad_prereq = 123; => Error parsing expression `xyzzy' encountered as prerequisite or predicate of initial expression: Syntax error at `xyzzy' expecting field name.
417self_recurse = 123; => Error parsing expression `self_recurse != 0' encountered as prerequisite or predicate of initial expression: Error parsing expression `self_recurse != 0' encountered as prerequisite or predicate of initial expression: Recursive expansion of symbol `self_recurse'.
418vlan.present = 0; => Can't assign to predicate symbol vlan.present.
419]])
420sed 's/ =>.*//' test-cases.txt > input.txt
421sed 's/.* => //' test-cases.txt > expout
422AT_CHECK([ovstest test-ovn parse-actions < input.txt], [0], [expout])
423AT_CLEANUP