From c7cfde7d65519c4d5b0b035c8d39891ccc4bebb7 Mon Sep 17 00:00:00 2001 From: Raphael Bauduin Date: Tue, 19 May 2015 06:50:02 -0700 Subject: [PATCH] step 2 --- src/conf/xp/4_nc | 12 +++++++++--- src/mpExperienceNCPV.py | 2 +- src/mpIterator.py | 31 +++++++++++++++++++++---------- src/validation.yml | 12 +++++++----- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/src/conf/xp/4_nc b/src/conf/xp/4_nc index 5740ad4..f2cffd1 100644 --- a/src/conf/xp/4_nc +++ b/src/conf/xp/4_nc @@ -1,5 +1,11 @@ -xpType:nc +xpType:ncpv +rmem:300000 300000 300000 ncClientPort_0:33400 clientPcap:yes -ddCount:15000 -rmem:300000 300000 300000 +pvRateLimit:600k +ddCount:10000 +kpm:fullmesh +kpms:netlink +kpmc:netlink +upmc:fullmesh +#upmc_args: -n 5 diff --git a/src/mpExperienceNCPV.py b/src/mpExperienceNCPV.py index 4b984ba..1681241 100644 --- a/src/mpExperienceNCPV.py +++ b/src/mpExperienceNCPV.py @@ -9,7 +9,7 @@ class MpExperienceNCPV(MpExperience): SERVER_NC_LOG = "netcat_server" CLIENT_NC_LOG = "netcat_client" NC_BIN = "netcat" - PV_BIN = "/home/bhesmans/Documents/git/pv/pv" + PV_BIN = "pv" def __init__(self, xpParamFile, mpTopo, mpConfig): MpExperience.__init__(self, xpParamFile, mpTopo, mpConfig) diff --git a/src/mpIterator.py b/src/mpIterator.py index c20149d..52ebad9 100755 --- a/src/mpIterator.py +++ b/src/mpIterator.py @@ -18,28 +18,39 @@ xpParamFile = None topoBuilder = "mininet" class MinValueValidation: - def __init__(self, compared): - self.compared=compared + def __init__(self, yml): + self.compared=yml["target"] def validate(self, value): return self.compared<=value -class NumberOfFlowsTest: +class MinDelayValidation: + def __init__(self, v): + self.compared=v["target"] + def validate(self, flow): + return self.compared<=flow[5] +class TcptraceTest: def __init__(self, yml, trace): self.yml = yml["validations"] self.trace = trace def validate(self): print self.yml - tested_value = self.trace.number_of_flows - for k,v in self.yml.iteritems(): - name = k.title().replace("_","")+"Validation" - tester_klass=globals()[name] - tester = tester_klass(v) + for val in self.yml: + print "val: ", val + tested_value = self.get_tested_value(val) + klass_name=val["name"].title().replace("_","")+"Validation" + tester_klass=globals()[klass_name] + tester = tester_klass(val) if tester.validate(tested_value): print "SUCCESS" else: print "FAIL" - print k,v - +class NumberOfFlowsTest(TcptraceTest): + def get_tested_value(self, val): + return self.trace.number_of_flows + +class FlowsTest(TcptraceTest): + def get_tested_value(self, val): + return self.trace.flows[val["index"]] class TcptraceValidator: diff --git a/src/validation.yml b/src/validation.yml index 010eb61..3327d18 100644 --- a/src/validation.yml +++ b/src/validation.yml @@ -1,8 +1,10 @@ tcptrace: - test: "number_of_flows" validations: - min_value: 2 -# - test: "flows" -# validations: -# - index: 1 -# min_delay: 7000 + - name: "min_value" + target: 2 + - test: "flows" + validations: + - name: "min_delay" + index: 1 + target: 7000