Skip to content

Commit

Permalink
test: Add fake default route to work around podman 5 regression
Browse files Browse the repository at this point in the history
podman 5 regressed user containers if there is no default route [1].
While that is being sorted out, add a fake interface with a default
route for our offline tests, to unbreak upstream podman PRs testing.

Same hack as in cockpit-project/cockpit-podman@cecb2cc6e8f2

[1] containers/podman#21896
  • Loading branch information
martinpitt committed Mar 11, 2024
1 parent 059856f commit 3286bcb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/verify/check-metrics
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,11 @@ class TestCurrentMetrics(testlib.MachineCase):
self.busybox_image = m.execute("podman images --format '{{.Repository}}' | grep busybox").strip()
self.login_and_go("/metrics")

# hack around https://github.com/containers/podman/issues/21896 for our offline test VMs
if not m.execute("ip route show default").strip() and "5.0" in m.execute("podman version"):
m.execute("nmcli con add type dummy con-name fake ifname fake0 ip4 1.2.3.4/24 gw4 1.2.3.1")
self.addCleanup(m.execute, "nmcli con delete fake")

def testCPU(self):
b = self.browser
m = self.machine
Expand Down

0 comments on commit 3286bcb

Please sign in to comment.