summaryrefslogtreecommitdiff
path: root/tests/ofp-errors.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-11-30 14:18:03 -0800
committerBen Pfaff <blp@nicira.com>2012-12-04 08:25:56 -0800
commitedd70aa7715800f4b109f879e448c8efa40dadd5 (patch)
treee76edcbef9dd91bd80a62b19ec44492eb2fe3ea3 /tests/ofp-errors.at
parent15549878535c7331c3952e656a2eb9944d0021bb (diff)
downloadopenvswitch-edd70aa7715800f4b109f879e448c8efa40dadd5.tar.gz
ofp-errors: Correctly encode errors as extensions or not depending on domain.
When ofp-errors was introduced, each OFPERR_* was either an extension or not. However, since then, some Nicira extension error code have been given official error codes in later OpenFlow versions, so now whether an OFPERR_* is an extension depends on the OpenFlow versions. This means that certain errors were encoded incorrectly as extensions in later OpenFlow versions. This commit fixes the problem. This commit also adds a test that should prevent a regression. Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'tests/ofp-errors.at')
-rw-r--r--tests/ofp-errors.at21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ofp-errors.at b/tests/ofp-errors.at
index 9ed33e502..e99aca9af 100644
--- a/tests/ofp-errors.at
+++ b/tests/ofp-errors.at
@@ -100,6 +100,27 @@ OpenFlow 1.3: 3,6
])
AT_CLEANUP
+dnl The "bad role" error was a Nicira extension in OpenFlow 1.0 and 1.1.
+dnl It was adopted as an official error code in OpenFlow 1.2.
+AT_SETUP([encoding errors extension that became official])
+AT_KEYWORDS([ofp-print ofp-errors])
+AT_CHECK(
+ [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0100000812345678], [0], [dnl
+00000000 01 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 @&t@
+00000010 00 01 02 01 01 00 00 08-12 34 56 78 @&t@
+])
+AT_CHECK(
+ [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0200000812345678], [0], [dnl
+00000000 02 01 00 1c 12 34 56 78-b0 c2 00 00 00 00 23 20 @&t@
+00000010 00 01 02 01 02 00 00 08-12 34 56 78 @&t@
+])
+AT_CHECK(
+ [ovs-ofctl encode-error-reply OFPRRFC_BAD_ROLE 0300000812345678], [0], [dnl
+00000000 03 01 00 14 12 34 56 78-00 0b 00 02 03 00 00 08 @&t@
+00000010 12 34 56 78 @&t@
+])
+AT_CLEANUP
+
AT_SETUP([decoding OFPBIC_* experimenter errors])
AT_KEYWORDS([ofp-print ofp-errors])
AT_CHECK([ovs-ofctl ofp-print '0201001455555555 00030005 0102000811111111'], [0], [dnl