fixing the lib to be compatible with mininet
authorPeter Gubka <pgubka@cisco.com>
Fri, 19 Jun 2015 09:11:44 +0000 (11:11 +0200)
committerPeter Gubka <pgubka@cisco.com>
Fri, 19 Jun 2015 09:11:44 +0000 (11:11 +0200)
mininet start indexing switches with 1 but the lib did it with 0,
now the lib will start with 1 too

Change-Id: Ibbff0a43fe954ec49c439b8acf8cbdbf045d0081
Signed-off-by: Peter Gubka <pgubka@cisco.com>
test/csit/libraries/ScaleClient.py

index 99f5bf591f878b99727db1fea5f4680da78e2f4d..34892630a1cd8a1663993825b49306664cca083d 100644 (file)
@@ -117,7 +117,8 @@ def generate_new_flow_details(flows=10, switches=1, swspread='gauss', tables=250
     according to the spread rules between swithces and tables.
     It also returns a dictionary with statsistics."""
     swflows = [_randomize(swspread, switches) for f in range(int(flows))]
-    fltables = [(s, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
+    # we have to increse the switch index because mininet start indexing switches from 1 (not 0)
+    fltables = [(s+1, _randomize(tabspread, tables), idx) for idx, s in enumerate(swflows)]
     notes = _get_notes(fltables)
     return fltables, notes