aboutsummaryrefslogtreecommitdiff
path: root/tests/ofproto.at
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2011-06-15 09:43:03 -0700
committerBen Pfaff <blp@nicira.com>2011-06-15 10:34:13 -0700
commit05411977195ce5095c8c4a0d4b6472bdad99008e (patch)
tree241f7f1f1fc083d0ce01c9ca422fd15fcd762685 /tests/ofproto.at
parent184b5de475ea6dcb91d4e89271303af04e75f7de (diff)
ofp-util: Send table_id correctly in OpenFlow 1.0 flow_mods.
This fixes "ovs-ofctl add-flow <bridge> table=<number>,..." and similar commands. Reported-by: Hao Zheng <hzheng@nicira.com>
Diffstat (limited to 'tests/ofproto.at')
-rw-r--r--tests/ofproto.at8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/ofproto.at b/tests/ofproto.at
index cf4f9a13..e6def3ec 100644
--- a/tests/ofproto.at
+++ b/tests/ofproto.at
@@ -48,6 +48,10 @@ AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS], [0], [NXST_FLOW reply:
])
AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl add-flows br0 -])
AT_CHECK([ovs-ofctl add-flow br0 in_port=0,actions=1])
+# Check that a table_id is really sent:
+AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=0,actions=1 2>&1 | STRIP_XIDS | sed 1q], [0], [dnl
+OFPT_ERROR: type OFPET_FLOW_MOD_FAILED, code NXFMFC_BAD_TABLE_ID
+])
AT_CHECK([ovs-ofctl dump-flows br0 | STRIP_XIDS | STRIP_DURATION | sort], [0], [dnl
cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=0 actions=output:1
cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=1 actions=output:0
@@ -68,6 +72,10 @@ AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | STRIP_XIDS], [0], [OFPST_FLOW
])
AT_CHECK([echo 'in_port=1,actions=0' | ovs-ofctl -F openflow10 add-flows br0 -])
AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=0,actions=1])
+# Check that a table_id is really sent:
+AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=0,actions=1 2>&1 | STRIP_XIDS | sed 1q], [0], [dnl
+OFPT_ERROR: type OFPET_FLOW_MOD_FAILED, code NXFMFC_BAD_TABLE_ID
+])
AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | STRIP_XIDS | STRIP_DURATION | sort], [0], [dnl
cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=0 actions=output:1
cookie=0x0, duration=?s, table=0, n_packets=0, n_bytes=0, in_port=1 actions=output:0