From 069727fdc896669c0a5fe36248f418438419fcdd Mon Sep 17 00:00:00 2001 From: Benjamin Hesmans Date: Wed, 29 Jul 2015 05:18:35 -0700 Subject: [PATCH] Check if MPRIO is sent when the default interface is backup Signed-off-by: Benjamin Hesmans --- src/bup_tests/kernelspace/topo | 10 ++++++++++ src/bup_tests/kernelspace/validation.yml | 8 ++++++++ src/bup_tests/kernelspace/xp | 10 ++++++++++ src/bup_tests/userspace/topo | 10 ++++++++++ src/bup_tests/userspace/validation.yml | 8 ++++++++ src/bup_tests/userspace/xp | 11 +++++++++++ src/mpValidations.py | 16 ++++++++++++++++ 7 files changed, 73 insertions(+) create mode 100644 src/bup_tests/kernelspace/topo create mode 100644 src/bup_tests/kernelspace/validation.yml create mode 100644 src/bup_tests/kernelspace/xp create mode 100644 src/bup_tests/userspace/topo create mode 100644 src/bup_tests/userspace/validation.yml create mode 100644 src/bup_tests/userspace/xp diff --git a/src/bup_tests/kernelspace/topo b/src/bup_tests/kernelspace/topo new file mode 100644 index 0000000..795f96f --- /dev/null +++ b/src/bup_tests/kernelspace/topo @@ -0,0 +1,10 @@ +leftSubnet:10.0. +rightSubnet:10.1. +path_0:10,10,4,True +path_1:40,30,4,False +topoType:MultiIf +#changeNetem:yes +#netem_{path_id}:at,cmd +#netemAt_0:5,delay 100ms limit 10 loss 10% +#netemAt_0:15,delay 10ms limit 10 +#netemAt_1:15,delay 100ms limit 10 diff --git a/src/bup_tests/kernelspace/validation.yml b/src/bup_tests/kernelspace/validation.yml new file mode 100644 index 0000000..52a784f --- /dev/null +++ b/src/bup_tests/kernelspace/validation.yml @@ -0,0 +1,8 @@ +checkers: + tshark: + - test: "filter" + filter: "tcp.options.mptcp.subtype==5" + validations: + - name: "exact_value" + target: 1 + desc: "When the default interface is a backup, MPRIO should be sent" diff --git a/src/bup_tests/kernelspace/xp b/src/bup_tests/kernelspace/xp new file mode 100644 index 0000000..9c0e589 --- /dev/null +++ b/src/bup_tests/kernelspace/xp @@ -0,0 +1,10 @@ +xpType:ncpv +ncClientPort_0:33400 +clientPcap:yes +pvRateLimit:400k +ddCount:5000 +kpmc:fullmesh +#sched:roundrobin +#rmem:87380 87380 87380 +#rmem:150000 150000 150000 +#rmem:300000 300000 300000 diff --git a/src/bup_tests/userspace/topo b/src/bup_tests/userspace/topo new file mode 100644 index 0000000..795f96f --- /dev/null +++ b/src/bup_tests/userspace/topo @@ -0,0 +1,10 @@ +leftSubnet:10.0. +rightSubnet:10.1. +path_0:10,10,4,True +path_1:40,30,4,False +topoType:MultiIf +#changeNetem:yes +#netem_{path_id}:at,cmd +#netemAt_0:5,delay 100ms limit 10 loss 10% +#netemAt_0:15,delay 10ms limit 10 +#netemAt_1:15,delay 100ms limit 10 diff --git a/src/bup_tests/userspace/validation.yml b/src/bup_tests/userspace/validation.yml new file mode 100644 index 0000000..52a784f --- /dev/null +++ b/src/bup_tests/userspace/validation.yml @@ -0,0 +1,8 @@ +checkers: + tshark: + - test: "filter" + filter: "tcp.options.mptcp.subtype==5" + validations: + - name: "exact_value" + target: 1 + desc: "When the default interface is a backup, MPRIO should be sent" diff --git a/src/bup_tests/userspace/xp b/src/bup_tests/userspace/xp new file mode 100644 index 0000000..158dc11 --- /dev/null +++ b/src/bup_tests/userspace/xp @@ -0,0 +1,11 @@ +xpType:ncpv +ncClientPort_0:33400 +clientPcap:yes +pvRateLimit:400k +ddCount:5000 +kpmc:netlink +upmc:fullmesh +#sched:roundrobin +#rmem:87380 87380 87380 +#rmem:150000 150000 150000 +#rmem:300000 300000 300000 diff --git a/src/mpValidations.py b/src/mpValidations.py index 563fa99..d204738 100644 --- a/src/mpValidations.py +++ b/src/mpValidations.py @@ -1,6 +1,7 @@ from mpTcptraceData import * +from subprocess import check_output import numpy as np @@ -126,6 +127,15 @@ class Tester: raise Exception("Method not implemented") +class FilterTest(Tester): + def get_tested_value(self, yml): + if "filter" in self.yml: + ret = check_output(["tshark", "-r", self.trace, "-Y", self.yml["filter"]]) + return len(ret.split("\n")) - 1 + else: + raise Exception("Test requires a filter.") + + class CsvTest(Tester): def get_tested_value(self, validation): @@ -161,6 +171,12 @@ class TcptraceChecker(Checker): self.trace = TcptraceData(destDir+"/client.pcap") self.test_id = test_id +class TsharkChecker(Checker): + def __init__(self, yml, test_id, destDir): + self.yml = yml["tshark"] + self.trace = destDir+"/client.pcap" + self.test_id = test_id + from mpMptcptraceData import * # Runs tests based on mptcptrace