(ctx context.Context, t *testing.T, joinSwarm, manager bool)
| 587 | } |
| 588 | |
| 589 | func (s *DockerSwarmSuite) AddDaemon(ctx context.Context, t *testing.T, joinSwarm, manager bool) *daemon.Daemon { |
| 590 | t.Helper() |
| 591 | d := daemon.New(t, dockerBinary, dockerdBinary, |
| 592 | testdaemon.WithEnvironment(testEnv.Execution), |
| 593 | testdaemon.WithSwarmPort(defaultSwarmPort+s.portIndex), |
| 594 | ) |
| 595 | if joinSwarm { |
| 596 | if len(s.daemons) > 0 { |
| 597 | d.StartAndSwarmJoin(ctx, t, s.daemons[0].Daemon, manager) |
| 598 | } else { |
| 599 | d.StartAndSwarmInit(ctx, t) |
| 600 | } |
| 601 | } else { |
| 602 | d.StartNodeWithBusybox(ctx, t) |
| 603 | } |
| 604 | |
| 605 | s.daemonsLock.Lock() |
| 606 | s.portIndex++ |
| 607 | s.daemons = append(s.daemons, d) |
| 608 | s.daemonsLock.Unlock() |
| 609 | |
| 610 | return d |
| 611 | } |
| 612 | |
| 613 | func (s *DockerSwarmSuite) TearDownTest(ctx context.Context, t *testing.T) { |
| 614 | testRequires(t, DaemonIsLinux) |
no test coverage detected