test/e2e: use custom network config dir where needed

Since commit f250560a8043 the play kube command uses its own network.
this is racy be design because we create the network followed by
creating/running pod/containers. This means in the meantime another
prune or reset process could wipe out the network config because we have
to share the network config directory by design in the test.

The problem is we only have one host netns which is shared between
tests. If the network config dir is not shared we cannot make conflict
checks for interface names and ip address. This results in different
tests trying to use the same interface and/or ip address which will
cause runtime failures in CNI and netavark.

The only solution I see is to make sure only the reset/prune tests are
using a custom network dir. This makes sure they do not wipe configs
that are otherwise required by other parallel running tests.

Fixes #17946

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2023-04-06 16:08:50 +02:00
parent b39cdff8c2
commit dc9a65e348
5 changed files with 24 additions and 20 deletions

View File

@ -36,10 +36,7 @@ var _ = Describe("podman system reset", func() {
It("podman system reset", func() {
SkipIfRemote("system reset not supported on podman --remote")
// system reset will not remove additional store images, so need to grab length
// change the network dir so that we do not conflict with other tests
// that would use the same network dir and cause unnecessary flakes
podmanTest.NetworkConfigDir = tempdir
useCustomNetworkDir(podmanTest, tempdir)
session := podmanTest.Podman([]string{"rmi", "--force", "--all"})
session.WaitWithDefaultTimeout()