diff --git a/oft b/oft
index fc62193..7205505 100755
--- a/oft
+++ b/oft
@@ -468,8 +468,7 @@
     print "Test List:"
     for (modname, (mod, tests)) in test_modules.items():
         mod_count += 1
-        desc = (mod.__doc__ or "").strip()
-        desc = desc.split('\n')[0]
+        desc = (mod.__doc__ or "No description").strip().split('\n')[0]
         start_str = "  Module " + mod.__name__ + ": "
         print start_str + _space_to(22, start_str) + desc
         for (testname, test) in tests.items():
diff --git a/src/python/oftest/action_list.py b/src/python/oftest/action_list.py
index 628e067..fbbddea 100644
--- a/src/python/oftest/action_list.py
+++ b/src/python/oftest/action_list.py
@@ -54,8 +54,10 @@
 
     """
 
-    def __init__(self):
-        self.actions = []
+    def __init__(self, actions=None):
+        if actions == None:
+            actions = []
+        self.actions = actions
 
     def pack(self):
         """
@@ -112,14 +114,11 @@
 
         @param action The action to add
 
-        @return True if successful, False if not an action object
-
         """
-        if isinstance(action, action_class_list):
-            tmp = copy.deepcopy(action)
-            self.actions.append(tmp)
-            return True
-        return False
+        if not isinstance(action, action_class_list):
+            raise ValueError("%s is not an action" % type(action))
+        self.actions.append(copy.deepcopy(action))
+        return True # for backwards compatibility
 
     def remove_type(self, type):
         """
@@ -163,9 +162,8 @@
 
         """
         for act in other.actions:
-            if not self.add(act):
-                return False
-        return True
+            self.add(act)
+        return True # for backwards compatibility
         
     def __len__(self):
         length = 0
diff --git a/src/python/oftest/controller.py b/src/python/oftest/controller.py
index b60823a..fa346c3 100644
--- a/src/python/oftest/controller.py
+++ b/src/python/oftest/controller.py
@@ -258,8 +258,7 @@
                         rep = echo_reply()
                         rep.header.xid = hdr.xid
                         # Ignoring additional data
-                        if self.message_send(rep.pack(), zero_xid=True) < 0:
-                            self.logger.error("Error sending echo reply")
+                        self.message_send(rep.pack(), zero_xid=True)
                         continue
 
                 # Now check for message handlers; preference is given to
@@ -613,10 +612,7 @@
 
             self.xid = msg.header.xid
             self.xid_response = None
-            if self.message_send(msg.pack()) < 0:
-                self.logger.error("Error sending pkt for transaction %d" %
-                                  msg.header.xid)
-                return (None, None)
+            self.message_send(msg.pack())
 
             self.logger.debug("Waiting for transaction %d" % msg.header.xid)
             timed_wait(self.xid_cv, lambda: self.xid_response, timeout=timeout)
@@ -641,9 +637,6 @@
         the XID in the header is 0, then an XID will be generated
         for the message.  Set zero_xid to override this behavior (and keep an
         existing 0 xid)
-
-        @return 0 on success
-
         """
 
         if not self.switch_socket:
@@ -663,9 +656,9 @@
                           ofp_type_map.get(msg_type, "unknown (%d)" % msg_type),
                           msg_len)
         if self.switch_socket.sendall(outpkt) is not None:
-            raise Exception("unknown error on sendall")
+            raise AssertionError("failed to send message to switch")
 
-        return 0
+        return 0 # for backwards compatibility
 
     def __str__(self):
         string = "Controller:\n"
diff --git a/src/python/oftest/dataplane.py b/src/python/oftest/dataplane.py
index a5b4e26..78089e3 100644
--- a/src/python/oftest/dataplane.py
+++ b/src/python/oftest/dataplane.py
@@ -24,7 +24,6 @@
 from threading import Condition
 import select
 import logging
-from oft_assert import oft_assert
 from ofutils import *
 
 have_pypcap = False
diff --git a/src/python/oftest/oft_assert.py b/src/python/oftest/oft_assert.py
deleted file mode 100644
index d773c84..0000000
--- a/src/python/oftest/oft_assert.py
+++ /dev/null
@@ -1,28 +0,0 @@
-"""
-OpenFlow Test Framework
-
-Framework assert definition
-"""
-
-import sys
-import logging
-
-def oft_assert(condition, string):
-    """
-    Test framework assertion check
-
-    @param condition The boolean condition to check
-    @param string String to print if error
-
-    If condition is not true, it is considered a test framework
-    failure and exit is called.
-
-    This assert is meant to represent a violation in the 
-    assumptions of how the test framework is supposed to work
-    (for example, an inconsistent packet queue state) rather than
-    a test failure.
-    """
-    if not condition:
-        logging.critical("Internal error: " + string)
-        sys.exit(1)
-
diff --git a/src/python/oftest/testutils.py b/src/python/oftest/testutils.py
index fe53ecc..e8dec6e 100644
--- a/src/python/oftest/testutils.py
+++ b/src/python/oftest/testutils.py
@@ -43,7 +43,8 @@
     msg.out_port = ofp.OFPP_NONE
     msg.command = ofp.OFPFC_DELETE
     msg.buffer_id = 0xffffffff
-    return ctrl.message_send(msg)
+    ctrl.message_send(msg)
+    return 0 # for backwards compatibility
 
 def required_wildcards(parent):
     w = test_param_get('required_wildcards', default='default')
@@ -296,10 +297,10 @@
     """
     b = message.barrier_request()
     (resp, pkt) = ctrl.transact(b, timeout=timeout)
+    if resp is None:
+        raise AssertionError("barrier failed")
     # We'll trust the transaction processing in the controller that xid matched
-    if not resp:
-        return -1
-    return 0
+    return 0 # for backwards compatibility
 
 def port_config_get(controller, port_no):
     """
@@ -349,8 +350,8 @@
     mod.config = config
     mod.mask = mask
     mod.advertise = reply.ports[idx].advertised
