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
|
||||
clientPcap:yes
|
||||
ddCount:15000
|
||||
rmem:300000 300000 300000
|
||||
pvRateLimit:600k
|
||||
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"
|
||||
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)
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user