FlowsTest works with TcpTraceData instance
This commit is contained in:
parent
47b1110f3f
commit
552393562c
@ -34,8 +34,8 @@ class ExactValueValidation(Validation):
|
|||||||
# gets flow_spec = (index, flows) where index is the index of the flow to validate, and flows is the array of flows
|
# gets flow_spec = (index, flows) where index is the index of the flow to validate, and flows is the array of flows
|
||||||
class MinDelayValidation(Validation):
|
class MinDelayValidation(Validation):
|
||||||
def validate(self, flow_spec):
|
def validate(self, flow_spec):
|
||||||
(index,flows) = flow_spec
|
(index,trace) = flow_spec
|
||||||
val = float(flows[index][5])-float(flows[0][5])
|
val = trace.first_packet(index)-trace.first_packet(0)
|
||||||
return self.compared<=val
|
return self.compared<=val
|
||||||
|
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ class NumberOfFlowsTest(TcptraceTest):
|
|||||||
# get_tested_value returns index of the flow to validate, and the list of flows
|
# get_tested_value returns index of the flow to validate, and the list of flows
|
||||||
class FlowsTest(TcptraceTest):
|
class FlowsTest(TcptraceTest):
|
||||||
def get_tested_value(self, yml):
|
def get_tested_value(self, yml):
|
||||||
return (yml["index"],self.trace.flows)
|
return (yml["index"],self.trace)
|
||||||
|
|
||||||
|
|
||||||
# Runs tests based on tcptrace
|
# Runs tests based on tcptrace
|
||||||
|
Loading…
Reference in New Issue
Block a user