-    rv = controller.message_send(mod)
-    return rv
+    controller.message_send(mod)
+    return 0
 
 def receive_pkt_check(dp, pkt, yes_ports, no_ports, assert_if):
     """
@@ -535,8 +536,7 @@
     if action_list is not None:
         for act in action_list:
             logging.debug("Adding action " + act.show())
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add action" + act.show())
+            request.actions.add(act)
 
     # Set up output/enqueue action if directed
     if egr_queue is not None:
@@ -545,16 +545,12 @@
         for egr_port in egr_port_list:
             act.port = egr_port
             act.queue_id = egr_queue
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add enqueue action " + 
-                              str(egr_port) + " Q: " + str(egr_queue))
+            request.actions.add(act)
     elif egr_ports is not None:
         for egr_port in egr_port_list:
             act = action.action_output()
             act.port = egr_port
-            rv = request.actions.add(act)
-            parent.assertTrue(rv, "Could not add output action " + 
-                              str(egr_port))
+            request.actions.add(act)
 
     logging.debug(request.show())
 
@@ -575,14 +571,12 @@
 
     if clear_table: 
         logging.debug("Clear flow table")
-        rc = delete_all_flows(parent.controller)
-        parent.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(parent.controller)
 
     logging.debug("Insert flow")
-    rv = parent.controller.message_send(request)
-    parent.assertTrue(rv != -1, "Error installing flow mod")
+    parent.controller.message_send(request)
 
-    parent.assertEqual(do_barrier(parent.controller), 0, "Barrier failed")
+    do_barrier(parent.controller)
 
 def flow_match_test_port_pair(parent, ing_port, egr_ports, wildcards=None,
                               dl_vlan=-1, pkt=None, exp_pkt=None,
@@ -637,18 +631,17 @@
     msg.data = str(pkt)
     if action_list is not None:
         for act in action_list:
-            assert(msg.actions.add(act))
+            msg.actions.add(act)
 
     # Set up output action
     if egr_ports is not None:
         for egr_port in egr_ports:
             act = action.action_output()
             act.port = egr_port
-            assert(msg.actions.add(act))
+            msg.actions.add(act)
 
     logging.debug(msg.show())
-    rv = parent.controller.message_send(msg)
-    parent.assertTrue(rv == 0, "Error sending out message")
+    parent.controller.message_send(msg)
 
     if exp_pkt is None:
         exp_pkt = pkt
diff --git a/tests/FuncUtils.py b/tests/FuncUtils.py
index 82f1a4f..6c55425 100644
--- a/tests/FuncUtils.py
+++ b/tests/FuncUtils.py
@@ -39,11 +39,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_exactflow,match)
 
@@ -67,11 +66,10 @@
 
     act = action.action_output()
     act.port = of_ports[2]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_exactflow,match)         
        
@@ -96,11 +94,10 @@
 
     act1 = action.action_output()
     act1.port = of_ports[1]
-    self.assertTrue(msg1.actions.add(act1), "could not add action")
+    msg1.actions.add(act1)
 
-    rv = self.controller.message_send(msg1)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg1)
+    do_barrier(self.controller)
 
     return (pkt_wildcardsrc,match1)
 
@@ -124,11 +121,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_MatchSrc,match)
       
@@ -151,11 +147,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_matchdst,match)
 
@@ -176,13 +171,12 @@
     msg2.match = match2
     act2 = action.action_output()
     act2.port = of_ports[1]
-    self.assertTrue(msg2.actions.add(act2), "could not add action")
+    msg2.actions.add(act2)
     if priority != None :
         msg2.priority = priority
 
-    rv = self.controller.message_send(msg2)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg2)
+    do_barrier(self.controller)
 
     return (pkt_wildcard,match2)
 
@@ -209,14 +203,13 @@
        
     act3 = action.action_output()
     act3.port = of_ports[1]
-    self.assertTrue(msg3.actions.add(act3), "could not add action")
+    msg3.actions.add(act3)
 
     if priority != None :
         msg3.priority = priority
 
-    rv = self.controller.message_send(msg3)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg3)
+    do_barrier(self.controller)
 
     return (pkt_matchingress,match3)
 
@@ -243,13 +236,12 @@
        
     act3 = action.action_output()
     act3.port = of_ports[2]
-    self.assertTrue(msg3.actions.add(act3), "could not add action")
+    msg3.actions.add(act3)
     if priority != None :
         msg3.priority = priority
 
-    rv = self.controller.message_send(msg3)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg3)
+    do_barrier(self.controller)
 
     return (pkt_matchingress,match3)
 
@@ -273,11 +265,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_matchvlanid,match)
 
@@ -300,11 +291,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_matchvlanpcp,match)
 
@@ -328,11 +318,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_mulL2,match)
 
@@ -355,11 +344,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_mulL4,match)  
 
@@ -381,11 +369,10 @@
         msg.priority = priority
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_iptos,match)
 
@@ -407,11 +394,10 @@
         msg.priority = priority
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_iptos,match)
 
@@ -435,11 +421,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_matchtSrc,match)  
 
@@ -461,11 +446,10 @@
         msg.priority = priority
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
 
     return (pkt_matchdst,match)        
 
@@ -489,11 +473,10 @@
 
     act = action.action_output()
     act.port = of_ports[1]
-    self.assertTrue(msg.actions.add(act), "could not add action")
+    msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg)
+    do_barrier(self.controller)
     return (pkt_matchtype,match)
 
    
@@ -510,15 +493,14 @@
     msg5.buffer_id = 0xffffffff
     act5 = action.action_output()
     act5.port = egress_port
-    self.assertTrue(msg5.actions.add(act5), "could not add action")
+    msg5.actions.add(act5)
 
     if priority != None :
         msg5.priority = priority
 
     # Send the flow with action A'
-    rv = self.controller.message_send (msg5)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send (msg5)
+    do_barrier(self.controller)
 
 def modify_flow_action(self,of_ports,match,priority=None):
 # Modify the flow action
@@ -533,15 +515,14 @@
     msg8.buffer_id = 0xffffffff
     act8 = action.action_output()
     act8.port = of_ports[2]
-    self.assertTrue(msg8.actions.add(act8), "could not add action")
+    msg8.actions.add(act8)
 
     if priority != None :
         msg8.priority = priority
 
     # Send the flow with action A'
-    rv = self.controller.message_send (msg8)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send (msg8)
+    do_barrier(self.controller)
 
 def enqueue(self,ingress_port,egress_port,egress_queue_id):
 #Generate a flow with enqueue action i.e output to a queue configured on a egress_port
@@ -559,12 +540,11 @@
     act = action.action_enqueue()
     act.port     = egress_port
     act.queue_id = egress_queue_id
-    self.assertTrue(request.actions.add(act), "Could not add action")
+    request.actions.add(act)
     
     logging.info("Inserting flow")
-    rv = self.controller.message_send(request)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(request)
+    do_barrier(self.controller)
     return (pkt,match)
 
 
@@ -670,28 +650,27 @@
         active = 0
         
         for item in response.stats:
-
             lookedup += item.lookup_count
             matched += item.matched_count
             active += item.active_count
 
-            logging.info("Packets Looked up " + str(lookedup) + " packets")
-            logging.info("Packets matched " + str(matched) + "packets")
-            logging.info("Active flow entries" + str(active) + "flows")
+        logging.info("Packets Looked up: %d", lookedup)
+        logging.info("Packets matched: %d", matched)
+        logging.info("Active flow entries: %d", active)
 
-        if (expect_lookup == None or expect_lookup == lookedup) and \
-           (expect_match == None or expect_match == matched) and \
-           (expect_active == None or expect_active == active):
+        if (expect_lookup == None or lookedup >= expect_lookup) and \
+           (expect_match == None or matched >= expect_match) and \
+           (expect_active == None or active >= expect_active):
             break
 
         sleep(0.1)
 
     if expect_lookup != None :
-        self.assertEqual(expect_lookup,item.lookup_count,"lookup counter is not incremented properly")
+        self.assertEqual(expect_lookup, lookedup, "lookup counter is not incremented properly")
     if expect_match != None :
-        self.assertEqual(expect_match,item.matched_count, "matched counter is not incremented properly")
+        self.assertEqual(expect_match, matched, "matched counter is not incremented properly")
     if expect_active != None :
-        self.assertEqual(expect_active,item.active_count,"active counter is not incremented properly")
+        self.assertEqual(expect_active, active ,"active counter is not incremented properly")
 
 
 def verify_flowstats(self,match,byte_count=None,packet_count=None):
@@ -716,21 +695,20 @@
             packet_counter += item.packet_count
             byte_counter += item.byte_count
 
-            logging.info("Recieved" + str(item.packet_count) + " packets")
-           
-            logging.info("Received " + str(item.byte_count) + "bytes")
+        logging.info("Received %d packets", packet_counter)
+        logging.info("Received %d bytes", byte_counter)
 
-        if (packet_count == None or packet_count == packet_counter) and \
-           (byte_count == None or byte_count == byte_counter):
+        if (packet_count == None or packet_counter >= packet_count) and \
+           (byte_count == None or byte_counter >= byte_count):
             break
 
         sleep(0.1)
     
     if packet_count != None :
-        self.assertEqual(packet_count,item.packet_count,"packet_count counter is not incremented correctly")
+        self.assertEqual(packet_count, packet_counter, "packet_count counter is not incremented correctly")
 
     if byte_count != None :   
-        self.assertEqual(byte_count,item.byte_count,"byte_count counter is not incremented correctly")
+        self.assertEqual(byte_count, byte_counter, "byte_count counter is not incremented correctly")
 
 
 def verify_portstats(self, port,tx_packets=None,rx_packets=None,rx_byte=None,tx_byte=None):
@@ -834,9 +812,8 @@
 
     if priority != None :
         msg4.priority = priority
-    rv = self.controller.message_send(msg4)
-    self.assertTrue(rv!= -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+    self.controller.message_send(msg4)
+    do_barrier(self.controller)
 
 
 
@@ -853,9 +830,8 @@
     if priority != None :
         msg6.priority = priority
 
-    rv = self.controller.message_send(msg6)
-    self.assertTrue(rv != -1, "Error installing flow mod")
-    self.assertEqual(do_barrier(self.controller),0, "Barrier failed")
+    self.controller.message_send(msg6)
+    do_barrier(self.controller)
 
 
 ###########################################################################################################################################################
diff --git a/tests/actions.py b/tests/actions.py
index 330068c..8be69dc 100644
--- a/tests/actions.py
+++ b/tests/actions.py
@@ -38,8 +38,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Install a flow without action")
         logging.info("Send packets matching that flow")
@@ -57,9 +56,8 @@
         msg.command = ofp.OFPFC_ADD
         msg.buffer_id = 0xffffffff
         msg.match = match
-        rv = self.controller.message_send(msg)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(msg)
+        do_barrier(self.controller)
 
         #Sending N packets matching the flow inserted
         for pkt_cnt in range(5):
@@ -137,8 +135,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow with output action port OFPP_ALL")
         logging.info("Send packet matching the flow")
@@ -150,8 +147,7 @@
         act = action.action_output()
 
         #Delete all flows 
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         ingress_port=of_ports[0]
         match.in_port = ingress_port
 
@@ -163,9 +159,8 @@
         request.actions.add(act)
         
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         #Send Packet matching the flow
         logging.info("Sending packet to dp port " + str(ingress_port))
@@ -191,8 +186,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow with output action port OFPP_CONTROLLER")
         logging.info("Send packet matching the flow")
@@ -205,8 +199,7 @@
 
         for ingress_port in of_ports:
             #Delete all flows 
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             match.in_port = ingress_port
             
@@ -217,9 +210,8 @@
             request.actions.add(act)
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
             
             #Send packet matching the flow
             logging.info("Sending packet to dp port " + str(ingress_port))
@@ -246,8 +238,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow with output action port OFPP_LOCAL")
         logging.info("Send packet matching the flow")
@@ -260,8 +251,7 @@
 
         for ingress_port in of_ports:
             #Delete the flows
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             match.in_port = ingress_port
             #Create flow mod message
@@ -271,9 +261,8 @@
             request.actions.add(act)
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             #Send packet matching the flow
             logging.info("Sending packet to dp port " + str(ingress_port))
@@ -297,8 +286,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow with output action port OFPP_FORWARD")
         logging.info("Send packet matching the flow")
@@ -310,8 +298,7 @@
         act = action.action_output()
 
         #Delete all flows 
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         ingress_port=of_ports[0]
         match.in_port = ingress_port
 
@@ -323,9 +310,8 @@
         request.actions.add(act)
         
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         #Send Packet matching the flow
         logging.info("Sending packet to dp port " + str(ingress_port))
@@ -350,8 +336,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow with output action port OFPP_INPORT")
         logging.info("Send packet matching the flow")
@@ -363,8 +348,7 @@
         act = action.action_output()
 
         #Delete the flows
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         ingress_port=of_ports[0]
         match.in_port = ingress_port
 
@@ -375,9 +359,8 @@
             
         request.actions.add(act)
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         #Send packet matching the flow
         logging.info("Sending packet to dp port " + str(ingress_port))
@@ -403,8 +386,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Insert a flow F with output action port set to some egress_port")
         logging.info("Send packet out message (matching flow F) with action.port = OFP.TABLE")
@@ -420,8 +402,7 @@
         act = action.action_output()
         act.port = ofp.OFPP_TABLE
         pkt_out.actions.add(act)
-        rv = self.controller.message_send(pkt_out)
-        self.assertTrue(rv == 0, "Error sending out message")
+        self.controller.message_send(pkt_out)
 
         #Verifying packet out message recieved on the expected dataplane port. 
         (of_port, pkt, pkt_time) = self.dataplane.poll(port_number=of_ports[1],
@@ -442,8 +423,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- set vlan id, if not skip the test")
         logging.info("Insert a flow with set vid action")
@@ -482,8 +462,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify vlan id, if not skip the test")
         logging.info("Insert a flow with action --set vid ")
@@ -520,8 +499,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- set vlan priority, if not skip the test")
         logging.info("Insert a flow with action -- set vlan priority ")
@@ -559,8 +537,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- set vlan priority, if not skip the test")
         logging.info("Insert a flow with action -- set vlan priority ")
@@ -599,8 +576,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l2_src, if not skip the test")
         logging.info("Insert a flow with action -- set etherent src address")
@@ -634,8 +610,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l2_dst, if not skip the test")
         logging.info("Insert a flow with action -- set etherent dst address ")
@@ -668,8 +643,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l3_src, if not skip the test")
         logging.info("Insert a flow with action -- set network src address ")
@@ -702,8 +676,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l3_dst, if not skip the test")
         logging.info("Insert a flow with action -- set network dst address ")
@@ -737,8 +710,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l4_src, if not skip the test")
         logging.info("Insert a flow with action -- set src tcp port")
@@ -771,8 +743,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_l4_dst, if not skip the test")
         logging.info("Insert a flow with action -- set dst tcp port")
@@ -805,8 +776,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Verify if switch supports the action -- modify_tos, if not skip the test")
         logging.info("Insert a flow with action -- set type of service ")
diff --git a/tests/basic.py b/tests/basic.py
index d78f2ff..16f3b31 100644
--- a/tests/basic.py
+++ b/tests/basic.py
@@ -54,8 +54,7 @@
     Test echo response with short string data
     """
     def runTest(self):
