Skip to content

Commit

Permalink
test: parameterize expected kernel and platform on Debian bullseye (d…
Browse files Browse the repository at this point in the history
…efault) versus buster
  • Loading branch information
cfm committed Jun 17, 2022
1 parent c6c62d0 commit 0fdbed4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/test_vms_exist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
from base import WANTED_VMS


EXPECTED_KERNEL_VERSION = "4.14.241-grsec-workstation"

DEBIAN_VERSION = "bullseye"
EXPECTED_KERNEL_VERSION = "5.15.41-grsec-workstation"
with open("/etc/qubes-release") as qubes_release:
if "R4.0" in qubes_release.read():
DEBIAN_VERSION = "buster"
EXPECTED_KERNEL_VERSION = "4.14.241-grsec-workstation"


class SD_VM_Tests(unittest.TestCase):
Expand Down
17 changes: 9 additions & 8 deletions tests/test_vms_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
from base import WANTED_VMS, CURRENT_FEDORA_TEMPLATE


BULLSEYE_STRING = "Debian GNU/Linux 11 (bullseye)"
BUSTER_STRING = "Debian GNU/Linux 10 (buster)"

SUPPORTED_SD_PLATFORMS = [BULLSEYE_STRING]
with open("/etc/qubes-release") as qubes_release:
if "R4.1" in qubes_release.read():
SUPPORTED_SD_PLATFORMS = ["Debian GNU/Linux 11 (bullseye)"]
else:
SUPPORTED_SD_PLATFORMS = ["Debian GNU/Linux 10 (buster)"]
if "R4.0" in qubes_release.read():
SUPPORTED_SD_PLATFORMS = [BUSTER_STRING]

SUPPORTED_WHONIX_PLATFORMS = ["Debian GNU/Linux 11 (bullseye)"]
SUPPORTED_WHONIX_PLATFORMS = [BULLSEYE_STRING]


apt_url = ""
Expand All @@ -29,10 +31,9 @@ def setUp(self):
if "environment" not in config:
config["environment"] = "dev"

if "buster" in SUPPORTED_SD_PLATFORMS:
dist = "bullseye"
if BUSTER_STRING in SUPPORTED_SD_PLATFORMS:
dist = "buster"
elif "bullseye" in SUPPORTED_SD_PLATFORMS:
dist = "bullseye"

if config["environment"] == "prod":
self.apt_url = FPF_APT_SOURCES.format(dist=dist, component="main")
Expand Down

0 comments on commit 0fdbed4

Please sign in to comment.