Reworked FlowConfigBlaster to be able to batch multiple flows in a single RESTCONF...
[integration/test.git] / test / tools / odl-mdsal-clustering-tests / clustering-performance-test / flow_config_blaster_fle.py
index 429294bc58505d652beec94dc6946909e7261f9d..ac531254f0dcc63ef3abdea4fcccf1a73276f79c 100755 (executable)
@@ -10,6 +10,7 @@ import netaddr
 import time
 import json
 
+
 class FlowConfigBlasterFLE(FlowConfigBlaster):
     """
     FlowConfigBlaster, Floodlight Edition; Uses the Floodlight Static Flow Entry Pusher REST API to inject flows.
@@ -31,7 +32,6 @@ class FlowConfigBlasterFLE(FlowConfigBlaster):
         # Create the service URL
         self.url = 'http://' + self.host + ":" + self.port + '/wm/staticflowentrypusher/json'
 
-
     def get_num_nodes(self, session):
         """
         Determines the number of nodes in the network. Overrides the get_num_nodes method in FlowConfigBlaster.
@@ -51,8 +51,7 @@ class FlowConfigBlasterFLE(FlowConfigBlaster):
 
         return nodes
 
-
-    def add_flow(self, session, node, flow_id, ipaddr):
+    def post_flows(self, session, node, flow_id, ipaddr):
         """
         Adds a flow. Overrides the add_flow method in FlowConfigBlaster.
         :param session:
@@ -73,7 +72,6 @@ class FlowConfigBlasterFLE(FlowConfigBlaster):
         r = session.post(self.url, data=flow_data, headers=self.putheaders, stream=False)
         return r.status_code
 
-
     def delete_flow(self, session, node, flow_id):
         """
         Deletes a flow. Overrides the delete_flow method in FlowConfigBlaster.
@@ -120,7 +118,6 @@ if __name__ == "__main__":
 
     in_args = parser.parse_args()
 
-
     fct = FlowConfigBlasterFLE(in_args.host, in_args.port, in_args.cycles, in_args.threads, in_args.nodes,
                                in_args.flows, in_args.startflow)