-        request = message.echo_request()
-        request.data = 'OpenFlow Will Rule The World'
+        request = message.echo_request(data='OpenFlow Will Rule The World')
         response, pkt = self.controller.transact(request)
         self.assertTrue(response is not None,
                         "Did not get echo reply (with data)")
@@ -79,9 +78,8 @@
         # Send packet to dataplane, once to each port
         # Poll controller with expect message type packet in
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
 
         vid = test_param_get('vid', default=TEST_VID_DEFAULT)
 
@@ -129,9 +127,8 @@
     """
 
     def runTest(self):
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
 
         for of_port in config["port_map"].keys():
             pkt = simple_tcp_packet()
@@ -167,9 +164,8 @@
         # Need at least two ports
         self.assertTrue(len(config["port_map"]) > 1, "Too few ports for test")
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
 
         of_ports = config["port_map"].keys()
         d_port = of_ports[0]
@@ -195,8 +191,7 @@
         # Send packet to dataplane
         # Poll controller with expect message type packet in
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # These will get put into function
         of_ports = config["port_map"].keys()
@@ -208,16 +203,12 @@
                (simple_eth_packet(pktlen=40), "tiny Ethernet packet")]:
 
                logging.info("PKT OUT test with %s, port %s" % (opt, dp_port))
-               msg = message.packet_out()
-               msg.in_port = ofp.OFPP_NONE
-               msg.data = str(outpkt)
-               act = action.action_output()
-               act.port = dp_port
-               self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
+               msg = message.packet_out(in_port=ofp.OFPP_NONE,
+                                        data=str(outpkt),
+                                        actions=[action.output(port=dp_port)])
 
                logging.info("PacketOut to: " + str(dp_port))
-               rv = self.controller.message_send(msg)
-               self.assertTrue(rv == 0, "Error sending out message")
+               self.controller.message_send(msg)
 
                exp_pkt_arg = None
                exp_port = None
@@ -250,8 +241,7 @@
         # Send packet to dataplane
         # Poll controller with expect message type packet in
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # These will get put into function
         of_ports = config["port_map"].keys()
@@ -265,18 +255,13 @@
                dp_ports = of_ports[0:num_ports]
                logging.info("PKT OUT test with " + opt +
                                  ", ports " + str(dp_ports))
-               msg = message.packet_out()
-               msg.in_port = ofp.OFPP_NONE
-               msg.data = str(outpkt)
-               act = action.action_output()
-               for i in range(0,num_ports):
-                  act.port = dp_ports[i]
-                  self.assertTrue(msg.actions.add(act),
-                                  'Could not add action to msg')
+               actions = [action.output(port=port) for port in dp_ports]
+               msg = message.packet_out(in_port=ofp.OFPP_NONE,
+                                        data=str(outpkt),
+                                        actions=actions)
 
                logging.info("PacketOut to: " + str(dp_ports))
-               rv = self.controller.message_send(msg)
-               self.assertTrue(rv == 0, "Error sending out message")
+               self.controller.message_send(msg)
 
                receive_pkt_check(self.dataplane, outpkt, dp_ports,
                                  set(of_ports).difference(dp_ports),
@@ -294,13 +279,11 @@
         logging.info("Running StatsGet")
         logging.info("Inserting trial flow")
         request = flow_mod_gen(config["port_map"], True)
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Failed to insert test flow")
+        self.controller.message_send(request)
         
         logging.info("Sending flow request")
-        request = message.flow_stats_request()
-        request.out_port = ofp.OFPP_NONE
-        request.table_id = 0xff
+        request = message.flow_stats_request(out_port=ofp.OFPP_NONE,
+                                             table_id=0xff)
         request.match.wildcards = 0 # ofp.OFPFW_ALL
         response, pkt = self.controller.transact(request)
         self.assertTrue(response is not None,
@@ -317,8 +300,7 @@
         logging.info("Running TableStatsGet")
         logging.info("Inserting trial flow")
         request = flow_mod_gen(config["port_map"], True)
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Failed to insert test flow")
+        self.controller.message_send(request)
         
         logging.info("Sending table stats request")
         request = message.table_stats_request()
@@ -353,8 +335,7 @@
     def runTest(self):
         logging.info("Running " + str(self))
         request = flow_mod_gen(config["port_map"], True)
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(request)
 
 @group('smoke')
 class PortConfigMod(base_tests.SimpleProtocol):
@@ -381,7 +362,7 @@
         rv = port_config_set(self.controller, of_port,
                              port_config ^ ofp.OFPPC_NO_FLOOD, ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         # Verify change took place with same feature request
         (hw_addr, port_config2, advert) = \
@@ -396,7 +377,7 @@
         rv = port_config_set(self.controller, of_port, port_config,
                              ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
 class PortConfigModErr(base_tests.SimpleProtocol):
     """
diff --git a/tests/bsn_ipmask.py b/tests/bsn_ipmask.py
index ccd97fb..fea7caa 100644
--- a/tests/bsn_ipmask.py
+++ b/tests/bsn_ipmask.py
@@ -51,8 +51,7 @@
         m = message.vendor()
         m.vendor = 0x005c16c7
         m.data = struct.pack("!LBBBBL", 0, index, 0, 0, 0, mask)
-        rc = self.controller.message_send(m)
-        self.assertNotEqual(rc, -1, "Error sending set IP mask command")
+        self.controller.message_send(m)
 
     def bsn_get_ip_mask(self, index):
         """
@@ -62,8 +61,7 @@
         m = message.vendor()
         m.vendor = 0x005c16c7
         m.data = struct.pack( "!LBBBBL", 1, index, 0, 0, 0, 0 )
-        rc = self.controller.message_send(m)
-        self.assertNotEqual(rc, -1, "Error sending get IP mask command")
+        self.controller.message_send(m)
         m, r = self.controller.poll(ofp.OFPT_VENDOR)
         self.assertEqual(m.vendor, 0x005c16c7, "Wrong vendor ID")
         x = struct.unpack("!LBBBBL", m.data)
@@ -145,19 +143,16 @@
            pkt3 = simple_tcp_packet(ip_dst=ip3)
            msg = lambda ip: logging.info("Testing dest IP %s" % ip)
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
-        rc = self.controller.message_send(flow_msg_create(
+        self.controller.message_send(flow_msg_create(
               self, pkt0, ing_port=ports[0], egr_ports=[ports[1]],
               wildcards=wildcards))
-        self.assertNotEqual(rc, -1, "Error inserting flow entry 0")
-        rc = self.controller.message_send(flow_msg_create(
+        self.controller.message_send(flow_msg_create(
               self, pkt1, ing_port=ports[0], egr_ports=[ports[2]],
               wildcards=wildcards))
-        self.assertNotEqual(rc, -1, "Error inserting flow entry 1")
 
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
             
         msg(ip0)
         self.dataplane.send(ports[0], str(pkt0))
diff --git a/tests/bsn_mirror.py b/tests/bsn_mirror.py
index c916382..10c3f93 100644
--- a/tests/bsn_mirror.py
+++ b/tests/bsn_mirror.py
@@ -90,8 +90,7 @@
         m = message.vendor()
         m.vendor = 0x005c16c7
         m.data = struct.pack("!LBBBB", 3, enabled, 0, 0, 0)
-        rc = self.controller.message_send(m)
-        self.assertNotEqual(rc, -1, "Error sending set mirroring command")
+        self.controller.message_send(m)
 
     def bsn_get_mirroring(self):
         """
