]> git.proxmox.com Git - ovs.git/blame - tests/ofp-errors.at
Fix ovs-dpctl-top by removing 3 wrong hunks in py3-compat.patch.
[ovs.git] / tests / ofp-errors.at
CommitLineData
2e0525bc
SH
1AT_BANNER([ofp-errors tests])
2
3AT_SETUP([OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.0])
4AT_KEYWORDS([ofp-print ofp-errors])
5AT_CHECK([ovs-ofctl ofp-print 010100170000000000000001657874726120646174610a], [0], [dnl
6OFPT_ERROR (xid=0x0): OFPHFC_EPERM
7extra data\012
8])
9AT_CLEANUP
10
11AT_SETUP([OFPT_ERROR with type OFPET_HELLO_FAILED - OF1.1])
12AT_KEYWORDS([ofp-print ofp-errors])
13AT_CHECK([ovs-ofctl ofp-print 020100170000000000000001657874726120646174610a], [0], [dnl
14OFPT_ERROR (OF1.1) (xid=0x0): OFPHFC_EPERM
15extra data\012
16])
17AT_CLEANUP
18
19AT_SETUP([OFPT_ERROR with type OFPET_BAD_REQUEST - OF1.0])
20AT_KEYWORDS([ofp-print ofp-errors])
f25b4a81 21AT_CHECK([ovs-ofctl ofp-print 0101001400000000000100060105ccddeeff0011], [0], [dnl
2e0525bc 22OFPT_ERROR (xid=0x0): OFPBRC_BAD_LEN
f25b4a81 23OFPT_FEATURES_REQUEST (xid=0xeeff0011):
2e0525bc 24(***truncated to 8 bytes from 52445***)
f25b4a81
BP
2500000000 01 05 cc dd ee ff 00 11- |........ |
26])
27AT_CLEANUP
28
29AT_SETUP([OFPT_ERROR prints type of truncated inner messages])
30AT_KEYWORDS([ofp-print ofp-errors])
31AT_CHECK([ovs-ofctl ofp-print "0101004c092529d500010006 \
3201 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \
3300 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \
34ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \
3500 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01"], [0], [dnl
36OFPT_ERROR (xid=0x92529d5): OFPBRC_BAD_LEN
37OFPT_FEATURES_REPLY (xid=0x1):
38(***truncated to 64 bytes from 224***)
3900000000 01 06 00 e0 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....|
4000000010 00 00 01 00 02 00 00 00-00 00 00 87 00 00 0f ff |................|
4100000020 ff fe 50 54 00 00 00 01-62 72 30 00 00 00 00 00 |..PT....br0.....|
4200000030 00 00 00 00 00 00 00 00-00 00 00 01 00 00 00 01 |................|
2e0525bc
SH
43])
44AT_CLEANUP
45
46AT_SETUP([OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.0])
47AT_KEYWORDS([ofp-print ofp-errors])
48AT_CHECK([ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010104 0102000811111111'], [0], [dnl
49OFPT_ERROR (xid=0x55555555): OFPBMC_BAD_PREREQ
50OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
51])
52AT_CLEANUP
53
54AT_SETUP([OFPT_ERROR with code OFPBMC_BAD_PREREQ - OF1.1])
55AT_KEYWORDS([ofp-print ofp-errors])
56AT_CHECK([ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010104 0102000811111111'], [0], [dnl
57OFPT_ERROR (OF1.1) (xid=0x55555555): OFPBMC_BAD_PREREQ
58OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
59])
60AT_CLEANUP
61
62dnl Error type 3, code 1 is OFPFMFC_OVERLAP in OF1.0
63dnl and OFPBIC_UNSUP_INST in OF1.1, so check that value in both versions.
64AT_SETUP([OFPT_ERROR with type OFPFMFC_OVERLAP - OF1.0])
65AT_KEYWORDS([ofp-print ofp-errors])
f25b4a81 66AT_CHECK([ovs-ofctl ofp-print 0101001400000000000300010106ccddeeff0011], [0], [dnl
2e0525bc 67OFPT_ERROR (xid=0x0): OFPFMFC_OVERLAP
f25b4a81 68OFPT_FEATURES_REPLY (xid=0xeeff0011):
2e0525bc 69(***truncated to 8 bytes from 52445***)
f25b4a81 7000000000 01 06 cc dd ee ff 00 11- |........ |
2e0525bc
SH
71])
72AT_CLEANUP
73AT_SETUP([OFPT_ERROR with type OFPBIC_UNSUP_INST - OF1.1])
74AT_KEYWORDS([ofp-print ofp-errors])
f25b4a81 75AT_CHECK([ovs-ofctl ofp-print 0201001400000000000300010206ccddeeff0011], [0], [dnl
2e0525bc 76OFPT_ERROR (OF1.1) (xid=0x0): OFPBIC_UNSUP_INST
f25b4a81 77OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011):
2e0525bc 78(***truncated to 8 bytes from 52445***)
f25b4a81 7900000000 02 06 cc dd ee ff 00 11- |........ |
2e0525bc
SH
80])
81AT_CLEANUP
82
0ca30f6f
SH
83AT_SETUP([OFPT_ERROR with type OFPBIC_DUP_INST - OF1.4])
84AT_KEYWORDS([ofp-print ofp-errors])
85AT_CHECK([ovs-ofctl ofp-print 0501001400000000000300090206ccddeeff0011], [0], [dnl
86OFPT_ERROR (OF1.4) (xid=0x0): OFPBIC_DUP_INST
87OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011):
88(***truncated to 8 bytes from 52445***)
8900000000 02 06 cc dd ee ff 00 11- |........ |
90])
91AT_CLEANUP
92
2e0525bc
SH
93dnl OF1.1 had OFPBIC_UNSUP_EXP_INST as 3,5.
94dnl OF1.2 broke it into OFPBIC_BAD_EXPERIMENTER as 3,5
95dnl and OFPBIC_BAD_EXT_TYPE as 3,6.
96dnl Thus, for OF1.1 we translate both of the latter error codes into 3,5.
97AT_SETUP([encoding OFPBIC_* experimenter errors])
98AT_KEYWORDS([ofp-print ofp-errors])
99AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXPERIMENTER], [0], [dnl
514887ee
BP
100OpenFlow 1.1: vendor 0, type 3, code 5
101OpenFlow 1.2: vendor 0, type 3, code 5
102OpenFlow 1.3: vendor 0, type 3, code 5
c37c0382 103OpenFlow 1.4: vendor 0, type 3, code 5
42dccab5 104OpenFlow 1.5: vendor 0, type 3, code 5
2e0525bc
SH
105])
106AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXP_TYPE], [0], [dnl
514887ee
BP
107OpenFlow 1.1: vendor 0, type 3, code 5
108OpenFlow 1.2: vendor 0, type 3, code 6
109OpenFlow 1.3: vendor 0, type 3, code 6
c37c0382 110OpenFlow 1.4: vendor 0, type 3, code 6
42dccab5 111OpenFlow 1.5: vendor 0, type 3, code 6
2e0525bc
SH
112])
113AT_CLEANUP
114
edd70aa7
BP
115dnl The "bad role" error was a Nicira extension in OpenFlow 1.0 and 1.1.
116dnl It was adopted as an official error code in OpenFlow 1.2.
117AT_SETUP([encoding errors extension that became official])
118AT_KEYWORDS([ofp-print ofp-errors])
119AT_CHECK(
120 [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0100000812345678], [0], [dnl
327a39b6
BP
12100000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
12200000010 00 01 02 01 01 00 00 08-12 34 56 78
edd70aa7
BP
123])
124AT_CHECK(
125 [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0200000812345678], [0], [dnl
327a39b6
BP
12600000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
12700000010 00 01 02 01 02 00 00 08-12 34 56 78
edd70aa7
BP
128])
129AT_CHECK(
130 [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0300000812345678], [0], [dnl
327a39b6
BP
13100000000 03 01 00 14 12 34 56 78-00 0b 00 02 03 00 00 08
13200000010 12 34 56 78
edd70aa7
BP
133])
134AT_CLEANUP
135
2e0525bc
SH
136AT_SETUP([decoding OFPBIC_* experimenter errors])
137AT_KEYWORDS([ofp-print ofp-errors])
138AT_CHECK([ovs-ofctl ofp-print '0201001455555555 00030005 0102000811111111'], [0], [dnl
139OFPT_ERROR (OF1.1) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER
140OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
141])
2e0525bc 142AT_CHECK([ovs-ofctl ofp-print '0301001455555555 00030005 0102000811111111'], [0], [dnl
4232ef77 143OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER
2e0525bc
SH
144OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
145])
2e0525bc 146AT_CHECK([ovs-ofctl ofp-print '0301001455555555 00030006 0102000811111111'], [0], [dnl
4232ef77 147OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXP_TYPE
2e0525bc
SH
148OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
149])
150AT_CLEANUP
514887ee
BP
151
152AT_SETUP([decoding experimenter errors])
153AT_KEYWORDS([ofp-print ofp-errors])
154AT_CHECK([ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010203 0102000811111111'], [0], [dnl
155OFPT_ERROR (xid=0x55555555): NXBRC_MUST_BE_ZERO
156OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
157])
158AT_CHECK([ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010203 0102000811111111'], [0], [dnl
159OFPT_ERROR (OF1.1) (xid=0x55555555): NXBRC_MUST_BE_ZERO
160OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
161])
162AT_CHECK([ovs-ofctl ofp-print '0301001855555555 ffff0004 00002320 0102000811111111'], [0], [dnl
163OFPT_ERROR (OF1.2) (xid=0x55555555): NXBRC_MUST_BE_ZERO
164OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
165])
d12f128a
BP
166
167AT_CHECK([ovs-ofctl ofp-print '0301001812345678 ffff0a28 4f4e4600 0300000812345678'], [0], [dnl
168OFPT_ERROR (OF1.2) (xid=0x12345678): OFPBIC_DUP_INST
169OFPT_HELLO (OF1.2) (xid=0x12345678):
170 version bitmap: 0x01, 0x02, 0x03
171])
172AT_CHECK([ovs-ofctl ofp-print '0401001812345678 ffff0a28 4f4e4600 0400000812345678'], [0], [dnl
173OFPT_ERROR (OF1.3) (xid=0x12345678): OFPBIC_DUP_INST
174OFPT_HELLO (OF1.3) (xid=0x12345678):
175 version bitmap: 0x01, 0x02, 0x03, 0x04
176])
177AT_CHECK([ovs-ofctl ofp-print '0501001412345678 00030009 0500000812345678'], [0], [dnl
178OFPT_ERROR (OF1.4) (xid=0x12345678): OFPBIC_DUP_INST
179OFPT_HELLO (OF1.4) (xid=0x12345678):
180 version bitmap: 0x01, 0x02, 0x03, 0x04, 0x05
181])
514887ee
BP
182AT_CLEANUP
183
184AT_SETUP([encoding experimenter errors])
185AT_KEYWORDS([ofp-print ofp-errors])
d12f128a
BP
186# Demonstrate that a Nicira extension error gets encoded correctly
187# using the Nicira error extension format in OF1.0 and OF1.1, and
188# correctly using the standard experimenter format in OF1.2.
514887ee
BP
189AT_CHECK(
190 [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0100000812345678], [0], [dnl
327a39b6
BP
19100000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
19200000010 00 01 02 03 01 00 00 08-12 34 56 78
514887ee
BP
193])
194AT_CHECK(
195 [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0200000812345678], [0], [dnl
327a39b6
BP
19600000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
19700000010 00 01 02 03 02 00 00 08-12 34 56 78
514887ee
BP
198])
199AT_CHECK(
200 [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0300000812345678], [0], [dnl
327a39b6
BP
20100000000 03 01 00 18 12 34 56 78-ff ff 00 04 00 00 23 20
20200000010 03 00 00 08 12 34 56 78
514887ee 203])
d12f128a
BP
204
205# Check that OFPERR_OFPBIC_DUP_INST is:
206# - not encodable in OF1.0 (OF1.0 doesn't have instructions, after all).
207# - encoded as a Nicira extension in OF1.1.
208# - encoded as an ONF extension in OF1.2 and OF1.3.
209# - encoded in the standard form in OF1.4.
210AT_CHECK(
211 [ovs-ofctl '-vPATTERN:console:%c|%p|%m' encode-error-reply OFPBIC_DUP_INST 0100000812345678], [0], [dnl
327a39b6
BP
21200000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
21300000010 00 01 02 09 01 00 00 08-12 34 56 78
d12f128a
BP
214], [ofp_errors|ERR|cannot encode OFPBIC_DUP_INST for OpenFlow 1.0
215])
216AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0200000812345678], [0],
327a39b6
BP
217[00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20
21800000010 00 03 01 00 02 00 00 08-12 34 56 78
d12f128a
BP
219])
220AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0300000812345678], [0],
327a39b6
BP
221[00000000 03 01 00 18 12 34 56 78-ff ff 0a 28 4f 4e 46 00
22200000010 03 00 00 08 12 34 56 78
d12f128a
BP
223])
224AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0400000812345678], [0],
327a39b6
BP
225[00000000 04 01 00 18 12 34 56 78-ff ff 0a 28 4f 4e 46 00
22600000010 04 00 00 08 12 34 56 78
d12f128a
BP
227])
228AT_CHECK([ovs-ofctl encode-error-reply OFPBIC_DUP_INST 0500000812345678], [0],
327a39b6
BP
229[00000000 05 01 00 14 12 34 56 78-00 03 00 09 05 00 00 08
23000000010 12 34 56 78
d12f128a 231])
514887ee 232AT_CLEANUP