Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit d8cf492

Browse files
committed
integration-cli: add daemon.StartNodeWithBusybox function
Starting the daemon should not load the busybox image again in most cases, so add a new `StartNodeWithBusybox` function to be clear that this one loads the busybox image, and use `StartNode()` for cases where loading the busybox image is not needed. Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit ead3f4e7c8b7add7beb2de44649b38f41947180f) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: c2b84fd0e87679e2d541d386ebe3252d733d0dca Component: engine
1 parent 9419e62 commit d8cf492

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

components/engine/integration-cli/check_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func (s *DockerSwarmSuite) AddDaemon(c *check.C, joinSwarm, manager bool) *daemo
333333
d.StartAndSwarmInit(c)
334334
}
335335
} else {
336-
d.StartNode(c)
336+
d.StartNodeWithBusybox(c)
337337
}
338338

339339
s.daemonsLock.Lock()

components/engine/internal/test/daemon/swarm.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,19 @@ var (
2020
startArgs = []string{"--iptables=false", "--swarm-default-advertise-addr=lo"}
2121
)
2222

23-
// StartNode starts daemon to be used as a swarm node
23+
// StartNode (re)starts the daemon
2424
func (d *Daemon) StartNode(t testingT) {
2525
if ht, ok := t.(test.HelperT); ok {
2626
ht.Helper()
2727
}
28-
// avoid networking conflicts
28+
d.Start(t, startArgs...)
29+
}
30+
31+
// StartNodeWithBusybox starts daemon to be used as a swarm node, and loads the busybox image
32+
func (d *Daemon) StartNodeWithBusybox(t testingT) {
33+
if ht, ok := t.(test.HelperT); ok {
34+
ht.Helper()
35+
}
2936
d.StartWithBusybox(t, startArgs...)
3037
}
3138

@@ -41,7 +48,7 @@ func (d *Daemon) RestartNode(t testingT) {
4148

4249
// StartAndSwarmInit starts the daemon (with busybox) and init the swarm
4350
func (d *Daemon) StartAndSwarmInit(t testingT) {
44-
d.StartNode(t)
51+
d.StartNodeWithBusybox(t)
4552
d.SwarmInit(t, swarm.InitRequest{})
4653
}
4754

@@ -50,7 +57,7 @@ func (d *Daemon) StartAndSwarmJoin(t testingT, leader *Daemon, manager bool) {
5057
if th, ok := t.(test.HelperT); ok {
5158
th.Helper()
5259
}
53-
d.StartNode(t)
60+
d.StartNodeWithBusybox(t)
5461

5562
tokens := leader.JoinTokens(t)
5663
token := tokens.Worker

0 commit comments

Comments
 (0)