]> git.proxmox.com Git - ovs.git/blame - tests/ofp-util.at
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[ovs.git] / tests / ofp-util.at
CommitLineData
681ea7a0
BP
1AT_BANNER([OpenFlow utilities])
2
3AT_SETUP([encoding hellos])
4dnl All versions up to a max version supported:
5AT_CHECK([ovs-ofctl encode-hello 0x2], [0], [dnl
327a39b6 600000000 01 00 00 08 00 00 00 01
681ea7a0
BP
7OFPT_HELLO (xid=0x1):
8 version bitmap: 0x01
9])
10AT_CHECK([ovs-ofctl encode-hello 0x6], [0], [dnl
327a39b6 1100000000 02 00 00 08 00 00 00 01
681ea7a0
BP
12OFPT_HELLO (OF1.1) (xid=0x1):
13 version bitmap: 0x01, 0x02
14])
15AT_CHECK([ovs-ofctl encode-hello 0xe], [0], [dnl
327a39b6 1600000000 03 00 00 08 00 00 00 01
681ea7a0
BP
17OFPT_HELLO (OF1.2) (xid=0x1):
18 version bitmap: 0x01, 0x02, 0x03
19])
20AT_CHECK([ovs-ofctl encode-hello 0x1e], [0], [dnl
327a39b6 2100000000 04 00 00 08 00 00 00 01
2e1ae200 22OFPT_HELLO (OF1.3) (xid=0x1):
681ea7a0
BP
23 version bitmap: 0x01, 0x02, 0x03, 0x04
24])
2e1ae200 25AT_CHECK([ovs-ofctl encode-hello 0x3e], [0], [dnl
327a39b6 2600000000 05 00 00 08 00 00 00 01
9620f50c 27OFPT_HELLO (OF1.4) (xid=0x1):
2e1ae200
JR
28 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05
29])
681ea7a0
BP
30
31dnl Some versions below max version missing.
32AT_CHECK([ovs-ofctl encode-hello 0xc], [0], [dnl
327a39b6 3300000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0c
681ea7a0
BP
34OFPT_HELLO (OF1.2) (xid=0x1):
35 version bitmap: 0x02, 0x03
36])
37AT_CHECK([ovs-ofctl encode-hello 0xa], [0], [dnl
327a39b6 3800000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 0a
681ea7a0
BP
39OFPT_HELLO (OF1.2) (xid=0x1):
40 version bitmap: 0x01, 0x03
41])
42AT_CHECK([ovs-ofctl encode-hello 0x8], [0], [dnl
327a39b6 4300000000 03 00 00 10 00 00 00 01-00 01 00 08 00 00 00 08
681ea7a0
BP
44OFPT_HELLO (OF1.2) (xid=0x1):
45 version bitmap: 0x03
46])
47AT_CHECK([ovs-ofctl encode-hello 0x4], [0], [dnl
327a39b6 4800000000 02 00 00 10 00 00 00 01-00 01 00 08 00 00 00 04
681ea7a0
BP
49OFPT_HELLO (OF1.1) (xid=0x1):
50 version bitmap: 0x02
51])
52AT_CLEANUP
4a48cdfb
BP
53
54AT_SETUP([parsing key-value pairs])
55dnl Key-only basics.
56AT_CHECK([ovs-ofctl parse-key-value a a,b 'a b' 'a b' 'a
57b'], 0, [a
58a, b
59a, b
60a, b
61a, b
62])
63
64dnl Key-value basics.
65AT_CHECK([ovs-ofctl parse-key-value a:b a=b a:b,c=d 'a=b c' 'a(b)' 'a(b),c(d)'], 0,
66[a=b
67a=b
68a=b, c=d
69a=b, c
70a=b
71a=b, c=d
72])
73
74dnl Values that contain nested delimiters.
75AT_CHECK([ovs-ofctl parse-key-value 'a:(b,c)' 'a:b(c,d)e' 'a(b,c(d,e),f)'], 0,
76[a=(b,c)
77a=b(c,d)e
78a=b,c(d,e),f
79])
80
81dnl Extraneous delimiters.
82AT_CHECK([ovs-ofctl parse-key-value a,,b ',a b' ' a b ,'], 0, [a, b
83a, b
84a, b
85])
86
87dnl Missing right parentheses.
88dnl
89dnl m4 can't handle unbalanced parentheses so we use @{:@, which
90dnl Autotest replaces by a left parenthesis.
91AT_CHECK([ovs-ofctl parse-key-value 'a@{:@b' 'a@{:@b(c)' 'a=b@{:@c'], 0, [a=b
92a=b(c)
93a=b@{:@c
94])
95AT_CLEANUP