diff options
Diffstat (limited to 'internal')
-rw-r--r-- | internal/test/daemon/daemon.go | 1 | ||||
-rw-r--r-- | internal/test/daemon/ops.go | 7 | ||||
-rw-r--r-- | internal/test/daemon/swarm.go | 3 |
3 files changed, 11 insertions, 0 deletions
diff --git a/internal/test/daemon/daemon.go b/internal/test/daemon/daemon.go index 7471d1093b..fb970e095c 100644 --- a/internal/test/daemon/daemon.go +++ b/internal/test/daemon/daemon.go @@ -76,6 +76,7 @@ type Daemon struct { SwarmPort int // FIXME(vdemeester) should probably not be exported DefaultAddrPool []string SubnetSize uint32 + DataPathPort uint32 // cached information CachedInfo types.Info } diff --git a/internal/test/daemon/ops.go b/internal/test/daemon/ops.go index 4154a77977..ff8cd88946 100644 --- a/internal/test/daemon/ops.go +++ b/internal/test/daemon/ops.go @@ -48,6 +48,13 @@ func WithSwarmDefaultAddrPoolSubnetSize(subnetSize uint32) func(*Daemon) { } } +// WithSwarmDataPathPort sets the swarm datapath port to use for swarm mode +func WithSwarmDataPathPort(datapathPort uint32) func(*Daemon) { + return func(d *Daemon) { + d.DataPathPort = datapathPort + } +} + // WithEnvironment sets options from internal/test/environment.Execution struct func WithEnvironment(e environment.Execution) func(*Daemon) { return func(d *Daemon) { diff --git a/internal/test/daemon/swarm.go b/internal/test/daemon/swarm.go index 92ef856640..e500fe0fdc 100644 --- a/internal/test/daemon/swarm.go +++ b/internal/test/daemon/swarm.go @@ -85,6 +85,9 @@ func (d *Daemon) SwarmInit(t assert.TestingT, req swarm.InitRequest) { req.DefaultAddrPool = d.DefaultAddrPool req.SubnetSize = d.SubnetSize } + if d.DataPathPort > 0 { + req.DataPathPort = d.DataPathPort + } cli := d.NewClientT(t) defer cli.Close() _, err := cli.SwarmInit(context.Background(), req) |