(t *testing.T, d *daemon.Daemon, kept, pruned []string)
| 31 | } |
| 32 | |
| 33 | func pruneNetworkAndVerify(t *testing.T, d *daemon.Daemon, kept, pruned []string) { |
| 34 | _, err := d.Cmd("network", "prune", "--force") |
| 35 | assert.NilError(t, err) |
| 36 | |
| 37 | for _, s := range kept { |
| 38 | poll.WaitOn(t, pollCheck(t, func(*testing.T) (any, string) { |
| 39 | out, err := d.Cmd("network", "ls", "--format", "{{.Name}}") |
| 40 | assert.NilError(t, err) |
| 41 | return out, "" |
| 42 | }, checker.Contains(s)), poll.WithTimeout(defaultReconciliationTimeout)) |
| 43 | } |
| 44 | |
| 45 | for _, s := range pruned { |
| 46 | poll.WaitOn(t, pollCheck(t, func(*testing.T) (any, string) { |
| 47 | out, err := d.Cmd("network", "ls", "--format", "{{.Name}}") |
| 48 | assert.NilError(t, err) |
| 49 | return out, "" |
| 50 | }, checker.Not(checker.Contains(s))), poll.WithTimeout(defaultReconciliationTimeout)) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | func (s *DockerSwarmSuite) TestPruneNetwork(c *testing.T) { |
| 55 | ctx := testutil.GetContext(c) |
no test coverage detected
searching dependent graphs…