Skip to content

Commit

Permalink
test: stop firewall as first operation in cockpit-machines tests
Browse files Browse the repository at this point in the history
Otherwise on fedora-35 we might get errors like:
error: internal error: Failed to apply firewall rules /usr/sbin/iptables
-w --table filter --insert LIBVIRT_INP --in-interface virbr0 --protocol
tcp --destination-port 67 --jump ACCEPT: iptables: No chain/target/match by that name.
  • Loading branch information
KKoukiou committed Sep 21, 2021
1 parent 9998141 commit adf52f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/machineslib.py
Expand Up @@ -198,6 +198,9 @@ def setUp(self):
# https://bugs.launchpad.net/ubuntu/+source/libvirt-dbus/+bug/1892757
m.execute("usermod -a -G libvirt libvirtdbus")

# we don't have configuration to open the firewall for local libvirt machines, so just stop firewalld
m.execute("systemctl stop firewalld")

self.startLibvirt()
self.addCleanup(m.execute, f"systemctl stop {self.getLibvirtServiceName()}")

Expand All @@ -216,9 +219,6 @@ def setUp(self):
# Stop all networks
self.addCleanup(m.execute, "for n in $(virsh net-list --all --name); do virsh net-destroy $n || true; done")

# we don't have configuration to open the firewall for local libvirt machines, so just stop firewalld
m.execute(f"systemctl stop firewalld; systemctl reset-failed {self.getLibvirtServiceName()}; systemctl try-restart {self.getLibvirtServiceName()}")

# user libvirtd instance tends to SIGABRT with "Failed to find user record for uid .." on shutdown during cleanup
# so make sure that there are no leftover user processes that bleed into the next test
self.addCleanup(self.machine.execute, '''pkill -u admin; while [ -n "$(pgrep -au admin | grep -v 'systemd --user')" ]; do sleep 0.5; done''')
Expand Down

0 comments on commit adf52f4

Please sign in to comment.