Skip to content

Commit

Permalink
feature(distro): add rock9 support
Browse files Browse the repository at this point in the history
Rocky Linux 9 was recently released and we want to start testing it

Ref: https://rockylinux.org/news/rocky-linux-9-0-ga-release/
Ref: https://gcloud-compute.com/images.html
  • Loading branch information
fruch committed Apr 17, 2023
1 parent 0fb81b8 commit 6d07b61
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,8 @@ def install_scylla(self, scylla_repo):
self.log.info("Installing Scylla...")
if self.is_rhel_like():
# `screen' package is missed in CentOS/RHEL 8. Should be installed from EPEL repository.
if self.distro.is_centos8 or self.distro.is_rhel8 or self.distro.is_oel8 or self.distro.is_rocky8:
if (self.distro.is_centos8 or self.distro.is_rhel8 or self.distro.is_oel8 or self.distro.is_rocky8 or
self.distro.is_rocky9):
self.install_epel()
self.remoter.run("sudo yum remove -y abrt") # https://docs.scylladb.com/operating-scylla/admin/#core-dumps
self.remoter.run('sudo yum install -y rsync tcpdump screen')
Expand Down Expand Up @@ -4389,7 +4390,7 @@ def scylla_configure_non_root_installation(self, node, devname, verbose, timeout

def node_setup(self, node: BaseNode, verbose: bool = False, timeout: int = 3600): # pylint: disable=too-many-branches,too-many-statements
node.wait_ssh_up(verbose=verbose, timeout=timeout)
if node.distro.is_centos8 or node.distro.is_rhel8 or node.distro.is_oel8 or node.distro.is_rocky8:
if node.distro.is_centos8 or node.distro.is_rhel8 or node.distro.is_oel8 or node.distro.is_rocky8 or node.distro.is_rocky9:
node.remoter.sudo('systemctl stop iptables', ignore_status=True)
node.remoter.sudo('systemctl disable iptables', ignore_status=True)
node.remoter.sudo('systemctl stop firewalld', ignore_status=True)
Expand Down
1 change: 1 addition & 0 deletions sdcm/mgmt/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def get_distro_name(distro_object):
Distro.OEL7: "centos7",
Distro.OEL8: "centos8",
Distro.ROCKY8: "centos8",
Distro.ROCKY9: "centos8",
Distro.FEDORA34: "centos8",
Distro.FEDORA35: "centos8",
Distro.FEDORA36: "centos8",
Expand Down
2 changes: 1 addition & 1 deletion sdcm/utils/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DistroBase(enum.Enum):
("RHEL", "rhel", ["7", "8"], DistroBase.RHEL),
("OEL", "ol", ["7", "8"], DistroBase.RHEL),
("AMAZON", "amzn", ["2"], DistroBase.RHEL),
("ROCKY", "rocky", ["8"], DistroBase.RHEL),
("ROCKY", "rocky", ["8", "9"], DistroBase.RHEL),
("DEBIAN", "debian", ["8", "9", "10", "11"], DistroBase.DEBIAN),
("UBUNTU", "ubuntu", ["14.04", "16.04", "18.04", "20.04", "21.04", "21.10", "22.04"], DistroBase.DEBIAN),
("SLES", "sles", ["15"], DistroBase.UNKNOWN),
Expand Down
26 changes: 25 additions & 1 deletion unit_tests/test_utils_distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,24 @@
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
""",
"Rocky Linux 9": """\
NAME="Rocky Linux"
VERSION="9.0 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.0"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.0 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.0"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.0"
""",

"Unknown": """\
Expand All @@ -292,7 +310,7 @@
}


class TestDistro(unittest.TestCase):
class TestDistro(unittest.TestCase): # pylint: disable=too-many-public-methods
def test_unknown(self):
self.assertTrue(Distro.UNKNOWN.is_unknown)
distro = Distro.from_os_release(DISTROS_OS_RELEASE["Unknown"])
Expand Down Expand Up @@ -400,6 +418,12 @@ def test_rocky8(self):
self.assertTrue(distro.is_rocky8)
self.assertTrue(distro.is_rhel_like)

def test_rocky9(self):
self.assertTrue(Distro.ROCKY9.is_rocky9)
distro = Distro.from_os_release(DISTROS_OS_RELEASE["Rocky Linux 9"])
self.assertTrue(distro.is_rocky9)
self.assertTrue(distro.is_rhel_like)

def test_parsing_error(self):
self.assertRaises(DistroError, Distro.from_os_release, DISTROS_OS_RELEASE["Garbage"])

Expand Down

0 comments on commit 6d07b61

Please sign in to comment.