Updated var names and test parameters
pa_ was for packet action; changed to fq_. Use functional
criteria for test params.
diff --git a/tests/flow_query.py b/tests/flow_query.py
index 9183ab2..f8990ac 100644
--- a/tests/flow_query.py
+++ b/tests/flow_query.py
@@ -26,11 +26,11 @@
#@var port_map Local copy of the configuration map from OF port
# numbers to OS interfaces
-pa_port_map = None
-#@var pa_logger Local logger object
-pa_logger = None
-#@var pa_config Local copy of global configuration data
-pa_config = None
+fq_port_map = None
+#@var fq_logger Local logger object
+fq_logger = None
+#@var fq_config Local copy of global configuration data
+fq_config = None
# For test priority
test_prio = {}
@@ -45,20 +45,14 @@
basic.test_set_init(config)
- global pa_port_map
- global pa_logger
- global pa_config
+ global fq_port_map
+ global fq_logger
+ global fq_config
- pa_logger = logging.getLogger("pkt_act")
- pa_logger.info("Initializing test set")
- pa_port_map = config["port_map"]
- pa_config = config
-
- # TBD - Doesn't seem to take effect at the right time...
- if test_param_get(pa_config, "dut", "") == "ovs":
- # Disable this test by default, since the flow capacity
- # reported by OVS is bogus.
- test_prio["Flow_Add_6"] = -1
+ fq_logger = logging.getLogger("flowq")
+ fq_logger.info("Initializing test set")
+ fq_port_map = config["port_map"]
+ fq_config = config
def flip_coin():
@@ -348,11 +342,8 @@
return False
if self.hard_timeout != x.hard_timeout:
return False
- if test_param_get(pa_config, "dut", "") == "argon":
- pa_logger.debug("Doing argon-style action comparison")
- # Compare actions lists as unordered, since Argon may re-order
- # action lists.
- # This is in apparent violation of the spec.
+ if True:
+ # For now, compare actions lists as unordered
aa = copy.deepcopy(x.actions.actions)
for a in self.actions.actions:
i = 0
@@ -453,9 +444,10 @@
result = result + ("(port=%d,queue=%d)" % (a.port, a.queue_id))
return result
- def rand_actions_argon(self, fi, valid_actions, valid_ports):
+ def rand_actions_ordered(self, fi, valid_actions, valid_ports):
# Action lists are ordered, so pick an ordered random subset of
# supported actions
+ ACTION_MAX_LEN = 65535 # @fixme Should be test param?
supported_actions = []
for a in all_actions_list:
if ((1 << a) & valid_actions) != 0:
@@ -465,65 +457,46 @@
supported_actions \
= supported_actions[0 : random.randint(1, len(supported_actions))]
- # The setting of max_len to 65535 is a hack, since that's what's
- # returned by Argon for all actions (for now...)
-
self.actions = action_list.action_list()
for a in supported_actions:
+ act = None
if a == ofp.OFPAT_OUTPUT:
pass # OUTPUT actions must come last
elif a == ofp.OFPAT_SET_VLAN_VID:
act = action.action_set_vlan_vid()
act.vlan_vid = fi.rand_vlan()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_VLAN_PCP:
act = action.action_set_vlan_pcp()
act.vlan_pcp = random.randint(0, (1 << 3) - 1)
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_STRIP_VLAN:
act = action.action_strip_vlan()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_DL_SRC:
act = action.action_set_dl_src()
act.dl_addr = fi.rand_dl_addr()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_DL_DST:
act = action.action_set_dl_dst()
act.dl_addr = fi.rand_dl_addr()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_NW_SRC:
act = action.action_set_nw_src()
act.nw_addr = fi.rand_ip_addr()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_NW_DST:
act = action.action_set_nw_dst()
act.nw_addr = fi.rand_ip_addr()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_NW_TOS:
act = action.action_set_nw_tos()
act.nw_tos = fi.rand_ip_tos()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_TP_SRC:
act = action.action_set_tp_src()
act.tp_port = fi.rand_l4_port()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_SET_TP_DST:
act = action.action_set_tp_dst()
act.tp_port = fi.rand_l4_port()
- act.max_len = 65535
- self.actions.add(act)
elif a == ofp.OFPAT_ENQUEUE:
pass # Enqueue actions must come last
-
+ if act:
+ act.max_len = ACTION_MAX_LEN
+ self.actions.add(act)
+
p = random.randint(1, 100)
if p <= 33:
# One third of the time, include ENQUEUE actions at end of list
@@ -532,7 +505,7 @@
act.port = rand_pick(valid_ports)
# TBD - Limits for queue number?
act.queue_id = random.randint(0, 7)
- act.max_len = 65535
+ act.max_len = ACTION_MAX_LEN
self.actions.add(act)
elif p <= 66:
# One third of the time, include OUTPUT actions at end of list
@@ -544,7 +517,7 @@
for pi in port_idxs:
act = action.action_output()
act.port = valid_ports[pi]
- act.max_len = 65535
+ act.max_len = ACTION_MAX_LEN
if act.port != ofp.OFPP_IN_PORT \
or wildcard_get(self.match.wildcards, ofp.OFPFW_IN_PORT) == 0:
# OUTPUT(IN_PORT) only valid if OFPFW_IN_PORT not wildcarded
@@ -558,9 +531,10 @@
def rand_mod(self, fi, valid_actions, valid_ports):
self.cookie = random.randint(0, (1 << 53) - 1)
- if test_param_get(pa_config, "dut", "") == "argon":
- pa_logger.debug("Generating actions for argon")
- self.rand_actions_argon(fi, valid_actions, valid_ports)
+ # By default, test with conservative ordering conventions
+ # This should probably be indicated in a profile
+ if test_param_get(fq_config, "conservative_ordered_actions", True):
+ self.rand_actions_ordered(fi, valid_actions, valid_ports)
return self
# Action lists are ordered, so pick an ordered random subset of
@@ -589,14 +563,8 @@
act.vlan_vid = fi.rand_vlan()
self.actions.add(act)
elif a == ofp.OFPAT_SET_VLAN_PCP:
- if test_param_get(pa_config, "dut", "") == "indigo":
- pa_logger.debug("OFPAT_SET_VLAN_PCP broken on indigo")
- pa_logger.debug("not using")
- # Temporaily removed, broken in Indigo
- pass
- else:
- act = action.action_set_vlan_pcp()
- act.vlan_pcp = random.randint(0, (1 << 3) - 1)
+ act = action.action_set_vlan_pcp()
+ act.vlan_pcp = random.randint(0, (1 << 3) - 1)
elif a == ofp.OFPAT_STRIP_VLAN:
act = action.action_strip_vlan()
self.actions.add(act)
@@ -778,34 +746,24 @@
1 \
)
- if test_param_get(pa_config, "dut", "") == "ovs":
- pa_logger.debug("Flow canonicalization broken")
- pa_logger.debug("for OFPFW_NW_PROTO on ovs, always wildcarding")
- # Due to a bug in OVS, don't specify nw_proto on it's own.
- # OVS will allow specifying a value for nw_proto, even
- # if dl_type is not specified as IP.
+ # Known issue on OVS with specifying nw_proto w/o dl_type as IP
+ if wildcard_get(valid_wildcards, ofp.OFPFW_NW_PROTO) == 0 \
+ or exact \
+ or flip_coin():
+ self.match.nw_proto = fi.rand_ip_proto()
+ # Specifying an IP protocol requires that Ethertype is IP
+ if flip_coin():
+ self.match.dl_type = 0x0800
+ self.match.wildcards = wildcard_set(self.match.wildcards, \
+ ofp.OFPFW_DL_TYPE, \
+ 0 \
+ )
+ else:
self.match.wildcards = wildcard_set(self.match.wildcards, \
ofp.OFPFW_NW_PROTO, \
1 \
)
- else:
- if wildcard_get(valid_wildcards, ofp.OFPFW_NW_PROTO) == 0 \
- or exact \
- or flip_coin():
- self.match.nw_proto = fi.rand_ip_proto()
- # Specifying an IP protocol requires that Ethertype is IP
- if flip_coin():
- self.match.dl_type = 0x0800
- self.match.wildcards = wildcard_set(self.match.wildcards, \
- ofp.OFPFW_DL_TYPE, \
- 0 \
- )
- else:
- self.match.wildcards = wildcard_set(self.match.wildcards, \
- ofp.OFPFW_NW_PROTO, \
- 1 \
- )
-
+
if wildcard_get(valid_wildcards, ofp.OFPFW_TP_SRC) == 0 \
or exact\
or flip_coin():
@@ -1089,7 +1047,7 @@
removed_msgs = []
def error_handler(self, msg, rawmsg):
- pa_logger.debug("Got an ERROR message, type=%d, code=%d" \
+ fq_logger.debug("Got an ERROR message, type=%d, code=%d" \
% (msg.type, msg.code) \
)
global error_msgs
@@ -1097,7 +1055,7 @@
pass
def removed_handler(self, msg, rawmsg):
- pa_logger.debug("Got a REMOVED message")
+ fq_logger.debug("Got a REMOVED message")
global removed_msgs
removed_msgs.append(msg)
pass
@@ -1219,64 +1177,64 @@
def errors_verify(self, num_exp, type = 0, code = 0):
result = True
global error_msgs
- pa_logger.debug("Expecting %d error messages" % (num_exp))
+ fq_logger.debug("Expecting %d error messages" % (num_exp))
num_got = len(error_msgs)
- pa_logger.debug("Got %d error messages" % (num_got))
+ fq_logger.debug("Got %d error messages" % (num_got))
if num_got != num_exp:
- pa_logger.error("Incorrect number of error messages received")
+ fq_logger.error("Incorrect number of error messages received")
result = False
if num_exp == 0:
return result
elif num_exp == 1:
- pa_logger.debug("Expecting error message, type=%d, code=%d" \
+ fq_logger.debug("Expecting error message, type=%d, code=%d" \
% (type, code) \
)
f = False
for e in error_msgs:
if e.type == type and e.code == code:
- pa_logger.debug("Got it")
+ fq_logger.debug("Got it")
f = True
if not f:
- pa_logger.error("Did not get it")
+ fq_logger.error("Did not get it")
result = False
else:
- pa_logger.error("Can't expect more than 1 error message type")
+ fq_logger.error("Can't expect more than 1 error message type")
result = False
return result
def removed_verify(self, num_exp):
result = True
global removed_msgs
- pa_logger.debug("Expecting %d removed messages" % (num_exp))
+ fq_logger.debug("Expecting %d removed messages" % (num_exp))
num_got = len(removed_msgs)
- pa_logger.debug("Got %d removed messages" % (num_got))
+ fq_logger.debug("Got %d removed messages" % (num_got))
if num_got != num_exp:
- pa_logger.error("Incorrect number of removed messages received")
+ fq_logger.error("Incorrect number of removed messages received")
result = False
if num_exp < 2:
return result
- pa_logger.error("Can't expect more than 1 error message type")
+ fq_logger.error("Can't expect more than 1 error message type")
return False
-# pa_logger.debug("Expecting %d error messages" % (num))
+# fq_logger.debug("Expecting %d error messages" % (num))
# if num > 0:
-# pa_logger.debug("with type=%d code=%d" % (type, code))
+# fq_logger.debug("with type=%d code=%d" % (type, code))
# result = True
# n = 0
# while True:
# (errmsg, pkt) = self.controller.poll(ofp.OFPT_ERROR, 1)
# if errmsg is None:
# break
-# pa_logger.debug("Got error message, type=%d, code=%d" \
+# fq_logger.debug("Got error message, type=%d, code=%d" \
# % (errmsg.type, errmsg.code) \
# )
# if num == 0 or errmsg.type != type or errmsg.code != code:
-# pa_logger.debug("Unexpected error message")
+# fq_logger.debug("Unexpected error message")
# result = False
# n = n + 1
# if n != num:
-# pa_logger.error("Received %d error messages" % (n))
+# fq_logger.error("Received %d error messages" % (n))
# result = False
# return result
@@ -1284,62 +1242,62 @@
result = True
# Verify flow count in switch
- pa_logger.debug("Reading table stats")
- pa_logger.debug("Expecting %d flows" % (self.flow_tbl.count()))
+ fq_logger.debug("Reading table stats")
+ fq_logger.debug("Expecting %d flows" % (self.flow_tbl.count()))
if not self.tbl_stats_get():
- pa_logger.error("Get table stats failed")
+ fq_logger.error("Get table stats failed")
return False
n = 0
for ts in self.tbl_stats.stats:
n = n + ts.active_count
- pa_logger.debug("Table stats reported %d active flows" \
+ fq_logger.debug("Table stats reported %d active flows" \
% (n) \
)
if n != self.flow_tbl.count():
- pa_logger.error("Incorrect number of active flows reported")
+ fq_logger.error("Incorrect number of active flows reported")
result = False
# Read flows from switch
- pa_logger.debug("Retrieving flows from switch")
- pa_logger.debug("Expecting %d flows" % (self.flow_tbl.count()))
+ fq_logger.debug("Retrieving flows from switch")
+ fq_logger.debug("Expecting %d flows" % (self.flow_tbl.count()))
if not self.flow_stats_get():
- pa_logger.error("Get flow stats failed")
+ fq_logger.error("Get flow stats failed")
return False
- pa_logger.debug("Retrieved %d flows" % (len(self.flow_stats.stats)))
+ fq_logger.debug("Retrieved %d flows" % (len(self.flow_stats.stats)))
# Verify flows returned by switch
if len(self.flow_stats.stats) != self.flow_tbl.count():
- pa_logger.error("Switch reported incorrect number of flows")
+ fq_logger.error("Switch reported incorrect number of flows")
result = False
- pa_logger.debug("Verifying received flows")
+ fq_logger.debug("Verifying received flows")
for fc in self.flow_tbl.values():
fc.matched = False
for fs in self.flow_stats.stats:
flow_in = Flow_Cfg()
flow_in.from_flow_stat(fs)
- pa_logger.debug("Received flow:")
- pa_logger.debug(str(flow_in))
+ fq_logger.debug("Received flow:")
+ fq_logger.debug(str(flow_in))
fc = self.flow_tbl.find(flow_in)
if fc is None:
- pa_logger.error("does not match any defined flow")
+ fq_logger.error("does not match any defined flow")
result = False
elif fc.matched:
- pa_logger.error("re-matches defined flow:")
- pa_logger.debug(str(fc))
+ fq_logger.error("re-matches defined flow:")
+ fq_logger.debug(str(fc))
result = False
else:
- pa_logger.debug("matched")
+ fq_logger.debug("matched")
if not flow_in == fc:
- pa_logger.error("Non-key portions of flow do not match")
+ fq_logger.error("Non-key portions of flow do not match")
result = False
fc.matched = True
for fc in self.flow_tbl.values():
if not fc.matched:
- pa_logger.error("Defined flow:")
- pa_logger.error(str(fc))
- pa_logger.error("was not returned by switch")
+ fq_logger.error("Defined flow:")
+ fq_logger.error(str(fc))
+ fq_logger.error("was not returned by switch")
result = False
return result
@@ -1354,19 +1312,19 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Add_5 TEST BEGIN")
+ fq_logger.debug("Flow_Add_5 TEST BEGIN")
- num_flows = test_param_get(pa_config, "num_flows", 100)
+ num_flows = test_param_get(fq_config, "num_flows", 100)
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1379,7 +1337,7 @@
for ts in sw.tbl_stats.stats:
num_flows = num_flows + ts.max_entries
- pa_logger.debug("Generating %d flows" % (num_flows))
+ fq_logger.debug("Generating %d flows" % (num_flows))
# Dream up some flow information, i.e. space to chose from for
# random flow parameter generation
@@ -1394,10 +1352,10 @@
# Send flow table to switch
- pa_logger.debug("Sending flow adds to switch")
+ fq_logger.debug("Sending flow adds to switch")
for fc in ft.values(): # Randomizes order of sending
- pa_logger.debug("Adding flow:")
- pa_logger.debug(str(fc));
+ fq_logger.debug("Adding flow:")
+ fq_logger.debug(str(fc));
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
# Do barrier, to make sure all flows are in
@@ -1418,7 +1376,7 @@
result = False
self.assertTrue(result, "Flow_Add_5 TEST FAILED")
- pa_logger.debug("Flow_Add_5 TEST PASSED")
+ fq_logger.debug("Flow_Add_5 TEST PASSED")
class Flow_Add_5_1(basic.SimpleProtocol):
@@ -1430,19 +1388,19 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Add_5_1 TEST BEGIN")
+ fq_logger.debug("Flow_Add_5_1 TEST BEGIN")
- num_flows = test_param_get(pa_config, "num_flows", 100)
+ num_flows = test_param_get(fq_config, "num_flows", 100)
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1472,10 +1430,10 @@
# Send it to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
- pa_logger.debug("should be canonicalized as:")
- pa_logger.debug(str(fcc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
+ fq_logger.debug("should be canonicalized as:")
+ fq_logger.debug(str(fcc))
fc.send_rem = False
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -1497,7 +1455,7 @@
result = False
self.assertTrue(result, "Flow_Add_5_1 TEST FAILED")
- pa_logger.debug("Flow_Add_5_1 TEST PASSED")
+ fq_logger.debug("Flow_Add_5_1 TEST PASSED")
# Disabled because of bogus capacity reported by OVS.
@@ -1513,17 +1471,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Add_6 TEST BEGIN")
+ fq_logger.debug("Flow_Add_6 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1533,8 +1491,8 @@
for ts in sw.tbl_stats.stats:
num_flows = num_flows + ts.max_entries
- pa_logger.debug("Switch capacity is %d flows" % (num_flows))
- pa_logger.debug("Generating %d flows" % (num_flows))
+ fq_logger.debug("Switch capacity is %d flows" % (num_flows))
+ fq_logger.debug("Generating %d flows" % (num_flows))
# Dream up some flow information, i.e. space to chose from for
# random flow parameter generation
@@ -1549,10 +1507,10 @@
# Send flow table to switch
- pa_logger.debug("Sending flow adds to switch")
+ fq_logger.debug("Sending flow adds to switch")
for fc in ft.values(): # Randomizes order of sending
- pa_logger.debug("Adding flow:")
- pa_logger.debug(str(fc));
+ fq_logger.debug("Adding flow:")
+ fq_logger.debug(str(fc));
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
# Do barrier, to make sure all flows are in
@@ -1568,7 +1526,7 @@
# Dream up one more flow
- pa_logger.debug("Creating one more flow")
+ fq_logger.debug("Creating one more flow")
while True:
fc = Flow_Cfg()
fc.rand(fi, \
@@ -1583,8 +1541,8 @@
# Send one-more flow
fc.send_rem = False
- pa_logger.debug("Sending flow add switch")
- pa_logger.debug(str(fc));
+ fq_logger.debug("Sending flow add switch")
+ fq_logger.debug(str(fc));
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
# Do barrier, to make sure all flows are in
@@ -1606,7 +1564,7 @@
result = False
self.assertTrue(result, "Flow_add_6 TEST FAILED")
- pa_logger.debug("Flow_add_6 TEST PASSED")
+ fq_logger.debug("Flow_add_6 TEST PASSED")
class Flow_Add_7(basic.SimpleProtocol):
@@ -1618,17 +1576,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Add_7 TEST BEGIN")
+ fq_logger.debug("Flow_Add_7 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1652,8 +1610,8 @@
# Send it to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = False
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -1672,8 +1630,8 @@
# Send that to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc2))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc2))
fc2.send_rem = False
self.assertTrue(sw.flow_add(fc2), "Failed to add flow")
ft.insert(fc2)
@@ -1696,7 +1654,7 @@
result = False
self.assertTrue(result, "Flow_Add_7 TEST FAILED")
- pa_logger.debug("Flow_Add_7 TEST PASSED")
+ fq_logger.debug("Flow_Add_7 TEST PASSED")
class Flow_Add_8(basic.SimpleProtocol):
@@ -1708,17 +1666,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Add_8 TEST BEGIN")
+ fq_logger.debug("Flow_Add_8 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1745,8 +1703,8 @@
# Send it to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = False
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -1768,13 +1726,13 @@
wn = "OFPFW_NW_DST"
else:
wn = all_wildcard_names[w]
- pa_logger.debug("Wildcarding out %s" % (wn))
+ fq_logger.debug("Wildcarding out %s" % (wn))
fc2.match.wildcards = fc2.match.wildcards | w
# Send that to the switch, with overlap checking
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc2))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc2))
fc2.send_rem = False
self.assertTrue(sw.flow_add(fc2, True), "Failed to add flow")
@@ -1798,7 +1756,7 @@
result = False
self.assertTrue(result, "Flow_Add_8 TEST FAILED")
- pa_logger.debug("Flow_Add_8 TEST PASSED")
+ fq_logger.debug("Flow_Add_8 TEST PASSED")
class Flow_Mod_1(basic.SimpleProtocol):
@@ -1810,17 +1768,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Mod_1 TEST BEGIN")
+ fq_logger.debug("Flow_Mod_1 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1844,8 +1802,8 @@
# Send it to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = False
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -1864,8 +1822,8 @@
# Send that to the switch
- pa_logger.debug("Sending strict flow mod to switch:")
- pa_logger.debug(str(fc2))
+ fq_logger.debug("Sending strict flow mod to switch:")
+ fq_logger.debug(str(fc2))
fc2.send_rem = False
self.assertTrue(sw.flow_mod(fc2, True), "Failed to modify flow")
ft.insert(fc2)
@@ -1888,7 +1846,7 @@
result = False
self.assertTrue(result, "Flow_Mod_1 TEST FAILED")
- pa_logger.debug("Flow_Mod_1 TEST PASSED")
+ fq_logger.debug("Flow_Mod_1 TEST PASSED")
class Flow_Mod_2(basic.SimpleProtocol):
@@ -1900,19 +1858,19 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Mod_2 TEST BEGIN")
+ fq_logger.debug("Flow_Mod_2 TEST BEGIN")
- num_flows = test_param_get(pa_config, "num_flows", 100)
+ num_flows = test_param_get(fq_config, "num_flows", 100)
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -1932,10 +1890,10 @@
# Send flow table to switch
- pa_logger.debug("Sending flow adds to switch")
+ fq_logger.debug("Sending flow adds to switch")
for fc in ft.values(): # Randomizes order of sending
- pa_logger.debug("Adding flow:")
- pa_logger.debug(str(fc));
+ fq_logger.debug("Adding flow:")
+ fq_logger.debug(str(fc));
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
# Do barrier, to make sure all flows are in
@@ -1991,9 +1949,9 @@
if n > 1:
break
- pa_logger.debug("Modifying %d flows" % (n))
- pa_logger.debug("Sending flow mod to switch:")
- pa_logger.debug(str(mfc))
+ fq_logger.debug("Modifying %d flows" % (n))
+ fq_logger.debug("Sending flow mod to switch:")
+ fq_logger.debug(str(mfc))
self.assertTrue(sw.flow_mod(mfc, False), "Failed to modify flow")
# Do barrier, to make sure all flows are in
@@ -2018,7 +1976,7 @@
result = False
self.assertTrue(result, "Flow_Mod_2 TEST FAILED")
- pa_logger.debug("Flow_Mod_2 TEST PASSED")
+ fq_logger.debug("Flow_Mod_2 TEST PASSED")
class Flow_Mod_3(basic.SimpleProtocol):
@@ -2030,17 +1988,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Mod_3 TEST BEGIN")
+ fq_logger.debug("Flow_Mod_3 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -2064,8 +2022,8 @@
# Send it to the switch
- pa_logger.debug("Sending flow mod to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow mod to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = False
self.assertTrue(sw.flow_mod(fc, True), "Failed to modify flows")
@@ -2089,7 +2047,7 @@
result = False
self.assertTrue(result, "Flow_Mod_3 TEST FAILED")
- pa_logger.debug("Flow_Mod_3 TEST PASSED")
+ fq_logger.debug("Flow_Mod_3 TEST PASSED")
class Flow_Del_1(basic.SimpleProtocol):
@@ -2101,17 +2059,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Del_1 TEST BEGIN")
+ fq_logger.debug("Flow_Del_1 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -2135,8 +2093,8 @@
# Send it to the switch
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = False
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -2155,8 +2113,8 @@
# Delete strictly
- pa_logger.debug("Sending strict flow del to switch:")
- pa_logger.debug(str(fc2))
+ fq_logger.debug("Sending strict flow del to switch:")
+ fq_logger.debug(str(fc2))
self.assertTrue(sw.flow_del(fc2, True), "Failed to delete flow")
ft.delete(fc)
@@ -2178,7 +2136,7 @@
result = False
self.assertTrue(result, "Flow_Del_1 TEST FAILED")
- pa_logger.debug("Flow_Del_1 TEST PASSED")
+ fq_logger.debug("Flow_Del_1 TEST PASSED")
class Flow_Del_2(basic.SimpleProtocol):
@@ -2190,19 +2148,19 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Del_2 TEST BEGIN")
+ fq_logger.debug("Flow_Del_2 TEST BEGIN")
- num_flows = test_param_get(pa_config, "num_flows", 100)
+ num_flows = test_param_get(fq_config, "num_flows", 100)
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -2222,10 +2180,10 @@
# Send flow table to switch
- pa_logger.debug("Sending flow adds to switch")
+ fq_logger.debug("Sending flow adds to switch")
for fc in ft.values(): # Randomizes order of sending
- pa_logger.debug("Adding flow:")
- pa_logger.debug(str(fc));
+ fq_logger.debug("Adding flow:")
+ fq_logger.debug(str(fc));
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
# Do barrier, to make sure all flows are in
@@ -2281,9 +2239,9 @@
if n > 1:
break
- pa_logger.debug("Deleting %d flows" % (n))
- pa_logger.debug("Sending flow del to switch:")
- pa_logger.debug(str(dfc))
+ fq_logger.debug("Deleting %d flows" % (n))
+ fq_logger.debug("Sending flow del to switch:")
+ fq_logger.debug(str(dfc))
self.assertTrue(sw.flow_del(dfc, False), "Failed to delete flows")
# Do barrier, to make sure all flows are in
@@ -2307,7 +2265,7 @@
result = False
self.assertTrue(result, "Flow_Del_2 TEST FAILED")
- pa_logger.debug("Flow_Del_2 TEST PASSED")
+ fq_logger.debug("Flow_Del_2 TEST PASSED")
class Flow_Del_4(basic.SimpleProtocol):
@@ -2319,17 +2277,17 @@
"""
def runTest(self):
- pa_logger.debug("Flow_Del_4 TEST BEGIN")
+ fq_logger.debug("Flow_Del_4 TEST BEGIN")
# Clear all flows from switch
- pa_logger.debug("Deleting all flows from switch")
- rc = delete_all_flows(self.controller, pa_logger)
+ fq_logger.debug("Deleting all flows from switch")
+ rc = delete_all_flows(self.controller, fq_logger)
self.assertEqual(rc, 0, "Failed to delete all flows")
# Get switch capabilites
- pa_logger.debug("Getting switch capabilities")
+ fq_logger.debug("Getting switch capabilities")
sw = Switch()
sw.controller_set(self.controller)
self.assertTrue(sw.features_get(), "Get switch features failed")
@@ -2353,8 +2311,8 @@
# Send it to the switch. with "notify on removed"
- pa_logger.debug("Sending flow add to switch:")
- pa_logger.debug(str(fc))
+ fq_logger.debug("Sending flow add to switch:")
+ fq_logger.debug(str(fc))
ft = Flow_Tbl()
fc.send_rem = True
self.assertTrue(sw.flow_add(fc), "Failed to add flow")
@@ -2373,8 +2331,8 @@
# Delete strictly
- pa_logger.debug("Sending strict flow del to switch:")
- pa_logger.debug(str(fc2))
+ fq_logger.debug("Sending strict flow del to switch:")
+ fq_logger.debug(str(fc2))
self.assertTrue(sw.flow_del(fc2, True), "Failed to delete flow")
ft.delete(fc)
@@ -2399,5 +2357,5 @@
result = False
self.assertTrue(result, "Flow_Del_4 TEST FAILED")
- pa_logger.debug("Flow_Del_4 TEST PASSED")
+ fq_logger.debug("Flow_Del_4 TEST PASSED")