Skip to content

Commit

Permalink
Recipes.ENRT.PvPRecipes: HostReq consistency in hostids
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
olichtne committed Feb 6, 2024
1 parent d274332 commit 2d15587
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
50 changes: 25 additions & 25 deletions lnst/Recipes/ENRT/OvS_DPDK_PvP.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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 = []
Expand Down
60 changes: 30 additions & 30 deletions lnst/Recipes/ENRT/VhostNetPvPRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 2d15587

Please sign in to comment.