revalidator: Fix ukey stats cache updating.
[sliver-openvswitch.git] / tests / ofp-errors.at
index 5f76294..a8d7cfa 100644 (file)
@@ -18,10 +18,28 @@ AT_CLEANUP
 
 AT_SETUP([OFPT_ERROR with type OFPET_BAD_REQUEST - OF1.0])
 AT_KEYWORDS([ofp-print ofp-errors])
-AT_CHECK([ovs-ofctl ofp-print 01010014000000000001000601bbccddeeff0011], [0], [dnl
+AT_CHECK([ovs-ofctl ofp-print 0101001400000000000100060105ccddeeff0011], [0], [dnl
 OFPT_ERROR (xid=0x0): OFPBRC_BAD_LEN
+OFPT_FEATURES_REQUEST (xid=0xeeff0011):
 (***truncated to 8 bytes from 52445***)
-00000000  01 bb cc dd ee ff 00 11-                        |........        |
+00000000  01 05 cc dd ee ff 00 11-                        |........        |
+])
+AT_CLEANUP
+
+AT_SETUP([OFPT_ERROR prints type of truncated inner messages])
+AT_KEYWORDS([ofp-print ofp-errors])
+AT_CHECK([ovs-ofctl ofp-print "0101004c092529d500010006 \
+01 06 00 e0 00 00 00 01 00 00 50 54 00 00 00 01 \
+00 00 01 00 02 00 00 00 00 00 00 87 00 00 0f ff \
+ff fe 50 54 00 00 00 01 62 72 30 00 00 00 00 00 \
+00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01"], [0], [dnl
+OFPT_ERROR (xid=0x92529d5): OFPBRC_BAD_LEN
+OFPT_FEATURES_REPLY (xid=0x1):
+(***truncated to 64 bytes from 224***)
+00000000  01 06 00 e0 00 00 00 01-00 00 50 54 00 00 00 01 |..........PT....|
+00000010  00 00 01 00 02 00 00 00-00 00 00 87 00 00 0f ff |................|
+00000020  ff fe 50 54 00 00 00 01-62 72 30 00 00 00 00 00 |..PT....br0.....|
+00000030  00 00 00 00 00 00 00 00-00 00 00 01 00 00 00 01 |................|
 ])
 AT_CLEANUP
 
@@ -45,18 +63,20 @@ dnl Error type 3, code 1 is OFPFMFC_OVERLAP in OF1.0
 dnl and OFPBIC_UNSUP_INST in OF1.1, so check that value in both versions.
 AT_SETUP([OFPT_ERROR with type OFPFMFC_OVERLAP - OF1.0])
 AT_KEYWORDS([ofp-print ofp-errors])
-AT_CHECK([ovs-ofctl ofp-print 01010014000000000003000101bbccddeeff0011], [0], [dnl
+AT_CHECK([ovs-ofctl ofp-print 0101001400000000000300010106ccddeeff0011], [0], [dnl
 OFPT_ERROR (xid=0x0): OFPFMFC_OVERLAP
+OFPT_FEATURES_REPLY (xid=0xeeff0011):
 (***truncated to 8 bytes from 52445***)
-00000000  01 bb cc dd ee ff 00 11-                        |........        |
+00000000  01 06 cc dd ee ff 00 11-                        |........        |
 ])
 AT_CLEANUP
 AT_SETUP([OFPT_ERROR with type OFPBIC_UNSUP_INST - OF1.1])
 AT_KEYWORDS([ofp-print ofp-errors])
-AT_CHECK([ovs-ofctl ofp-print 02010014000000000003000102bbccddeeff0011], [0], [dnl
+AT_CHECK([ovs-ofctl ofp-print 0201001400000000000300010206ccddeeff0011], [0], [dnl
 OFPT_ERROR (OF1.1) (xid=0x0): OFPBIC_UNSUP_INST
+OFPT_FEATURES_REPLY (OF1.1) (xid=0xeeff0011):
 (***truncated to 8 bytes from 52445***)
-00000000  02 bb cc dd ee ff 00 11-                        |........        |
+00000000  02 06 cc dd ee ff 00 11-                        |........        |
 ])
 AT_CLEANUP
 
@@ -67,14 +87,37 @@ dnl Thus, for OF1.1 we translate both of the latter error codes into 3,5.
 AT_SETUP([encoding OFPBIC_* experimenter errors])
 AT_KEYWORDS([ofp-print ofp-errors])
 AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXPERIMENTER], [0], [dnl
-OpenFlow 1.0: -1,-1
-OpenFlow 1.1: 3,5
-OpenFlow 1.2: 3,5
+OpenFlow 1.1: vendor 0, type 3, code 5
+OpenFlow 1.2: vendor 0, type 3, code 5
+OpenFlow 1.3: vendor 0, type 3, code 5
+OpenFlow 1.4: vendor 0, type 3, code 5
 ])
 AT_CHECK([ovs-ofctl print-error OFPBIC_BAD_EXP_TYPE], [0], [dnl
-OpenFlow 1.0: -1,-1
-OpenFlow 1.1: 3,5
-OpenFlow 1.2: 3,6
+OpenFlow 1.1: vendor 0, type 3, code 5
+OpenFlow 1.2: vendor 0, type 3, code 6
+OpenFlow 1.3: vendor 0, type 3, code 6
+OpenFlow 1.4: vendor 0, type 3, code 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
 
@@ -84,14 +127,47 @@ AT_CHECK([ovs-ofctl ofp-print '0201001455555555 00030005 0102000811111111'], [0]
 OFPT_ERROR (OF1.1) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER
 OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
 ])
-AT_KEYWORDS([ofp-print ofp-errors])
 AT_CHECK([ovs-ofctl ofp-print '0301001455555555 00030005 0102000811111111'], [0], [dnl
-OFPT_ERROR (OF 0x03) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER
+OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXPERIMENTER
 OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
 ])
-AT_KEYWORDS([ofp-print ofp-errors])
 AT_CHECK([ovs-ofctl ofp-print '0301001455555555 00030006 0102000811111111'], [0], [dnl
-OFPT_ERROR (OF 0x03) (xid=0x55555555): OFPBIC_BAD_EXP_TYPE
+OFPT_ERROR (OF1.2) (xid=0x55555555): OFPBIC_BAD_EXP_TYPE
 OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
 ])
 AT_CLEANUP
+
+AT_SETUP([decoding experimenter errors])
+AT_KEYWORDS([ofp-print ofp-errors])
+AT_CHECK([ovs-ofctl ofp-print '0101001c55555555 b0c20000 0000232000010203 0102000811111111'], [0], [dnl
+OFPT_ERROR (xid=0x55555555): NXBRC_MUST_BE_ZERO
+OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
+])
+AT_CHECK([ovs-ofctl ofp-print '0201001c55555555 b0c20000 0000232000010203 0102000811111111'], [0], [dnl
+OFPT_ERROR (OF1.1) (xid=0x55555555): NXBRC_MUST_BE_ZERO
+OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
+])
+AT_CHECK([ovs-ofctl ofp-print '0301001855555555 ffff0004 00002320 0102000811111111'], [0], [dnl
+OFPT_ERROR (OF1.2) (xid=0x55555555): NXBRC_MUST_BE_ZERO
+OFPT_ECHO_REQUEST (xid=0x11111111): 0 bytes of payload
+])
+AT_CLEANUP
+
+AT_SETUP([encoding experimenter errors])
+AT_KEYWORDS([ofp-print ofp-errors])
+AT_CHECK(
+  [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 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 03 01 00 00 08-12 34 56 78 @&t@
+])
+AT_CHECK(
+  [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 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 03 02 00 00 08-12 34 56 78 @&t@
+])
+AT_CHECK(
+  [ovs-ofctl encode-error-reply NXBRC_MUST_BE_ZERO 0300000812345678], [0], [dnl
+00000000  03 01 00 18 12 34 56 78-ff ff 00 04 00 00 23 20 @&t@
+00000010  03 00 00 08 12 34 56 78-
+])
+AT_CLEANUP