Merge into master from pull request #81:
Allow table_id override from --test-params. (https://github.com/floodlight/oftest/pull/81)
diff --git a/tests-1.3/actions.py b/tests-1.3/actions.py
index 4d48fbe..9128f7b 100644
--- a/tests-1.3/actions.py
+++ b/tests-1.3/actions.py
@@ -36,7 +36,7 @@
logging.info("Inserting flow")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
match=packet_to_flow_match(self, pkt),
instructions=[
ofp.instruction.apply_actions(actions)],
@@ -71,7 +71,7 @@
logging.info("Inserting flow")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
match=packet_to_flow_match(self, pkt),
instructions=[
ofp.instruction.apply_actions(actions)],
@@ -103,7 +103,7 @@
logging.info("Inserting flow")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
match=packet_to_flow_match(self, pkt),
instructions=[
ofp.instruction.apply_actions(actions)],
diff --git a/tests-1.3/basic.py b/tests-1.3/basic.py
index 21dd130..d0ad11f 100644
--- a/tests-1.3/basic.py
+++ b/tests-1.3/basic.py
@@ -94,7 +94,7 @@
for out_port in ports:
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
cookie=42,
match=match,
instructions=[
@@ -134,7 +134,7 @@
for out_port in ports:
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
cookie=42,
instructions=[
ofp.instruction.apply_actions(
@@ -171,7 +171,7 @@
match = packet_to_flow_match(self, parsed_pkt)
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
cookie=42,
match=match,
instructions=[
@@ -206,7 +206,7 @@
pkt = str(simple_tcp_packet())
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
cookie=42,
instructions=[
ofp.instruction.apply_actions(
@@ -241,7 +241,7 @@
pkt = str(parsed_pkt)
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
cookie=42,
instructions=[
ofp.instruction.apply_actions(
diff --git a/tests-1.3/bsn_in_ports.py b/tests-1.3/bsn_in_ports.py
index eddcc5a..296a846 100644
--- a/tests-1.3/bsn_in_ports.py
+++ b/tests-1.3/bsn_in_ports.py
@@ -20,6 +20,7 @@
"""
def runTest(self):
in_port1, in_port2, out_port, bad_port = openflow_ports(4)
+ table_id = test_param_get("table", 0)
# See the loxigen bsn_in_ports input file for encoding details
match = ofp.match([
@@ -34,7 +35,7 @@
logging.info("Inserting flow sending matching packets to port %d", out_port)
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
match=match,
instructions=[
ofp.instruction.apply_actions(
@@ -48,7 +49,7 @@
logging.info("Inserting match-all flow sending packets to controller")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
instructions=[
ofp.instruction.apply_actions(
actions=[
diff --git a/tests-1.3/flow_stats.py b/tests-1.3/flow_stats.py
index 4a82a89..02b9cb6 100644
--- a/tests-1.3/flow_stats.py
+++ b/tests-1.3/flow_stats.py
@@ -24,10 +24,11 @@
"""
def runTest(self):
port1, port2, port3 = openflow_ports(3)
+ table_id = test_param_get("table", 0)
delete_all_flows(self.controller)
flow1 = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
priority=0x11,
idle_timeout=0x21,
hard_timeout=0x31,
@@ -45,7 +46,7 @@
buffer_id=ofp.OFP_NO_BUFFER)
flow2 = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
priority=0x12,
idle_timeout=0x22,
hard_timeout=0x32,
@@ -63,7 +64,7 @@
buffer_id=ofp.OFP_NO_BUFFER)
flow3 = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
priority=0x13,
idle_timeout=0x23,
hard_timeout=0x33,
@@ -150,9 +151,10 @@
# Generate a flow for each cookie
flows = {}
+ table_id = test_param_get("table", 0)
for idx, cookie in enumerate(cookies):
flows[cookie] = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
cookie=cookie,
match=ofp.match([ofp.oxm.vlan_vid(ofp.OFPVID_PRESENT|idx)]),
buffer_id=ofp.OFP_NO_BUFFER)
diff --git a/tests-1.3/match.py b/tests-1.3/match.py
index 0b473da..68436d3 100644
--- a/tests-1.3/match.py
+++ b/tests-1.3/match.py
@@ -35,6 +35,7 @@
packet data.
"""
in_port, out_port = openflow_ports(2)
+ table_id = test_param_get("table", 0)
logging.info("Running match test for %s", match.show())
@@ -42,7 +43,7 @@
logging.info("Inserting flow sending matching packets to port %d", out_port)
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
match=match,
instructions=[
ofp.instruction.apply_actions(
@@ -56,7 +57,7 @@
logging.info("Inserting match-all flow sending packets to controller")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
instructions=[
ofp.instruction.apply_actions(
actions=[
@@ -88,6 +89,7 @@
"""
def runTest(self):
in_port, out_port, bad_port = openflow_ports(3)
+ table_id = test_param_get("table", 0)
match = ofp.match([
ofp.oxm.in_port(in_port)
@@ -101,7 +103,7 @@
logging.info("Inserting flow sending matching packets to port %d", out_port)
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
match=match,
instructions=[
ofp.instruction.apply_actions(
@@ -115,7 +117,7 @@
logging.info("Inserting match-all flow sending packets to controller")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=table_id,
instructions=[
ofp.instruction.apply_actions(
actions=[
diff --git a/tests-1.3/pktin_match.py b/tests-1.3/pktin_match.py
index 893b5e1..efc064b 100644
--- a/tests-1.3/pktin_match.py
+++ b/tests-1.3/pktin_match.py
@@ -34,7 +34,7 @@
logging.debug("Inserting match-all flow sending packets to controller")
request = ofp.message.flow_add(
- table_id=0,
+ table_id=test_param_get("table", 0),
instructions=[
ofp.instruction.apply_actions(
actions=[