From 2d155878ec8c2baf964ec4a0a2248a61fcc5d65f Mon Sep 17 00:00:00 2001 From: Ondrej Lichtner Date: Tue, 6 Feb 2024 09:46:26 +0100 Subject: [PATCH] Recipes.ENRT.PvPRecipes: HostReq consistency in hostids These two tests are using hostids that are different than every other ENRT recipe for no reason. Making them consistent should make the data migration that we need to do for our measurement database easier. Signed-off-by: Ondrej Lichtner --- lnst/Recipes/ENRT/OvS_DPDK_PvP.py | 50 ++++++++++----------- lnst/Recipes/ENRT/VhostNetPvPRecipe.py | 60 +++++++++++++------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py index 50d9e58c1..a388e170e 100644 --- a/lnst/Recipes/ENRT/OvS_DPDK_PvP.py +++ b/lnst/Recipes/ENRT/OvS_DPDK_PvP.py @@ -37,13 +37,13 @@ def __init__(self): class OvSDPDKPvPRecipe(BasePvPRecipe): - m1 = HostReq() - m1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) - m1.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host1 = HostReq() + host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host1.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) - m2 = HostReq(with_guest="yes") - m2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) - m2.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host2 = HostReq(with_guest="yes") + host2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host2.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) net_ipv4 = IPv4NetworkParam(default="192.168.1.0/24") @@ -76,33 +76,33 @@ def check_dependencies(self): def gen_ping_config(self): return [ - (self.matched.m1, self.matched.m1.eth0, self.matched.m2.eth0), - (self.matched.m1, self.matched.m1.eth1, self.matched.m2.eth1), - (self.matched.m2, self.matched.m2.eth0, self.matched.m1.eth0), - (self.matched.m2, self.matched.m2.eth1, self.matched.m2.eth1) + (self.matched.host1, self.matched.host1.eth0, self.matched.host2.eth0), + (self.matched.host1, self.matched.host1.eth1, self.matched.host2.eth1), + (self.matched.host2, self.matched.host2.eth0, self.matched.host1.eth0), + (self.matched.host2, self.matched.host2.eth1, self.matched.host2.eth1) ] def test_wide_configuration(self, config): - config.generator.host = self.matched.m1 - config.generator.nics.append(self.matched.m1.eth0) - config.generator.nics.append(self.matched.m1.eth1) + config.generator.host = self.matched.host1 + config.generator.nics.append(self.matched.host1.eth0) + config.generator.nics.append(self.matched.host1.eth1) ipv4_addr = interface_addresses(self.params.net_ipv4) nic_addrs = { - self.matched.m1.eth0: next(ipv4_addr), - self.matched.m2.eth0: next(ipv4_addr), - self.matched.m1.eth1: next(ipv4_addr), - self.matched.m2.eth1: next(ipv4_addr), + self.matched.host1.eth0: next(ipv4_addr), + self.matched.host2.eth0: next(ipv4_addr), + self.matched.host1.eth1: next(ipv4_addr), + self.matched.host2.eth1: next(ipv4_addr), } - self.matched.m1.eth0.ip_add(nic_addrs[self.matched.m1.eth0]) - self.matched.m1.eth1.ip_add(nic_addrs[self.matched.m1.eth1]) + self.matched.host1.eth0.ip_add(nic_addrs[self.matched.host1.eth0]) + self.matched.host1.eth1.ip_add(nic_addrs[self.matched.host1.eth1]) self.base_dpdk_configuration(config.generator) - config.dut.host = self.matched.m2 - config.dut.nics.append(self.matched.m2.eth0) - config.dut.nics.append(self.matched.m2.eth1) - self.matched.m2.eth0.ip_add(nic_addrs[self.matched.m2.eth0]) - self.matched.m2.eth1.ip_add(nic_addrs[self.matched.m2.eth1]) + config.dut.host = self.matched.host2 + config.dut.nics.append(self.matched.host2.eth0) + config.dut.nics.append(self.matched.host2.eth1) + self.matched.host2.eth0.ip_add(nic_addrs[self.matched.host2.eth0]) + self.matched.host2.eth1.ip_add(nic_addrs[self.matched.host2.eth1]) self.base_dpdk_configuration(config.dut) self.ovs_dpdk_bridge_configuration(config.dut) @@ -228,7 +228,7 @@ def ovs_dpdk_bridge_configuration(self, host_conf): host.run("systemctl restart openvswitch") # TODO use an actual OvS Device object - # TODO config.dut.nics.append(CachedRemoteDevice(m2.ovs)) + # TODO config.dut.nics.append(CachedRemoteDevice(host2.ovs)) host.run("ovs-vsctl add-br br0 -- set bridge br0 datapath_type=netdev") host_conf.dpdk_ports = [] diff --git a/lnst/Recipes/ENRT/VhostNetPvPRecipe.py b/lnst/Recipes/ENRT/VhostNetPvPRecipe.py index be0630bb8..fe2f5bcad 100644 --- a/lnst/Recipes/ENRT/VhostNetPvPRecipe.py +++ b/lnst/Recipes/ENRT/VhostNetPvPRecipe.py @@ -23,13 +23,13 @@ def __init__(self): class VhostNetPvPRecipe(BasePvPRecipe): - generator_req = HostReq() - generator_req.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) - generator_req.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host1 = HostReq() + host1.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host1.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) - host_req = HostReq(with_guest="yes") - host_req.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) - host_req.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host2 = HostReq(with_guest="yes") + host2.eth0 = DeviceReq(label="net1", driver=RecipeParam("driver")) + host2.eth1 = DeviceReq(label="net1", driver=RecipeParam("driver")) net_ipv4 = IPv4NetworkParam(default="192.168.101.0/24") @@ -64,39 +64,39 @@ def check_params(self): def gen_ping_config(self): return [ - (self.matched.generator_req, - self.matched.generator_req.eth0, - self.matched.host_req.eth0), - (self.matched.generator_req, - self.matched.generator_req.eth1, - self.matched.host_req.eth1), - (self.matched.host_req, - self.matched.host_req.eth0, - self.matched.generator_req.eth0), - (self.matched.host_req, - self.matched.host_req.eth1, - self.matched.host_req.eth1) + (self.matched.host1, + self.matched.host1.eth0, + self.matched.host2.eth0), + (self.matched.host1, + self.matched.host1.eth1, + self.matched.host2.eth1), + (self.matched.host2, + self.matched.host2.eth0, + self.matched.host1.eth0), + (self.matched.host2, + self.matched.host2.eth1, + self.matched.host2.eth1) ] def test_wide_configuration(self, config): - config.generator.host = self.matched.generator_req - config.generator.nics.append(self.matched.generator_req.eth0) - config.generator.nics.append(self.matched.generator_req.eth1) + config.generator.host = self.matched.host1 + config.generator.nics.append(self.matched.host1.eth0) + config.generator.nics.append(self.matched.host1.eth1) ipv4_addr = interface_addresses(self.params.net_ipv4) - self.matched.generator_req.eth0.ip_add(next(ipv4_addr)) - self.matched.generator_req.eth1.ip_add(next(ipv4_addr)) - self.matched.generator_req.eth0.up() - self.matched.generator_req.eth1.up() + self.matched.host1.eth0.ip_add(next(ipv4_addr)) + self.matched.host1.eth1.ip_add(next(ipv4_addr)) + self.matched.host1.eth0.up() + self.matched.host1.eth1.up() self.base_dpdk_configuration(config.generator) - config.dut.host = self.matched.host_req - config.dut.nics.append(self.matched.host_req.eth0) - config.dut.nics.append(self.matched.host_req.eth1) - self.matched.host_req.eth0.up() - self.matched.host_req.eth1.up() + config.dut.host = self.matched.host2 + config.dut.nics.append(self.matched.host2.eth0) + config.dut.nics.append(self.matched.host2.eth1) + self.matched.host2.eth0.up() + self.matched.host2.eth1.up() self.host_forwarding_configuration(config.dut)