On Fri, May 24, 2019 at 07:26:50PM +0200, csfakian@redhat.com wrote:
From: Christos Sfakianakis csfakian@redhat.com
Add ShortLivedConnectionsRecipe, which accounts for short_lived_connections of old phase 3.
Signed-off-by: Christos Sfakianakis csfakian@redhat.com
.../ENRT/ShortLivedConnectionsRecipe.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 lnst/Recipes/ENRT/ShortLivedConnectionsRecipe.py
diff --git a/lnst/Recipes/ENRT/ShortLivedConnectionsRecipe.py b/lnst/Recipes/ENRT/ShortLivedConnectionsRecipe.py new file mode 100644 index 0000000..e311fa2 --- /dev/null +++ b/lnst/Recipes/ENRT/ShortLivedConnectionsRecipe.py @@ -0,0 +1,74 @@ +""" +Implements scenario similar to regression_tests/phase3/ +(short_lived_connections.xml + short_lived_connections.py) +""" +from lnst.Common.IpAddress import ipaddress +from lnst.Controller import HostReq, DeviceReq, RecipeParam +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe, EnrtConfiguration +from lnst.Common.Parameters import Param, IntParam, ListParam
+class ShortLivedConnectionsRecipe(BaseEnrtRecipe):
- host1 = HostReq()
- host1.eth0 = DeviceReq(label="to_switch", driver=RecipeParam("driver"))
- host2 = HostReq()
- host2.eth0 = DeviceReq(label="to_switch", driver=RecipeParam("driver"))
- perf_tests = Param(default=("TCP_RR", "TCP_CRR"))
- ip_versions = Param(default=("ipv4",))
- perf_parallel_streams = IntParam(default=2)
- perf_msg_size = ListParam(default=[1000, 5000, 7000, 10000, 12000])
- def generate_ping_configurations(self, main_config, sub_config):
return []
- def generate_flow_combinations(self, main_config, sub_config):
for size in self.params.perf_msg_size:
for flow in super(ShortLivedConnectionsRecipe, self).generate_flow_combinations(
main_config, sub_config):
flow[0].msg_size = size
yield flow
So the interface method of "generate_flow_combinations" from BaseEnrtRecipe returns a list of flows that should be tested in parallel. Changing the message size of only the first stream is therefore incorrect.
I understand that we don't actually have a different parallel streams use case at the moment, but it's good to think of that option for the future.
Wrt. changing the msg_size of a flow, that's only required since you changed the type of the parameter. I think eventually we might want to change the type of the parameter to a List for all of our recipes so this should be taken care of in the BaseEnrtRecipe generate_flow_combinations method instead.
And in that case you don't need the msg_size setter for the Flow either since you just create the correct flow instance from the start.
I think you can do this perf_msg_size parameter change in the base recipe and skip the method override here. Maybe even rename the parameter to "perf_msg_sizes" to indicate that it's a list.
- def test_wide_configuration(self):
host1, host2 = self.matched.host1, self.matched.host2
for host in [host1, host2]:
host.eth0.down()
net_addr = "192.168.101"
for i, host in enumerate([host1, host2], 10):
host.eth0.ip_add(ipaddress(net_addr + "." + str(i) + "/24"))
#Due to limitations in the current EnrtConfiguration
#class, a single vlan test pair is chosen
configuration = EnrtConfiguration()
configuration.endpoint1 = host1.eth0
configuration.endpoint2 = host2.eth0
if "mtu" in self.params:
for host in [host1, host2]:
host.eth0.mtu = self.params.mtu
for host in [host1, host2]:
host.eth0.up()
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
for host in [host1, host2]:
host.run("service irqbalance stop")
self._pin_dev_interrupts(host.eth0, self.params.dev_intr_cpu)
if self.params.perf_parallel_streams > 1:
for host in [host1, host2]:
host.run("tc qdisc replace dev %s root mq" % host.eth0.name)
return configuration
- def test_wide_deconfiguration(self, config):
host1, host2 = self.matched.host1, self.matched.host2
#TODO better service handling through HostAPI
if "dev_intr_cpu" in self.params:
for host in [host1, host2]:
host.run("service irqbalance start")
-- 2.17.1 _______________________________________________ LNST-developers mailing list -- lnst-developers@lists.fedorahosted.org To unsubscribe send an email to lnst-developers-leave@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahos...