libnetwork: TestUserChain: don't manually manipulate Controller.cfg.DriverCfg
New() allows for driver-options to be passed using the config.OptionDriverConfig. Update the test to not manually mutate the controller's configuration after creating. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
ee79423124
commit
c471255153
1 changed files with 5 additions and 5 deletions
|
@ -5,6 +5,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/libnetwork/config"
|
||||
"github.com/docker/docker/libnetwork/iptables"
|
||||
"github.com/docker/docker/libnetwork/netlabel"
|
||||
"github.com/docker/docker/libnetwork/options"
|
||||
|
@ -52,15 +53,14 @@ func TestUserChain(t *testing.T) {
|
|||
defer testutils.SetupTestOSContext(t)()
|
||||
defer resetIptables(t)
|
||||
|
||||
c, err := New()
|
||||
assert.NilError(t, err)
|
||||
defer c.Stop()
|
||||
c.cfg.DriverCfg["bridge"] = map[string]interface{}{
|
||||
c, err := New(config.OptionDriverConfig("bridge", map[string]any{
|
||||
netlabel.GenericData: options.Generic{
|
||||
"EnableIPTables": tc.iptables,
|
||||
"EnableIP6Tables": tc.iptables,
|
||||
},
|
||||
}
|
||||
}))
|
||||
assert.NilError(t, err)
|
||||
defer c.Stop()
|
||||
|
||||
// init. condition, FORWARD chain empty DOCKER-USER not exist
|
||||
assert.DeepEqual(t, getRules(t, iptables.IPv4, fwdChainName), []string{"-P FORWARD ACCEPT"})
|
||||
|
|
Loading…
Reference in a new issue