Skip to content

Commit

Permalink
tests: invert the conditions for checking modular vs monolithic daemo…
Browse files Browse the repository at this point in the history
…n distro

We should have a list that shrinks - not grows.
  • Loading branch information
KKoukiou committed Nov 11, 2021
1 parent 2e64f3a commit 797235e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/machineslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from netlib import NetworkHelpers
from storagelib import StorageHelpers

distrosWithMonolithicDaemon = ["fedora-34", "rhel-8-4", "rhel-8-5", "rhel-8-6", "ubuntu-stable", "ubuntu-2004", "debian-testing", "debian-stable", "centos-8-stream", "arch"]


class VirtualMachinesCaseHelpers:
created_pool = False
Expand Down Expand Up @@ -92,7 +94,7 @@ def getDomainMacAddress(self, vmName):
def getLibvirtServiceName(self):
m = self.machine

if m.image in ["fedora-35", "rhel-9-0"]:
if m.image not in distrosWithMonolithicDaemon:
return "virtqemud"
else:
return "libvirtd"
Expand All @@ -101,7 +103,7 @@ def startLibvirt(self, m):

# Ensure everything has started correctly
m.execute(f"systemctl start {self.getLibvirtServiceName()}.service")
if m.image in ["fedora-35", "rhel-9-0"]:
if m.image not in distrosWithMonolithicDaemon:
# HACK for missing deps on virtlockd/virtlogd sockets - needed till f-35 uses libvirt v7.7.0
# https://github.com/libvirt/libvirt/commit/88c5b9f827779ae6fe5a6f08100a4b6184492a1c
m.execute("systemctl start virtlockd.socket && systemctl start virtlogd.socket")
Expand Down Expand Up @@ -218,7 +220,7 @@ def setUp(self):

self.startLibvirt(m)
self.addCleanup(m.execute, f"systemctl stop {self.getLibvirtServiceName()}")
if m.image in ["fedora-35", "rhel-9-0"]:
if m.image not in distrosWithMonolithicDaemon:
self.addCleanup(m.execute, "systemctl stop virtstoraged.service virtnetworkd.service")

# Stop all domains
Expand Down Expand Up @@ -252,7 +254,7 @@ def setUp(self):
self.addCleanup(m.execute, cmd)

# we don't have configuration to open the firewall for local libvirt machines, so just stop firewalld
if m.image in ["fedora-35", "rhel-9-0"]:
if m.image not in distrosWithMonolithicDaemon:
m.execute("systemctl stop firewalld; systemctl reset-failed virtnetworkd; systemctl try-restart virtnetworkd")
else:
m.execute("systemctl stop firewalld; systemctl reset-failed libvirtd; systemctl try-restart libvirtd")
Expand Down

0 comments on commit 797235e

Please sign in to comment.