From 758d2530d3739b6187cbc338b4d7e7c24266972f Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Wed, 18 Jan 2023 17:00:59 +0100 Subject: [PATCH] test: test ignore MAC Address on restore feature 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 --- test/check-application | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/check-application b/test/check-application index 15d93e238..08a5a98b1 100755 --- a/test/check-application +++ b/test/check-application @@ -1218,7 +1218,8 @@ class TestApplication(testlib.MachineCase): self.filter_containers('all') # Run a container - self.execute(True, "podman run -dit --name swamped-crate --stop-timeout 0 busybox:latest sh; podman stop swamped-crate") + mac_address = '92:d0:c6:0a:29:38' + self.execute(True, f"podman run -dit --mac-address {mac_address} --name swamped-crate --stop-timeout 0 busybox:latest sh; podman stop swamped-crate") b.wait(lambda: self.execute(True, "podman ps --all | grep -e swamped-crate -e Exited")) # Check that the restore option is not present (i.e. start is a regular button) @@ -1257,6 +1258,12 @@ 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 + 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: + self.assertNotEqual(self.execute(True, "podman inspect --format '{{.NetworkSettings.MacAddress}}' swamped-crate").strip(), mac_address) + # Checkpoint the container without stopping self.waitContainerRow("swamped-crate") self.performContainerAction("swamped-crate", "Checkpoint")