Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipes/SRIOVNetnsOvSRecipe.py: deconfigure ovs bridge before resetti… #359

Merged
merged 2 commits into from
Feb 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lnst/Recipes/ENRT/SRIOVNetnsOvSRecipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def test_wide_configuration(self):
ipv4_addr = interface_addresses(self.params.net_ipv4)
ipv6_addr = interface_addresses(self.params.net_ipv6)

for i, host in enumerate([host1, host2]):
for host in [host1, host2]:
host.run("systemctl enable openvswitch")
host.run("systemctl start openvswitch")
host.run("ovs-vsctl set Open_vSwitch . other_config:hw-offload=true")
Expand Down Expand Up @@ -138,7 +138,7 @@ def test_wide_configuration(self):
def generate_test_wide_description(self, config: EnrtConfiguration):
desc = super().generate_test_wide_description(config)
host1, host2 = self.matched.host1, self.matched.host2
for i, host in enumerate([host1, host2]):
for host in [host1, host2]:
desc += [
f"Configured {host.hostid}.{host.eth0.name}.driver = switchdev\n"
f"Created virtual function on {host.hostid}.{host.eth0.name} = {host.newns.vf_eth0.name}\n"
Expand All @@ -160,7 +160,14 @@ def test_wide_deconfiguration(self, config):
Finally virtual function is deleted.
"""
host1, host2 = self.matched.host1, self.matched.host2
for i, host in enumerate([host1, host2]):

for host in [host1, host2]:
for dev in [host.eth0, host.vf_representor_eth0, host.br0]:
dev.down()

host.br0.port_del(host.eth0)
host.br0.port_del(host.vf_representor_eth0)

Axonis marked this conversation as resolved.
Show resolved Hide resolved
host.run(f"echo 0 > /sys/class/net/{host.eth0.name}/device/sriov_numvfs")
time.sleep(2)
host.run(f"devlink dev eswitch set pci/{host.eth0.bus_info} mode legacy")
Expand Down
Loading