rootless: skip tests that need br-netfilter loaded

Skip tests that have recently started failing in rootless
mode with error:

failed to start daemon: Error initializing network controller:
  error creating default "bridge" network:
    cannot restrict inter-container communication or run
    without the userland proxy:
      stat /proc/sys/net/bridge/bridge-nf-call-iptables:
        no such file or directory:
          set environment variable DOCKER_IGNORE_BR_NETFILTER_ERROR=1 to ignore

(Perhaps we can ensure the module is loaded before starting
the rootless env - or work out why the failures have only
recently started, and put-back whatever changed. But, for
now, I think we need to skip.)

Signed-off-by: Rob Murray <rob.murray@docker.com>
This commit is contained in:
Rob Murray
2025-05-07 19:51:07 +01:00
parent 76adb8f5c3
commit 4c4810e5d2

View File

@@ -522,6 +522,7 @@ func TestPublishedPortAlreadyInUse(t *testing.T) {
//
// Regression test for https://github.com/moby/moby/issues/49654.
func TestAllPortMappingsAreReturned(t *testing.T) {
skip.If(t, testEnv.IsRootless, "cannot disable userland proxy in rootless netns unless br-netfilter loaded by host")
ctx := setupTest(t)
d := daemon.New(t)
@@ -617,6 +618,7 @@ func TestFirewalldReloadNoZombies(t *testing.T) {
// TestLegacyLink checks that a legacy link ("--link" in the default bridge network)
// sets up a hostname and opens ports when the daemon is running with icc=false.
func TestLegacyLink(t *testing.T) {
skip.If(t, testEnv.IsRootless, "cannot set icc=false in rootless netns unless br-netfilter loaded by host")
ctx := setupTest(t)
// Tidy up after the test by starting a new daemon, which will remove the icc=false
@@ -693,6 +695,7 @@ func TestLegacyLink(t *testing.T) {
//
// Replacement for DockerDaemonSuite/TestDaemonLinksIpTablesRulesWhenLinkAndUnlink
func TestRemoveLegacyLink(t *testing.T) {
skip.If(t, testEnv.IsRootless, "cannot set icc=false in rootless netns unless br-netfilter loaded by host")
ctx := setupTest(t)
// Tidy up after the test by starting a new daemon, which will remove the icc=false