Skip to content

Commit

Permalink
Add CentOS Stream to distro util
Browse files Browse the repository at this point in the history
Reference: #5667
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja committed Dec 14, 2023
1 parent 375d035 commit 1c5f351
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion avocado/utils/distro.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def get_distro(self):
self.score += 1

if self.check_release():
release = self.release()
release = self.release() or UNKNOWN_DISTRO_RELEASE
self.score += 1

if self.session:
Expand Down Expand Up @@ -348,6 +348,18 @@ class CentosProbe(RedHatProbe):
CHECK_VERSION_REGEX = re.compile(r"CentOS.* release (\d{1,2})\.(\d{1,2}).*")


class CentosStreamProbe(RedHatProbe):

"""
Probe with version checks for CentOS Stream systems
"""

CHECK_FILE = "/etc/redhat-release"
CHECK_FILE_CONTAINS = "CentOS Stream"
CHECK_FILE_DISTRO_NAME = "centos-stream"
CHECK_VERSION_REGEX = re.compile(r"CentOS Stream release (\d{1,2})\.?(\d{1,2})?")


class FedoraProbe(RedHatProbe):

"""
Expand Down Expand Up @@ -480,6 +492,7 @@ def register_probe(probe_class):

register_probe(RedHatProbe)
register_probe(CentosProbe)
register_probe(CentosStreamProbe)
register_probe(FedoraProbe)
register_probe(AmazonLinuxProbe)
register_probe(DebianProbe)
Expand Down

0 comments on commit 1c5f351

Please sign in to comment.