tests: Add bundle action test with buffer realloc.
[cascardo/ovs.git] / tests / ofp-print.at
index 24e602e..8e97434 100644 (file)
@@ -2546,6 +2546,15 @@ OFPT_QUEUE_GET_CONFIG_REQUEST (OF1.2) (xid=0x1): port=1
 ])
 AT_CLEANUP
 
+AT_SETUP([OFPST_QUEUE_DESC request - OF1.4])
+AT_KEYWORDS([ofp-print OFPT_QUEUE_GET_CONFIG_REQUEST])
+AT_CHECK([ovs-ofctl ofp-print "\
+05 12 00 18 00 00 00 01 00 0f 00 00 00 00 00 00 \
+00 00 00 01 00 00 00 02"], [0],
+  [OFPST_QUEUE_DESC request (OF1.4) (xid=0x1): port=1 queue=2
+])
+AT_CLEANUP
+
 AT_SETUP([OFPT_QUEUE_GET_CONFIG_REPLY - OF1.0])
 AT_KEYWORDS([ofp-print])
 AT_CHECK([ovs-ofctl ofp-print "01 15 00 40 00 00 00 01 \
@@ -2591,22 +2600,67 @@ queue 17476:
 ])
 AT_CLEANUP
 
+AT_SETUP([OFPT_QUEUE_GET_CONFIG_REPLY - OF1.3])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "04 17 00 50 00 00 00 01 \
+00 00 00 01 00 00 00 00 \
+00 00 55 55 00 00 00 01 00 30 00 00 00 00 00 00 \
+00 01 00 10 00 00 00 00 01 f4 00 00 00 00 00 00 \
+00 02 00 10 00 00 00 00 02 ee 00 00 00 00 00 00 \
+00 00 44 44 00 08 00 01 00 10 00 00 00 00 00 00 \
+"], [0], [dnl
+OFPT_QUEUE_GET_CONFIG_REPLY (OF1.3) (xid=0x1): port=1
+queue 21845: min_rate:50.0% max_rate:75.0%
+queue 17476:
+])
+AT_CLEANUP
+
+# OF1.4 renamed OFPT_QUEUE_GET_CONFIG_REPLY to OFPST_QUEUE_DESC.
+AT_SETUP([OFPST_QUEUE_DESC reply - OF1.4])
+AT_KEYWORDS([ofp-print OFPT_QUEUE_GET_CONFIG_REPLY])
+AT_CHECK([ovs-ofctl ofp-print "\
+05 13 00 48 00 00 00 01 00 0f 00 00 00 00 00 00 \
+
+00 00 00 01 00 00 55 55 00 20 00 00 00 00 00 00 \
+00 01 00 08 01 f4 00 00 \
+00 02 00 08 02 ee 00 00 \
+
+00 00 00 02 00 00 44 44 00 18 00 00 00 00 00 00 \
+00 02 00 08 00 64 00 00 \
+"], [0], [dnl
+OFPST_QUEUE_DESC reply (OF1.4) (xid=0x1): port=1
+queue 21845: min_rate:50.0% max_rate:75.0%
+port=2
+queue 17476: max_rate:10.0%
+])
+AT_CLEANUP
+
 AT_SETUP([OFPT_SET_ASYNC - OF1.3])
 AT_KEYWORDS([ofp-print])
+dnl This message has bit 12 set for the PACKET_IN messages (master and slave).
+dnl Those aren't supported bits so they get silently ignored on decoding.
+dnl That seems reasonable because OF1.3 doesn't define any error codes for
+dnl OFPT_SET_ASYNC.
 AT_CHECK([ovs-ofctl ofp-print "\
 04 1c 00 20 00 00 00 00 00 00 10 05 00 00 10 07 \
 00 00 00 03 00 00 00 07 00 00 00 00 00 00 00 03 \
 "], [0], [dnl
 OFPT_SET_ASYNC (OF1.3) (xid=0x0):
  master:
-       PACKET_IN: no_match invalid_ttl 12
+       PACKET_IN: no_match invalid_ttl
      PORT_STATUS: add delete
     FLOW_REMOVED: (off)
+     ROLE_STATUS: (off)
+    TABLE_STATUS: (off)
+  REQUESTFORWARD: (off)
 
  slave:
-       PACKET_IN: no_match action invalid_ttl 12
+       PACKET_IN: no_match action invalid_ttl
      PORT_STATUS: add delete modify
     FLOW_REMOVED: idle hard
+     ROLE_STATUS: (off)
+    TABLE_STATUS: (off)
+  REQUESTFORWARD: (off)
 ])
 AT_CLEANUP
 
