throw AssertionError if controller.message_send fails

Unlike other types of exception an AssertionError will cause the test to "fail"
instead of "error". Using an exception instead of checking return values
removes a lot of boilerplate code that wasn't always present (or correct). It
may also help disabuse test writers of the dangerous notion that succeeding in
writing a message to the TCP socket means anything.
diff --git a/tests/FuncUtils.py b/tests/FuncUtils.py
index 4d420da..ad1b1ea 100644
--- a/tests/FuncUtils.py
+++ b/tests/FuncUtils.py
@@ -41,8 +41,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_exactflow,match)
@@ -69,8 +68,7 @@
     act.port = of_ports[2]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_exactflow,match)         
@@ -98,8 +96,7 @@
     act1.port = of_ports[1]
     msg1.actions.add(act1)
 
-    rv = self.controller.message_send(msg1)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg1)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_wildcardsrc,match1)
@@ -126,8 +123,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_MatchSrc,match)
@@ -153,8 +149,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchdst,match)
@@ -180,8 +175,7 @@
     if priority != None :
         msg2.priority = priority
 
-    rv = self.controller.message_send(msg2)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg2)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_wildcard,match2)
@@ -214,8 +208,7 @@
     if priority != None :
         msg3.priority = priority
 
-    rv = self.controller.message_send(msg3)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg3)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchingress,match3)
@@ -247,8 +240,7 @@
     if priority != None :
         msg3.priority = priority
 
-    rv = self.controller.message_send(msg3)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg3)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchingress,match3)
@@ -275,8 +267,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchvlanid,match)
@@ -302,8 +293,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchvlanpcp,match)
@@ -330,8 +320,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_mulL2,match)
@@ -357,8 +346,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_mulL4,match)  
@@ -383,8 +371,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_iptos,match)
@@ -409,8 +396,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_iptos,match)
@@ -437,8 +423,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchtSrc,match)  
@@ -463,8 +448,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
     return (pkt_matchdst,match)        
@@ -491,8 +475,7 @@
     act.port = of_ports[1]
     msg.actions.add(act)
 
-    rv = self.controller.message_send(msg)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
     return (pkt_matchtype,match)
 
@@ -516,8 +499,7 @@
         msg5.priority = priority
 
     # Send the flow with action A'
-    rv = self.controller.message_send (msg5)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send (msg5)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
 def modify_flow_action(self,of_ports,match,priority=None):
@@ -539,8 +521,7 @@
         msg8.priority = priority
 
     # Send the flow with action A'
-    rv = self.controller.message_send (msg8)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send (msg8)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
 def enqueue(self,ingress_port,egress_port,egress_queue_id):
@@ -562,8 +543,7 @@
     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)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
     return (pkt,match)
 
@@ -834,8 +814,7 @@
 
     if priority != None :
         msg4.priority = priority
-    rv = self.controller.message_send(msg4)
-    self.assertTrue(rv!= -1, "Error installing flow mod")
+    self.controller.message_send(msg4)
     self.assertEqual(do_barrier(self.controller), 0, "Barrier failed")
 
 
@@ -853,8 +832,7 @@
     if priority != None :
         msg6.priority = priority
 
-    rv = self.controller.message_send(msg6)
-    self.assertTrue(rv != -1, "Error installing flow mod")
+    self.controller.message_send(msg6)
     self.assertEqual(do_barrier(self.controller),0, "Barrier failed")