@@ -101,8 +100,7 @@
         m = message.vendor()
         m.vendor = 0x005c16c7
         m.data = struct.pack("!LBBBB", 4, 0, 0, 0, 0)
-        rc = self.controller.message_send(m)
-        self.assertNotEqual(rc, -1, "Error sending get mirroring command")
+        self.controller.message_send(m)
         m, r = self.controller.poll(ofp.OFPT_VENDOR, 2)
         self.assertEqual(m.vendor, 0x005c16c7, "Wrong vendor ID")
         x = struct.unpack("!LBBBB", m.data)
@@ -148,14 +146,12 @@
         act3.port = ports[1]
         flow_mod = message.flow_mod()
         flow_mod.match = match
-        self.assertTrue(flow_mod.actions.add(act1), "Could not add mirror action")
-        self.assertTrue(flow_mod.actions.add(act2), "Could not add mirror action")
-        self.assertTrue(flow_mod.actions.add(act3), "Could not add output action")
-        self.assertEqual(delete_all_flows(self.controller), 0,
-                         "Failed to delete all flows")
-        self.assertNotEqual(self.controller.message_send(flow_mod), -1,
-                            "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        flow_mod.actions.add(act1)
+        flow_mod.actions.add(act2)
+        flow_mod.actions.add(act3)
+        delete_all_flows(self.controller)
+        self.controller.message_send(flow_mod)
+        do_barrier(self.controller)
         
         logging.info("Sending packet to port %s" % ports[0])
         self.dataplane.send(ports[0], str(pkt))
diff --git a/tests/caps.py b/tests/caps.py
index b01fd48..c75bd56 100644
--- a/tests/caps.py
+++ b/tests/caps.py
@@ -29,8 +29,7 @@
     of_ports = config["port_map"].keys()
     of_ports.sort()
 
-    rv = delete_all_flows(obj.controller)
-    obj.assertEqual(rv, 0, "Failed to delete all flows")
+    delete_all_flows(obj.controller)
 
     pkt = simple_tcp_packet()
     match = packet_to_flow_match(obj, pkt)
@@ -58,9 +57,8 @@
 
     # Make sure we can install at least one flow
     logging.info("Inserting initial flow")
-    rv = obj.controller.message_send(request)
-    obj.assertTrue(rv != -1, "Error installing flow mod")
-    obj.assertEqual(do_barrier(obj.controller, timeout=10), 0, "Barrier failed")
+    obj.controller.message_send(request)
+    do_barrier(obj.controller, timeout=10)
     flow_count = 1
 
     logging.info("Table idx: " + str(table_idx))
@@ -68,10 +66,10 @@
 
     while True:
         request.match.nw_src += 1
-        rv = obj.controller.message_send(request)
+        obj.controller.message_send(request)
         flow_count += 1
         if flow_count % count_check == 0:
-            obj.assertEqual(do_barrier(obj.controller, timeout=10), 0, "Barrier failed")
+            do_barrier(obj.controller, timeout=10)
             response, pkt = obj.controller.transact(tstats)
             obj.assertTrue(response is not None, "Get tab stats failed")
             logging.info(response.show())
@@ -88,7 +86,7 @@
     logging.error("RESULT: " + str(active_flows) + " flows reported")
 
     # clean up and wait a bit in case the table is really big
-    rv = delete_all_flows(obj.controller)
+    delete_all_flows(obj.controller)
     time.sleep(flow_count / 100)
 
 
diff --git a/tests/counters.py b/tests/counters.py
index 46566cc..4caae4f 100644
--- a/tests/counters.py
+++ b/tests/counters.py
@@ -47,8 +47,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow")
         logging.info("Sending N Packets matching the flow")
@@ -80,8 +79,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow")
         logging.info("Sending N Packets matching the flow")
@@ -114,8 +112,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow")
         logging.info("Send Flow_stats request after n sec intervals")
@@ -157,8 +154,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         # Clear Switch State
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert a flow with match on ingress_port")
         logging.info("Send N Packets on an ingress_port P ")
@@ -193,8 +189,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow matching on in_port=ingress_port, action output to egress_port T ")
         logging.info("Send N Packets matching the flow on ingress_port P ")
@@ -231,8 +226,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow matching on in_port=ingress_port")
         logging.info("Send N Packets matching the flow on ingress_port P ")
@@ -269,8 +263,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port T")
         logging.info("Send N Packets matching the flow on ingress_port P ")
@@ -306,8 +299,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear Switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port T ")
         logging.info("Send Table_Stats, verify active_count counter is incremented in accordance")
@@ -333,8 +325,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear Switch state
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Insert any flow matching on in_port=ingress_port,action = output to egress_port")
         logging.info("Send N packets matching the flow, N' packets not matching the flow")
@@ -385,8 +376,7 @@
             for egress_queue_id in queue_id:
 
                 #Clear switch state
-                rv = delete_all_flows(self.controller)
-                self.assertEqual(rv, 0, "Failed to delete all flows")
+                delete_all_flows(self.controller)
 
                 # Get Queue stats for selected egress queue only
                 (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id)
@@ -425,8 +415,7 @@
             for egress_queue_id in queue_id:
 
                 #Clear switch state
-                rv = delete_all_flows(self.controller)
-                self.assertEqual(rv, 0, "Failed to delete all flows")
+                delete_all_flows(self.controller)
 
                 # Get Queue stats for selected egress queue only
                 (qs_before,p) = get_queuestats(self,egress_port,egress_queue_id)
@@ -455,8 +444,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has rx_dropped count ")
@@ -482,8 +470,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has tx_dropped count ")
@@ -510,8 +497,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has rx_errors count ")
@@ -536,8 +522,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has Tx_errors count ")
@@ -562,8 +547,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has rx_frame_err count ")
@@ -589,8 +573,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has rx_over_err count ")
@@ -617,8 +600,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has rx_crc_err count ")
@@ -644,8 +626,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Port_Stats Request")
         logging.info("Verify reply has Collisions count ")
@@ -672,8 +653,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
          
         #Clear switch State        
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Send Queue_Stats Request")
         logging.info("Verify reply has Tramitted Overrun errors count ")
diff --git a/tests/detailed_contr_sw_messages.py b/tests/detailed_contr_sw_messages.py
index da1b046..601cc72 100644
--- a/tests/detailed_contr_sw_messages.py
+++ b/tests/detailed_contr_sw_messages.py
@@ -36,8 +36,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting two overlapping flows")
         logging.info("Expecting switch to return an error")
@@ -64,10 +63,9 @@
        
         act3 = action.action_output()
         act3.port = of_ports[1]
-        self.assertTrue(msg3.actions.add(act3), "could not add action")
-        rv = self.controller.message_send(msg3)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        msg3.actions.add(act3)
+        self.controller.message_send(msg3)
+        do_barrier(self.controller)
 
         # Verify Flow does not get inserted 
         verify_tablestats(self,expect_active=1)
@@ -96,8 +94,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting two overlapping flows")
         logging.info("Expecting switch to insert the flows without generating errors")
@@ -128,8 +125,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting two identical flows one by one")
         logging.info("Expecting switch to overwrite the first flow and clear the counters associated with it ")
@@ -169,8 +165,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting an emergency flow with timeout values")
         logging.info("Expecting switch to generate error ")
@@ -192,10 +187,9 @@
         
         request.actions.add(act)
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Flow addition did not fail.")
+        self.controller.message_send(request)
 
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         #Verify OFPET_FLOW_MOD_FAILED/OFPFMFC_OVERLAP error is recieved on the control plane
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_ERROR,         
@@ -224,8 +218,7 @@
         logging.info("Expecting flow to get added i.e OFPFC_MODIFY command should be taken as OFPFC_ADD ")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         #Generate a flow-mod,command OFPC_MODIFY 
 
@@ -237,12 +230,11 @@
         request.buffer_id = 0xffffffff
         act3 = action.action_output()
         act3.port = of_ports[1]
-        self.assertTrue(request.actions.add(act3), "could not add action")
+        request.actions.add(act3)
 
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed") 
+        self.controller.message_send(request)
+        do_barrier(self.controller) 
 
         #Verify the flow gets added i.e. active_count= 1
         verify_tablestats(self,expect_active=1)
@@ -261,8 +253,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a Flow and incrementing flow counters. Modifying the flow action")
         logging.info("Expecting the flow action to be modified , but the flow-counters should be preserved")
@@ -299,8 +290,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting Flows and incrementing flow counters. Strict Modify the flow action ")
         logging.info("Expecting the flow action to be modified , but the flow-counters should be preserved")
@@ -343,8 +333,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Deleting a non-existing flow")
         logging.info("Expecting switch to ignore the command , without generating errors")
@@ -379,8 +368,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear swicth state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting flows F1 and F2 without and with send_flow_removed_message flag set ")
         logging.info("Deleting the flows")
@@ -411,11 +399,10 @@
         msg9.flags |= ofp.OFPFF_SEND_FLOW_REM
         rv1 = self.controller.message_send(msg9)
         self.assertTrue(rv1 != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         # Delete the flow-2
-        rc2 = delete_all_flows(self.controller)
-        self.assertEqual(rc2, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Verify flow removed message is generated for the FLOW-2
 
@@ -438,8 +425,7 @@
         of_ports.sort()
         
         #Clear switch state        
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a emergency flow with send_flow_removed flag set")
         logging.info("Expecting no flow_removed_message on the deletion of the emergency flow")
@@ -456,8 +442,7 @@
         act.port = of_ports[1]
         request.actions.add(act)
 
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Flow addition failed.")
+        self.controller.message_send(request)
         
         # Delete the emergency flow
         
@@ -482,8 +467,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Inserting a flow with exact match")
         logging.info("Issue Strict Delete command , verify it gets deleted")     
@@ -569,8 +553,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a flow with output action --> of_port[1]")
         logging.info("Deleting the flow but with out_port set to of_port[2]")
@@ -589,9 +572,8 @@
         msg7.buffer_id = 0xffffffff
         msg7.match = match
 
-        rv = self.controller.message_send(msg7)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(msg7)
+        do_barrier(self.controller)
 
         # Verify flow will not get deleted, active_entries in table_stats_request = 1
         verify_tablestats(self,expect_active=1)
@@ -606,9 +588,8 @@
         msg7.buffer_id = 0xffffffff
         msg7.match = match
 
-        rv = self.controller.message_send(msg7)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(msg7)
+        do_barrier(self.controller)
         
         #Verify flow gets deleted.
         verify_tablestats(self,expect_active=0)
@@ -627,8 +608,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting flow entry with idle_timeout set. Also send_flow_removed_message flag set")
         logging.info("Expecting the flow entry to delete with given idle_timeout")
@@ -642,7 +622,7 @@
         msg9.flags |= ofp.OFPFF_SEND_FLOW_REM
         rv1 = self.controller.message_send(msg9)
         self.assertTrue(rv1 != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         #Verify flow gets inserted
         verify_tablestats(self,expect_active=1)
@@ -671,8 +651,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Adding and modifying flow with out_port fields set")
         logging.info("Expecting switch to ignore out_port")
@@ -711,8 +690,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting flow entry with hard_timeout set. Also send_flow_removed_message flag set")
         logging.info("Expecting the flow entry to delete with given hard_timeout")
@@ -726,7 +704,7 @@
         msg9.flags |= ofp.OFPFF_SEND_FLOW_REM
         rv1 = self.controller.message_send(msg9)
         self.assertTrue(rv1 != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         #Verify flow gets inserted
         verify_tablestats(self,expect_active=1)
@@ -758,8 +736,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting flow entry with hard_timeout set and send_flow_removed_message flag not set")
         logging.info("Expecting the flow entry to delete, but no flow removed message")
@@ -780,11 +757,10 @@
         msg3.match = match3
         act3 = action.action_output()
         act3.port = of_ports[1]
-        self.assertTrue(msg3.actions.add(act3), "could not add action")
+        msg3.actions.add(act3)
 
-        rv = self.controller.message_send(msg3)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(msg3)
+        do_barrier(self.controller)
 
         #Verify no flow removed message is generated
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FLOW_REMOVED,
diff --git a/tests/flow_expire.py b/tests/flow_expire.py
index ad35f23..484f22f 100644
--- a/tests/flow_expire.py
+++ b/tests/flow_expire.py
@@ -37,8 +37,7 @@
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         pkt = simple_tcp_packet()
         match = packet_to_flow_match(self, pkt)
@@ -65,12 +64,11 @@
         request.idle_timeout = 1
         request.flags |= ofp.OFPFF_SEND_FLOW_REM
         act.port = egress_port
-        self.assertTrue(request.actions.add(act), "Could not add action")
+        request.actions.add(act)
         
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FLOW_REMOVED,
                                                timeout=test_timeout)
diff --git a/tests/flow_matches.py b/tests/flow_matches.py
index e90ddd0..862633d 100644
--- a/tests/flow_matches.py
+++ b/tests/flow_matches.py
@@ -38,8 +38,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting an all wildcarded flow and sending packets with various match fields")
         logging.info("Expecting all sent packets to match")
@@ -95,8 +94,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -135,8 +133,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
         
         #Clear Switch State
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -177,8 +174,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -219,8 +215,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -257,8 +252,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -298,8 +292,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -339,8 +332,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -393,8 +385,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -432,8 +423,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -472,8 +462,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -511,8 +500,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -551,8 +539,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -591,8 +578,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
@@ -638,8 +624,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[2]
         no_ports=set(of_ports).difference([egress_port])
@@ -674,8 +659,7 @@
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
     
         #Clear Switch State
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         egress_port=of_ports[1]
         no_ports=set(of_ports).difference([egress_port])
diff --git a/tests/flow_query.py b/tests/flow_query.py
index 2ff8083..476cd75 100644
--- a/tests/flow_query.py
+++ b/tests/flow_query.py
@@ -1330,8 +1330,7 @@
         request.match    = query_match
         request.table_id = 0xff
         request.out_port = ofp.OFPP_NONE;
-        if self.controller.message_send(request) == -1:
-            return False
+        self.controller.message_send(request)
         # <TBD>
         # Glue together successive reponse messages for stats reply.
         # Looking at the "more" flag and performing re-assembly
@@ -1367,7 +1366,8 @@
         logging.info("Sending flow_mod(add), xid=%d"
                         % (flow_mod_msg.header.xid)
                         )
-        return (self.controller.message_send(flow_mod_msg) != -1)
+        self.controller.message_send(flow_mod_msg)
+        return True
 
     def flow_mod(self, flow_cfg, strictf):
         flow_mod_msg = message.flow_mod()
@@ -1379,7 +1379,8 @@
         logging.info("Sending flow_mod(mod), xid=%d"
                         % (flow_mod_msg.header.xid)
                         )
-        return (self.controller.message_send(flow_mod_msg) != -1)
+        self.controller.message_send(flow_mod_msg)
+        return True
 
     def flow_del(self, flow_cfg, strictf):
         flow_mod_msg = message.flow_mod()
@@ -1393,7 +1394,8 @@
         logging.info("Sending flow_mod(del), xid=%d"
                         % (flow_mod_msg.header.xid)
                         )
-        return (self.controller.message_send(flow_mod_msg) != -1)
+        self.controller.message_send(flow_mod_msg)
+        return True
 
     def barrier(self):
         barrier = message.barrier_request()
@@ -1580,8 +1582,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -1682,8 +1683,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -1797,8 +1797,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -1929,8 +1928,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2051,8 +2049,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2178,8 +2175,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2305,8 +2301,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2456,8 +2451,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2549,8 +2543,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2665,8 +2658,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2789,8 +2781,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
@@ -2946,8 +2937,7 @@
         # Clear all flows from switch
 
         logging.info("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Get switch capabilites
 
diff --git a/tests/flow_stats.py b/tests/flow_stats.py
index 040fec8..8f59ccc 100644
--- a/tests/flow_stats.py
+++ b/tests/flow_stats.py
@@ -119,8 +119,7 @@
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # build packet
         pkt = simple_tcp_packet()
@@ -144,13 +143,12 @@
         flow_mod_msg.hard_timeout = 65000
         flow_mod_msg.priority = 100
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
        
         # send flow
         logging.info("Inserting flow")
-        rv = self.controller.message_send(flow_mod_msg)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg)
+        do_barrier(self.controller)
 
         # no packets sent, so zero packet count
         self.verifyStats(flow_mod_msg, match, ofp.OFPP_NONE, test_timeout, 0)
@@ -197,7 +195,7 @@
         flow_mod_msg.hard_timeout = 0
         act = action.action_output()
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
 
         logging.info("Ingress " + str(ingress_port) + 
                        " to egress " + str(egress_port))
@@ -260,8 +258,7 @@
         egress_port1 = of_ports[1];
         egress_port2 = of_ports[2];
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         pkt1 = simple_tcp_packet()
         flow_mod_msg1 = self.buildFlowModMsg(pkt1, ingress_port, egress_port1)
@@ -270,12 +267,10 @@
         flow_mod_msg2 = self.buildFlowModMsg(pkt2, ingress_port, egress_port2)
        
         logging.info("Inserting flow1")
-        rv = self.controller.message_send(flow_mod_msg1)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(flow_mod_msg1)
         logging.info("Inserting flow2")
-        rv = self.controller.message_send(flow_mod_msg2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg2)
+        do_barrier(self.controller)
 
         num_pkt1s = random.randint(10,30)
         logging.info("Sending " + str(num_pkt1s) + " pkt1s")
@@ -325,7 +320,7 @@
         flow_mod_msg.hard_timeout = 0
         act = action.action_output()
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
 
         logging.info("Ingress " + str(ingress_port) + 
                        " to egress " + str(egress_port))
@@ -374,8 +369,7 @@
         egress_port1 = of_ports[1];
         egress_port2 = of_ports[2];
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         pkt1 = simple_tcp_packet()
         flow_mod_msg1 = self.buildFlowModMsg(pkt1, ingress_port, egress_port1)
@@ -384,12 +378,10 @@
         flow_mod_msg2 = self.buildFlowModMsg(pkt2, ingress_port, egress_port2)
        
         logging.info("Inserting flow1")
-        rv = self.controller.message_send(flow_mod_msg1)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(flow_mod_msg1)
         logging.info("Inserting flow2")
-        rv = self.controller.message_send(flow_mod_msg2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg2)
+        do_barrier(self.controller)
 
         num_pkt1s = random.randint(10,30)
         logging.info("Sending " + str(num_pkt1s) + " pkt1s")
@@ -420,8 +412,7 @@
     the query doesn't match any flows.
     """
     def runTest(self):
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         match = ofp.ofp_match()
         match.wildcards = 0
         stat_req = message.flow_stats_request()
@@ -441,8 +432,7 @@
     the query doesn't match any flows.
     """
     def runTest(self):
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         match = ofp.ofp_match()
         match.wildcards = 0
         stat_req = message.aggregate_stats_request()
@@ -478,8 +468,7 @@
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # build packet
         pkt = simple_tcp_packet()
@@ -504,13 +493,12 @@
         flow_mod_msg.priority = 100
         flow_mod_msg.flags = ofp.OFPFF_SEND_FLOW_REM
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
 
         # send flow
         logging.info("Inserting flow")
-        rv = self.controller.message_send(flow_mod_msg)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg)
+        do_barrier(self.controller)
 
         # send packet N times
         num_sends = random.randint(10,20)
@@ -521,8 +509,7 @@
 
         # delete flow
         logging.info("Deleting flow")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # wait for flow_removed message
         flow_removed, _ = self.controller.poll(
diff --git a/tests/load.py b/tests/load.py
index ecd565b..0ad14e9 100644
--- a/tests/load.py
+++ b/tests/load.py
@@ -68,15 +68,14 @@
         request.hard_timeout = 2 * barrier_count
 
         request.buffer_id = 0xffffffff
-        self.assertTrue(request.actions.add(act), "Could not add action")
+        request.actions.add(act)
 
         act = action.action_output()
         act.port = ofp.OFPP_CONTROLLER
-        self.assertTrue(request.actions.add(act), "Could not add action")
+        request.actions.add(act)
 
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         # Create packet out and send to port lb_port + 1
         msg = message.packet_out()
@@ -84,22 +83,20 @@
         msg.data = str(pkt)
         act = action.action_output()
         act.port = lb_port + 1
-        self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
+        msg.actions.add(act)
         logging.info("Sleeping before starting storm")
         time.sleep(1) # Root causing issue with fast disconnects
         logging.info("Sending packet out to %d" % (lb_port + 1))
-        rv = self.controller.message_send(msg)
-        self.assertTrue(rv == 0, "Error sending out message")
+        self.controller.message_send(msg)
 
         for idx in range(0, barrier_count):
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            do_barrier(self.controller)
             # To do:  Add some interesting functionality here
             logging.info("Barrier %d completed" % idx)
 
         # Clear the flow table when done
         logging.debug("Deleting all flows from switch")
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
 class PacketInLoad(base_tests.SimpleDataPlane):
     """
@@ -114,9 +111,8 @@
         # Send packet to dataplane, once to each port
         # Poll controller with expect message type packet in
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
         out_count = 0
         in_count = 0
 
@@ -158,8 +154,7 @@
         # Send packet to dataplane
         # Poll controller with expect message type packet in
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # These will get put into function
         of_ports = config["port_map"].keys()
@@ -179,14 +174,13 @@
                msg.data = str(outpkt)
                act = action.action_output()
                act.port = dp_port
-               self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
+               msg.actions.add(act)
 
                logging.info("PacketOutLoad to: " + str(dp_port))
                for count in range(100):
                    msg.xid = xid
                    xid += 1
-                   rv = self.controller.message_send(msg)
-                   self.assertTrue(rv == 0, "Error sending out message")
+                   self.controller.message_send(msg)
                    out_count += 1
 
                exp_pkt_arg = None
@@ -237,8 +231,7 @@
 
         for i in range(3):
             logging.info("Iteration %d: delete all flows" % i)
-            self.assertEqual(delete_all_flows(self.controller), 0,
-                             "Failed to delete all flows")
+            delete_all_flows(self.controller)
             self.checkBarrier()
 
             logging.info("Iteration %d: add %s flows" % (i, num_flows))
diff --git a/tests/message_types.py b/tests/message_types.py
index d0e6822..7785f36 100644
--- a/tests/message_types.py
+++ b/tests/message_types.py
@@ -38,8 +38,7 @@
         logging.info("Sending Hello...")
         request = message.hello()
         request.data = 'OpenFlow Will Rule The World'
-        rv=self.controller.message_send(request)
-        self.assertTrue(rv is not None,"Unable to send the message")
+        self.controller.message_send(request)
 
         #Verify Hello message in response 
         logging.info("Waiting for a Hello on the control plane with same xid,version--1.0.0 and data field empty")
@@ -64,8 +63,7 @@
         logging.info("Sending Echo With Data ...")
         request = message.echo_request()
         request.data = 'OpenFlow Will Rule The World'
-        rv=self.controller.message_send(request)
-        self.assertTrue(rv is not None,"Unable to send the message")
+        self.controller.message_send(request)
 
         #Verify Echo Reply is recieved 
         logging.info("Waiting for Echo Reply with data field copied from Echo Request")
@@ -100,8 +98,7 @@
         logging.info("Sending a Echo request with a version which is not supported by the switch")
         request=message.echo_request()
         request.header.version=0  
-        rv=self.controller.message_send(request)
-        self.assertTrue(rv is not None,"Unable to send the message")
+        self.controller.message_send(request)
 
         logging.info("Waiting for a OFPT_ERROR msg on the control plane...") 
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_ERROR,         
@@ -274,8 +271,7 @@
             req.flags = old_flags+1 
             new_flags = req.flags
 
-        rv=self.controller.message_send(req)
-        self.assertTrue(rv is not None,"Unable to send the message")
+        self.controller.message_send(req)
 
         #Send get_config_request -- verify change came into effect
         logging.info("Sending Get Config Request...")
@@ -302,8 +298,7 @@
         of_ports.sort()
 
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         #Send a set_config_request message 
         miss_send_len = [0 ,32 ,64,100]
@@ -311,8 +306,7 @@
         for bytes in miss_send_len :
             req = message.set_config()
             req.miss_send_len = bytes
-            rv=self.controller.message_send(req)
-            self.assertTrue(rv is not None,"Unable to send the message")
+            self.controller.message_send(req)
             sleep(1)
 
             # Send packet to trigger packet_in event
@@ -351,8 +345,7 @@
         of_ports.sort()
 
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         #Create a simple tcp packet
         pkt = simple_tcp_packet()
@@ -376,9 +369,8 @@
             request.actions.add(act)
             
             logging.info("Inserting flow....")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
             
             #Send packet matching the flow
             logging.debug("Sending packet to dp port " + str(of_ports[0]))
@@ -411,15 +403,13 @@
         of_ports.sort()
 
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         #Set miss_send_len field 
         logging.info("Sending  set_config_request to set miss_send_len... ")
         req = message.set_config()
         req.miss_send_len = 65535
-        rv=self.controller.message_send(req)
-        self.assertTrue(rv is not None,"Unable to send the message")
+        self.controller.message_send(req)
         sleep(1)
 
         # Send packet to trigger packet_in event
@@ -459,8 +449,7 @@
         of_ports.sort()
 
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # Create a simple tcp packet
         pkt = simple_tcp_packet()
@@ -478,9 +467,8 @@
         request.actions.add(act)
 
         logging.info("Inserting flow....")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
             
         #Send packet matching the flow
         logging.debug("Sending packet to dp port " + str(of_ports[0]))
@@ -516,8 +504,7 @@
         of_ports = config["port_map"].keys()
         
         #Clear switch state      
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         #Bring down the port by shutting the interface connected 
         try:
@@ -572,7 +559,7 @@
         rv = port_config_set(self.controller, of_ports[0],
                              port_config ^ ofp.OFPPC_NO_FLOOD, ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         # Verify change took place with features request
         logging.info("Verify the change and then set it back")
@@ -588,7 +575,7 @@
         rv = port_config_set(self.controller, of_ports[0],port_config,
                              ofp.OFPPC_NO_FLOOD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
 
 class PortModFwd(base_tests.SimpleDataPlane):
@@ -615,7 +602,7 @@
         rv = port_config_set(self.controller, of_ports[0],
                              port_config ^ ofp.OFPPC_NO_FWD, ofp.OFPPC_NO_FWD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         # Verify change took place with features request
         logging.info("Verify the change and then set it back")
@@ -632,7 +619,7 @@
         rv = port_config_set(self.controller, of_ports[0],port_config,
                              ofp.OFPPC_NO_FWD)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
 
 class PortModPacketIn(base_tests.SimpleDataPlane):
@@ -659,7 +646,7 @@
         rv = port_config_set(self.controller, of_ports[0],
                              port_config ^ ofp.OFPPC_NO_PACKET_IN, ofp.OFPPC_NO_PACKET_IN)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         # Verify change took place with features request
         logging.info("Verify the change and then set it back")
@@ -676,7 +663,7 @@
         rv = port_config_set(self.controller, of_ports[0],port_config,
                              ofp.OFPPC_NO_PACKET_IN)
         self.assertTrue(rv != -1, "Error sending port mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
 
 class DescStatsReplyBody(base_tests.SimpleDataPlane):
diff --git a/tests/openflow_protocol_messages.py b/tests/openflow_protocol_messages.py
index 80828c1..b182015 100644
--- a/tests/openflow_protocol_messages.py
+++ b/tests/openflow_protocol_messages.py
@@ -36,15 +36,13 @@
         of_ports.sort()
         
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
         
         logging.info("Sending Features_Request")
         logging.info("Expecting Features_Reply")
 
         request = message.features_request()
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Not able to send features request.")
+        self.controller.message_send(request)
         
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_FEATURES_REPLY,
                                                timeout=2)
@@ -66,15 +64,13 @@
         of_ports.sort()
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Sending OFPT_GET_CONFIG_REQUEST ")
         logging.info("Expecting OFPT_GET_CONFIG_REPLY ")
 
         request = message.get_config_request()
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, " Not able to send get_config request.")
+        self.controller.message_send(request)
         
         (response, pkt) = self.controller.poll(exp_msg=ofp.OFPT_GET_CONFIG_REPLY,
                                                timeout=2)
@@ -95,8 +91,7 @@
         of_ports.sort()
         
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a flow entry")
         logging.info("Expecting active_count=1 in table_stats_reply")
@@ -124,8 +119,7 @@
         of_ports.sort()
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a flow entry and then deleting it")
         logging.info("Expecting the active_count=0 in table_stats_reply")
@@ -159,8 +153,7 @@
         of_ports.sort()
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a flow entry and then modifying it")
         logging.info("Expecting the Test Packet to implement the modified action")
@@ -190,8 +183,7 @@
         of_ports.sort()
 
         #Clear switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Inserting a flow entry and then sending flow_stats request")
         logging.info("Expecting the a flow_stats_reply without errors")
@@ -216,8 +208,7 @@
         of_ports.sort()
        
         #Clear Switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         logging.info("Sending a packet-out for each dataplane port")
         logging.info("Expecting the packet on appropriate dataplane port")
@@ -232,11 +223,10 @@
                 msg.data = str(outpkt)
                 act = action.action_output()
                 act.port = dp_port
-                self.assertTrue(msg.actions.add(act), 'Could not add action to msg')
+                msg.actions.add(act)
 
                 logging.info("PacketOut to: " + str(dp_port))
-                rv = self.controller.message_send(msg)
-                self.assertTrue(rv == 0, "Error sending out message")
+                self.controller.message_send(msg)
 
                 exp_pkt_arg = None
                 exp_port = None
@@ -274,9 +264,8 @@
         ingress_port = of_ports[0]
 
         #Clear Switch state
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
 
         logging.info("Sending a Simple tcp packet a dataplane port")
         logging.info("Expecting a packet_in event on the control plane")
diff --git a/tests/pktact.py b/tests/pktact.py
index 0165597..7d30698 100644
--- a/tests/pktact.py
+++ b/tests/pktact.py
@@ -108,8 +108,7 @@
         act = action.action_output()
 
         for idx in range(len(of_ports)):
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             ingress_port = of_ports[idx]
             egress_port = of_ports[(idx + 1) % len(of_ports)]
@@ -123,12 +122,11 @@
 
             request.buffer_id = 0xffffffff
             act.port = egress_port
-            self.assertTrue(request.actions.add(act), "Could not add action")
+            request.actions.add(act)
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + 
                            str(ingress_port))
@@ -178,8 +176,7 @@
                         "Could not generate flow match from pkt")
         act = action.action_output()
 
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         ingress_port = of_ports[0]
         match.in_port = ingress_port
@@ -190,12 +187,11 @@
         request.buffer_id = 0xffffffff
         act.port = ofp.OFPP_CONTROLLER
         act.max_len = 65535
-        self.assertTrue(request.actions.add(act), "Could not add action")
+        request.actions.add(act)
 
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(request)
+        do_barrier(self.controller)
 
         logging.info("Sending packet to dp port " +
                         str(ingress_port))
@@ -268,8 +264,7 @@
                                + " queue " + str(egress_queue_id)
                                )
 
-                rv = delete_all_flows(self.controller)
-                self.assertEqual(rv, 0, "Failed to delete all flows")
+                delete_all_flows(self.controller)
 
                 match.in_port = ingress_port
                 
@@ -279,12 +274,11 @@
                 request.buffer_id = 0xffffffff
                 act.port     = egress_port
                 act.queue_id = egress_queue_id
-                self.assertTrue(request.actions.add(act), "Could not add action")
+                request.actions.add(act)
 
                 logging.info("Inserting flow")
-                rv = self.controller.message_send(request)
-                self.assertTrue(rv != -1, "Error installing flow mod")
-                self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+                self.controller.message_send(request)
+                do_barrier(self.controller)
 
                 # Get current stats for selected egress queue
 
@@ -399,8 +393,7 @@
                                + " queue " + str(egress_queue_id)
                                )
 
-                rv = delete_all_flows(self.controller)
-                self.assertEqual(rv, 0, "Failed to delete all flows")
+                delete_all_flows(self.controller)
 
                 match.in_port = ingress_port
                 
@@ -410,12 +403,11 @@
                 request.buffer_id = 0xffffffff
                 act.port     = egress_port
                 act.queue_id = egress_queue_id
-                self.assertTrue(request.actions.add(act), "Could not add action")
+                request.actions.add(act)
 
                 logging.info("Inserting flow")
-                rv = self.controller.message_send(request)
-                self.assertTrue(rv != -1, "Error installing flow mod")
-                self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+                self.controller.message_send(request)
+                do_barrier(self.controller)
 
                 # Get current stats for selected egress queue
 
@@ -513,8 +505,7 @@
         act = action.action_output()
 
         for idx in range(len(of_ports)):
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             ingress_port = of_ports[idx]
             egress_port1 = of_ports[(idx + 1) % len(of_ports)]
@@ -529,15 +520,14 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = egress_port1
-            self.assertTrue(request.actions.add(act), "Could not add action1")
+            request.actions.add(act)
             act.port = egress_port2
-            self.assertTrue(request.actions.add(act), "Could not add action2")
+            request.actions.add(act)
             # logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + 
                            str(ingress_port))
@@ -573,8 +563,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + 
                            " all non-ingress ports")
@@ -587,14 +576,12 @@
                 if egress_port == ingress_port:
                     continue
                 act.port = egress_port
-                self.assertTrue(request.actions.add(act), 
-                                "Could not add output to " + str(egress_port))
+                request.actions.add(act)
             logging.debug(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -628,8 +615,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + " to all ports")
             match.in_port = ingress_port
@@ -642,14 +628,12 @@
                     act.port = ofp.OFPP_IN_PORT
                 else:
                     act.port = egress_port
-                self.assertTrue(request.actions.add(act), 
-                                "Could not add output to " + str(egress_port))
+                request.actions.add(act)
             # logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -678,8 +662,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + " to all ports")
             match.in_port = ingress_port
@@ -688,14 +671,12 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_FLOOD
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add flood port action")
+            request.actions.add(act)
             logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -727,8 +708,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + " to all ports")
             match.in_port = ingress_port
@@ -737,17 +717,14 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_FLOOD
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add flood port action")
+            request.actions.add(act)
             act.port = ofp.OFPP_IN_PORT
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add ingress port for output")
+            request.actions.add(act)
             logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -776,8 +753,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + " to all ports")
             match.in_port = ingress_port
@@ -786,14 +762,12 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_ALL
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add ALL port action")
+            request.actions.add(act)
             logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -825,8 +799,7 @@
         act = action.action_output()
 
         for ingress_port in of_ports:
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             logging.info("Ingress " + str(ingress_port) + " to all ports")
             match.in_port = ingress_port
@@ -835,17 +808,14 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_ALL
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add ALL port action")
+            request.actions.add(act)
             act.port = ofp.OFPP_IN_PORT
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add ingress port for output")
+            request.actions.add(act)
             logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -882,8 +852,7 @@
             self.assertEqual(rv, 0, "Failed to set port config")
 
         for idx in range(len(of_ports)):
-            rv = delete_all_flows(self.controller)
-            self.assertEqual(rv, 0, "Failed to delete all flows")
+            delete_all_flows(self.controller)
 
             ingress_port = of_ports[idx]
             no_flood_idx = (idx + 1) % len(of_ports)
@@ -898,14 +867,12 @@
             request.match = match
             request.buffer_id = 0xffffffff
             act.port = ofp.OFPP_FLOOD
-            self.assertTrue(request.actions.add(act), 
-                            "Could not add flood port action")
+            request.actions.add(act)
             logging.info(request.show())
 
             logging.info("Inserting flow")
-            rv = self.controller.message_send(request)
-            self.assertTrue(rv != -1, "Error installing flow mod")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(request)
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             logging.info("No flood port is " + str(no_flood_port))
@@ -918,7 +885,7 @@
             rv = port_config_set(self.controller, no_flood_port,
                                  0, ofp.OFPPC_NO_FLOOD)
             self.assertEqual(rv, 0, "Failed to reset port config")
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            do_barrier(self.controller)
 
             # Check that packets are now flooded to no_flood_port
             logging.info("Sending packet to dp port " + str(ingress_port))
@@ -985,9 +952,8 @@
         self.flowMsgs = {}
 
     def _ClearTable(self):
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        delete_all_flows(self.controller)
+        do_barrier(self.controller)
 
     def runTest(self):
         
@@ -1065,7 +1031,7 @@
             msg.out_port = ofp.OFPP_NONE
             logging.debug("Remove flow with priority " + str(prio))
             self.controller.message_send(msg)
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            do_barrier(self.controller)
         else:
             raise Exception("Not initialized")
 
@@ -1377,8 +1343,7 @@
         ing_port = of_ports[0]
         egr_ports = of_ports[1]
         
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         len_untagged = 100
         len_w_vid = 104
@@ -1812,9 +1777,8 @@
 
         # Install the first set of flows
         for f_idx in range(flow_count):
-            rv = self.controller.message_send(flows[0][f_idx])
-            self.assertTrue(rv != -1, "Error installing flow %d" % f_idx)
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            self.controller.message_send(flows[0][f_idx])
+        do_barrier(self.controller)
     
         logging.info("Installed %d flows" % flow_count)
     
@@ -1832,12 +1796,9 @@
             for toggle in range(2):
                 t_idx = 1 - toggle
                 for f_idx in range(flow_count):
-                    rv = self.controller.message_send(flows[t_idx][f_idx])
+                    self.controller.message_send(flows[t_idx][f_idx])
                     updates += 1
-                    self.assertTrue(rv != -1, "Error modifying flow %d" % 
-                                    f_idx)
-                self.assertEqual(do_barrier(self.controller), 0,
-                                 "Barrier failed")
+                do_barrier(self.controller)
 
         end = time.time()
         divisor = end - start or (end - start + 1)
@@ -1978,7 +1939,7 @@
                 request.priority = priority
                 act = action.action_output()
                 act.port = output_port
-                self.assertTrue(request.actions.add(act), "Could not add action")
+                request.actions.add(act)
                 logging.info("Inserting flow")
                 self.controller.message_send(request)
 
@@ -1987,7 +1948,7 @@
             # This flow should not match, but it has a higher priority.
             addFlow(matching=False, priority=1, output_port=ofp.OFPP_IN_PORT)
 
-            self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+            do_barrier(self.controller)
 
             logging.info("Sending packet to dp port " + str(ingress_port))
             self.dataplane.send(ingress_port, str(pkt))
@@ -2088,8 +2049,7 @@
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
-        rv = delete_all_flows(self.controller)
-        self.assertEqual(rv, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         ingress_port = of_ports[0]
         egress_port = of_ports[1]
@@ -2110,12 +2070,10 @@
         request.buffer_id = 0xffffffff
         for act in acts:
             act.port = egress_port
-            rv = request.actions.add(act)
-            self.assertTrue(rv, "Could not add action")
+            request.actions.add(act)
 
         logging.info("Inserting flow")
-        rv = self.controller.message_send(request)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(request)
 
         # This flow speeds up negative tests
         logging.info("Inserting catch-all flow")
@@ -2125,10 +2083,9 @@
         act = action.action_output()
         act.port = ofp.OFPP_IN_PORT
         request2.actions.add(act)
-        rv = self.controller.message_send(request2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(request2)
 
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        do_barrier(self.controller)
 
         logging.info("Sending packet to dp port " + 
                        str(ingress_port))
diff --git a/tests/port_stats.py b/tests/port_stats.py
index 8d39d6f..5e0648f 100644
--- a/tests/port_stats.py
+++ b/tests/port_stats.py
@@ -149,8 +149,7 @@
         of_ports.sort()
         self.assertTrue(len(of_ports) > 1, "Not enough ports for test")
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         # build packet
         pkt = simple_tcp_packet()
@@ -173,13 +172,12 @@
         flow_mod_msg.idle_timeout = 0
         flow_mod_msg.hard_timeout = 0
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
        
         # send flow
         logging.info("Inserting flow")
-        rv = self.controller.message_send(flow_mod_msg)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg)
+        do_barrier(self.controller)
 
         # get initial port stats count
         initTxInPort, initRxInPort = getStats(self, ingress_port)
@@ -220,7 +218,7 @@
         flow_mod_msg.hard_timeout = 0
         act = action.action_output()
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
 
         logging.info("Ingress " + str(ingress_port) + 
                        " to egress " + str(egress_port))
@@ -238,8 +236,7 @@
         egress_port1 = of_ports[1];
         egress_port2 = of_ports[2];
 
-        rc = delete_all_flows(self.controller)
-        self.assertEqual(rc, 0, "Failed to delete all flows")
+        delete_all_flows(self.controller)
 
         pkt1 = simple_tcp_packet()
         flow_mod_msg1 = self.buildFlowModMsg(pkt1, ingress_port, egress_port1)
@@ -248,12 +245,10 @@
         flow_mod_msg2 = self.buildFlowModMsg(pkt2, ingress_port, egress_port2)
        
         logging.info("Inserting flow1")
-        rv = self.controller.message_send(flow_mod_msg1)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(flow_mod_msg1)
         logging.info("Inserting flow2")
-        rv = self.controller.message_send(flow_mod_msg2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg2)
+        do_barrier(self.controller)
 
         # get initial port stats count
         initTxInPort, initRxInPort = getStats(self, ingress_port)
@@ -300,7 +295,7 @@
         flow_mod_msg.hard_timeout = 0
         act = action.action_output()
         act.port = egress_port
-        self.assertTrue(flow_mod_msg.actions.add(act), "Could not add action")
+        flow_mod_msg.actions.add(act)
 
         logging.info("Ingress " + str(ingress_port) + 
                        " to egress " + str(egress_port))
@@ -326,12 +321,10 @@
         flow_mod_msg2 = self.buildFlowModMsg(pkt2, port0, port2)
        
         logging.info("Inserting flow1")
-        rv = self.controller.message_send(flow_mod_msg1)
-        self.assertTrue(rv != -1, "Error installing flow mod")
+        self.controller.message_send(flow_mod_msg1)
         logging.info("Inserting flow2")
-        rv = self.controller.message_send(flow_mod_msg2)
-        self.assertTrue(rv != -1, "Error installing flow mod")
-        self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
+        self.controller.message_send(flow_mod_msg2)
+        do_barrier(self.controller)
 
         num_pkt1s = random.randint(5,10)
         logging.info("Sending " + str(num_pkt1s) + " pkt1s")
diff --git a/tools/munger/scripts/action_gen.py b/tools/munger/scripts/action_gen.py
index 116cd7b..bde0291 100644
--- a/tools/munger/scripts/action_gen.py
+++ b/tools/munger/scripts/action_gen.py
@@ -66,20 +66,27 @@
 }
 
 template = """
-class action_--TYPE--(--PARENT_TYPE--):
+class --TYPE--(--PARENT_TYPE--):
     \"""
     Wrapper class for --TYPE-- action object
 
     --DOC_INFO--
     \"""
-    def __init__(self):
+    def __init__(self, **kwargs):
         --PARENT_TYPE--.__init__(self)
         self.type = --ACTION_NAME--
         self.len = self.__len__()
+        for (k, v) in kwargs.items():
+            if hasattr(self, k):
+                setattr(self, k, v)
+            else:
+                raise NameError("field %s does not exist in %s" % (k, self.__class__))
     def show(self, prefix=''):
         outstr = prefix + "action_--TYPE--\\n"
         outstr += --PARENT_TYPE--.show(self, prefix)
         return outstr
+
+action_--TYPE-- = --TYPE-- # for backwards compatibility
 """
 
 if __name__ == '__main__':
diff --git a/tools/munger/scripts/message_gen.py b/tools/munger/scripts/message_gen.py
index 1c627c1..053170a 100644
--- a/tools/munger/scripts/message_gen.py
+++ b/tools/munger/scripts/message_gen.py
@@ -296,18 +296,23 @@
     _p1('"""')
 
     print
-    _p1("def __init__(self):")
+    _p1("def __init__(self, **kwargs):")
     if has_core_members:
         _p2(parent + ".__init__(self)")
     _p2("self.header = ofp_header()")
     _p2("self.header.type = " + msg_name)
     if has_list:
-        if list_type == None:
-            _p2('self.' + list_var + ' = []')
-        else:
-            _p2('self.' + list_var + ' = ' + list_type + '()')
+        _p2('self.' + list_var + ' = []')
     if has_string:
         _p2('self.data = ""')
+    _p2('for (k, v) in kwargs.items():')
+    _p3('if hasattr(self, k):')
+    _p4('setattr(self, k, v)')
+    _p3('else:')
+    _p4('raise NameError("field %s does not exist in %s" % (k, self.__class__))')
+    if has_list and list_type != None:
+        _p2('# Coerce keyword arg into list type')
+        _p2('self.%(list_var)s = %(list_type)s(self.%(list_var)s)' % dict(list_type=list_type, list_var=list_var))
 
     print """
 
@@ -528,12 +533,17 @@
     \"""
     Wrapper class for --TYPE-- stats request message
     \"""
-    def __init__(self):
+    def __init__(self, **kwargs):
         self.header = ofp_header()
         ofp_stats_request.__init__(self)
         ofp_--TYPE--_stats_request.__init__(self)
         self.header.type = OFPT_STATS_REQUEST
         self.type = --STATS_NAME--
+        for (k, v) in kwargs.items():
+            if hasattr(self, k):
+                setattr(self, k, v)
+            else:
+                raise NameError("field %s does not exist in %s" % (k, self.__class__))
 
     def pack(self, assertstruct=True):
         self.header.length = len(self)
