-
Notifications
You must be signed in to change notification settings - Fork 90
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
test: test ignore MAC Address on restore feature #1187
Conversation
I would wait until we actually test this somewhere so if it does not work then we would need to adjust it. Should not take too long |
A new podman was released last Friday, so this should be testable in rawhide today.. maybe?! |
aedb3ac
to
758d253
Compare
rawhide has:
|
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.
Thanks!
test/check-application
Outdated
# A new MAC address should have been generated | ||
version = self.execute(False, "podman -v").strip().split(' ')[-1] | ||
# Fixed in podman 4.4.0 https://github.com/containers/podman/issues/16666 | ||
if int(version.split('.')[0]) >= 4 and int(version.split('.')[1]) > 3: |
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 would fail for e. g. podman 5.0 or 5.2. I agree that right now a hardcoded m.image
list is still too early, as 4.4 will most probably enter Fedora, Debian testing, arch etc. soon. I recommend to convert version
to a tuple of ints and compare it as tuple, which works as intended. See e.g. test/verify/check-storage-resize
:
if self.storaged_version < [2, 7, 6]
758d253
to
6c9eded
Compare
Arggh ofcourse! |
6c9eded
to
6c90376
Compare
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.
Thanks, almost there!
version = cls.execute(False, "podman -v").strip().split(' ')[-1] | ||
# HACK: handle possible rc versions such as 4.4.0-rc2 | ||
return tuple(int(v.split('-')[0]) for v in version.split('.')) |
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.
If only we had a more machine readable API for determining the version. One should invent an RPC protocol over an Unix socket, and call it "data bus" or something such 🤔
(snarky comment aside -- this is ugly, but effective, thanks!)
test/check-application
Outdated
@@ -1201,6 +1208,13 @@ class TestApplication(testlib.MachineCase): | |||
b.click('.pf-c-modal-box button:contains(Restore)') | |||
b.wait(lambda: self.getContainerAttr("swamped-crate", "State") in 'Running') | |||
|
|||
# A new MAC address should have been generated | |||
# Fixed in podman 4.4.0 https://github.com/containers/podman/issues/16666 | |||
import json |
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.
Let's please keep imports at the top.
test/check-application
Outdated
# A new MAC address should have been generated | ||
# Fixed in podman 4.4.0 https://github.com/containers/podman/issues/16666 | ||
import json | ||
print(json.dumps(podman_version(self))) |
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.
Debugging leftover. But to be sure that the version comparison works, you could do an else:
below and check that the MAC address is equal.
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.
I actually think that's a neat idea! Let's test both cases.
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.
I'm a bit torn between this, as it explicitly tests a buggy behaviour. But it increases my confidence in our test 😁
This was broken in 4.0 and now fixed in 4.4 which is still an release candidate. Locally this has been tested with podman-4.4.0~rc1. Closes cockpit-project#1179
6c90376
to
107e1be
Compare
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.
Danjkewel!
This was broken in 4.0 and now fixed in 4.4 which is still an release candidate. Locally this has been tested with podman-4.4.0~rc1.
Closes #1179
Locally tested with https://koji.fedoraproject.org/koji/buildinfo?buildID=2111508 and Fedora-37