-
Notifications
You must be signed in to change notification settings - Fork 343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CentOS Stream to distro util #5834
Conversation
Dear contributor,
As for the Avocado utility modules (“avocado.utils”) it is OK to introduce new functionality, |
avocado/utils/distro.py
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of release()
already sets the default value to UNKNOWN_DISTRO_RELEASE
. Would you care to explain why this is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed, because I used optional group (\d{1,2})?
for the release. But when I am looking at it now, I think the better place will be in self.release()
. I will send an update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @richtja ,
Thanks for this. Besides the UNKNOWN_DISTRO_RELEASE
question, it'd be nice to add a test such as:
diff --git a/selftests/functional/utils/distro.py b/selftests/functional/utils/distro.py
index be9bca03f..d11f042b4 100644
--- a/selftests/functional/utils/distro.py
+++ b/selftests/functional/utils/distro.py
@@ -53,3 +53,14 @@ class Distro(Test):
+ os.uname().machine.encode()
+ b") version 9 release 1\n",
)
+
+ def test_centos_stream_9(self):
+ """
+ :avocado: dependency={"type": "podman-image", "uri": "quay.io/centos/centos:stream9"}
+ """
+ self.run_job(
+ "quay.io/centos/centos:stream9",
+ b"Detected distribution: centos-stream ("
+ + os.uname().machine.encode()
+ + b") version 9 release 0\n"
+ )
But, as a new probe, it needs to use an egg built from the actual source code (and not use a released Avocado version). We could simply open an issue to add such a test after 103.0 is released so that we don't forget about it.
Yes you are right, I will create an issue and prepare the test. |
This commit adds Linux to the CentOS distro detection. This will be helpful for differentiating the CentOS and CentOS Streams distros. Signed-off-by: Jan Richter <[email protected]>
Reference: avocado-framework#5667 Signed-off-by: Jan Richter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Add CentOS Stream to distro util
Reference: #5667