step 2
This commit is contained in:
parent
f4c77e9ddd
commit
c7cfde7d65
@ -1,5 +1,11 @@
|
|||||||
xpType:nc
|
xpType:ncpv
|
||||||
|
rmem:300000 300000 300000
|
||||||
ncClientPort_0:33400
|
ncClientPort_0:33400
|
||||||
clientPcap:yes
|
clientPcap:yes
|
||||||
ddCount:15000
|
pvRateLimit:600k
|
||||||
rmem:300000 300000 300000
|
ddCount:10000
|
||||||
|
kpm:fullmesh
|
||||||
|
kpms:netlink
|
||||||
|
kpmc:netlink
|
||||||
|
upmc:fullmesh
|
||||||
|
#upmc_args: -n 5
|
||||||
|
@ -9,7 +9,7 @@ class MpExperienceNCPV(MpExperience):
|
|||||||
SERVER_NC_LOG = "netcat_server"
|
SERVER_NC_LOG = "netcat_server"
|
||||||
CLIENT_NC_LOG = "netcat_client"
|
CLIENT_NC_LOG = "netcat_client"
|
||||||
NC_BIN = "netcat"
|
NC_BIN = "netcat"
|
||||||
PV_BIN = "/home/bhesmans/Documents/git/pv/pv"
|
PV_BIN = "pv"
|
||||||
|
|
||||||
def __init__(self, xpParamFile, mpTopo, mpConfig):
|
def __init__(self, xpParamFile, mpTopo, mpConfig):
|
||||||
MpExperience.__init__(self, xpParamFile, mpTopo, mpConfig)
|
MpExperience.__init__(self, xpParamFile, mpTopo, mpConfig)
|
||||||
|
@ -18,28 +18,39 @@ xpParamFile = None
|
|||||||
topoBuilder = "mininet"
|
topoBuilder = "mininet"
|
||||||
|
|
||||||
class MinValueValidation:
|
class MinValueValidation:
|
||||||
def __init__(self, compared):
|
def __init__(self, yml):
|
||||||
self.compared=compared
|
self.compared=yml["target"]
|
||||||
def validate(self, value):
|
def validate(self, value):
|
||||||
return self.compared<=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):
|
def __init__(self, yml, trace):
|
||||||
self.yml = yml["validations"]
|
self.yml = yml["validations"]
|
||||||
self.trace = trace
|
self.trace = trace
|
||||||
def validate(self):
|
def validate(self):
|
||||||
print self.yml
|
print self.yml
|
||||||
tested_value = self.trace.number_of_flows
|
for val in self.yml:
|
||||||
for k,v in self.yml.iteritems():
|
print "val: ", val
|
||||||
name = k.title().replace("_","")+"Validation"
|
tested_value = self.get_tested_value(val)
|
||||||
tester_klass=globals()[name]
|
klass_name=val["name"].title().replace("_","")+"Validation"
|
||||||
tester = tester_klass(v)
|
tester_klass=globals()[klass_name]
|
||||||
|
tester = tester_klass(val)
|
||||||
if tester.validate(tested_value):
|
if tester.validate(tested_value):
|
||||||
print "SUCCESS"
|
print "SUCCESS"
|
||||||
else:
|
else:
|
||||||
print "FAIL"
|
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:
|
class TcptraceValidator:
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
tcptrace:
|
tcptrace:
|
||||||
- test: "number_of_flows"
|
- test: "number_of_flows"
|
||||||
validations:
|
validations:
|
||||||
min_value: 2
|
- name: "min_value"
|
||||||
# - test: "flows"
|
target: 2
|
||||||
# validations:
|
- test: "flows"
|
||||||
# - index: 1
|
validations:
|
||||||
# min_delay: 7000
|
- name: "min_delay"
|
||||||
|
index: 1
|
||||||
|
target: 7000
|
||||||
|
Loading…
Reference in New Issue
Block a user