@@ -2742,7 +2796,7 @@ AT_CHECK([ovs-ofctl ofp-print "\
 01 04 00 14 00 00 00 02 00 00 23 20 00 00 00 10 \
 00 00 00 01 \
 "], [0], [dnl
-NXT_SET_PACKET_IN_FORMAT (xid=0x2): format=nxm
+NXT_SET_PACKET_IN_FORMAT (xid=0x2): format=nxt_packet_in
 ])
 AT_CLEANUP
 
@@ -2792,8 +2846,33 @@ tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,n
 ])
 AT_CLEANUP
 
+AT_SETUP([NX_PACKET_IN2])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "
+01 04 0098 00000000 00002320 0000001e
+0000 0034
+  82 82 82 82 82 82 80 81 81 81 81 81 81 00 00 50
+  08 00 45 00 00 28 00 00 00 00 00 06 32 05 53 53
+  53 53 54 54 54 54 00 55 00 56 00 00 00 00 00 00   00000000
+0001 0008 00000040
+0002 0008 00000114
+0003 0005 07   000000
+0004 0010 00000000   fedcba9876543210
+0005 0005 01   000000
+0006 0010 80000408 5a5a5a5a5a5a5a5a
+0007 0009 0102030405  00000000000000
+"
+], [0], [dnl
+NXT_PACKET_IN2 (xid=0x0): table_id=7 cookie=0xfedcba9876543210 total_len=64 metadata=0x5a5a5a5a5a5a5a5a (via action) data_len=48 buffer=0x00000114
+ userdata=01.02.03.04.05
+ip,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=0.0.0.0,nw_dst=0.0.0.0,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
+])
+AT_CLEANUP
+
 AT_SETUP([NXT_SET_ASYNC_CONFIG])
 AT_KEYWORDS([ofp-print])
+dnl This message has bit 12 set for the PACKET_IN messages (master and slave).
+dnl Those aren't supported bits so they get silently ignored on decoding.
 AT_CHECK([ovs-ofctl ofp-print "\
 01 04 00 28 00 00 00 00 00 00 23 20 00 00 00 13 \
 00 00 10 05 00 00 10 07 00 00 00 03 00 00 00 07 \
@@ -2801,14 +2880,20 @@ AT_CHECK([ovs-ofctl ofp-print "\
 "], [0], [dnl
 NXT_SET_ASYNC_CONFIG (xid=0x0):
  master:
-       PACKET_IN: no_match invalid_ttl 12
+       PACKET_IN: no_match invalid_ttl
      PORT_STATUS: add delete
     FLOW_REMOVED: (off)
+     ROLE_STATUS: (off)
+    TABLE_STATUS: (off)
+  REQUESTFORWARD: (off)
 
  slave:
-       PACKET_IN: no_match action invalid_ttl 12
+       PACKET_IN: no_match action invalid_ttl
      PORT_STATUS: add delete modify
     FLOW_REMOVED: idle hard
+     ROLE_STATUS: (off)
+    TABLE_STATUS: (off)
+  REQUESTFORWARD: (off)
 ])
 AT_CLEANUP
 
@@ -2848,6 +2933,9 @@ AT_CHECK([ovs-ofctl ofp-print "\
 00 05 00 08 00 00 00 05 \
 "], [0], [dnl
 OFPT_SET_ASYNC (OF1.4) (xid=0x2): ***decode error: OFPACFC_INVALID***
+], [stderr])
+AT_CHECK([sed 's/.*|//' stderr], [0],
+  [bad value 0x40 for PACKET_IN (allowed mask 0x3f)
 ])
 AT_CLEANUP
 
@@ -2860,6 +2948,9 @@ AT_CHECK([ovs-ofctl ofp-print "\
 00 05 00 08 00 00 00 05\
 "], [0], [dnl
 OFPT_SET_ASYNC (OF1.4) (xid=0x2): ***decode error: OFPACFC_UNSUPPORTED***
+], [stderr])
+AT_CHECK([sed 's/.*|//' stderr], [0],
+  [unknown async config property type 17
 ])
 AT_CLEANUP
 
@@ -3023,6 +3114,18 @@ NXT_FLOW_MOD_TABLE_ID (xid=0x1020304): enable
 ])
 AT_CLEANUP
 
+AT_SETUP([NXT_RESUME])
+AT_KEYWORDS([ofp-print])
+AT_CHECK([ovs-ofctl ofp-print "\
+01 04 0038 01020304 00002320 0000001c \
+0000 0012 ffffffffffff 102030405060 1234 000000000000 \
+0006 000a 00000002 fffd 000000000000
+"], [0], [dnl
+NXT_RESUME (xid=0x1020304): total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
+vlan_tci=0x0000,dl_src=10:20:30:40:50:60,dl_dst=ff:ff:ff:ff:ff:ff,dl_type=0x1234
+])
+AT_CLEANUP
+
 AT_SETUP([NXST_FLOW request])
 AT_KEYWORDS([ofp-print OFPT_STATS_REQUEST])
 AT_CHECK([ovs-ofctl ofp-print "\