From 552393562c79df95b35af3b864a401c4cf895e05 Mon Sep 17 00:00:00 2001 From: Raphael Bauduin Date: Tue, 26 May 2015 09:59:37 -0700 Subject: [PATCH] FlowsTest works with TcpTraceData instance --- src/mpValidations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mpValidations.py b/src/mpValidations.py index c8ff105..d54ec4f 100644 --- a/src/mpValidations.py +++ b/src/mpValidations.py @@ -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 class MinDelayValidation(Validation): def validate(self, flow_spec): - (index,flows) = flow_spec - val = float(flows[index][5])-float(flows[0][5]) + (index,trace) = flow_spec + val = trace.first_packet(index)-trace.first_packet(0) 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 class FlowsTest(TcptraceTest): def get_tested_value(self, yml): - return (yml["index"],self.trace.flows) + return (yml["index"],self.trace) # Runs tests based on tcptrace