mirror of
https://github.com/moby/moby.git
synced 2026-08-09 01:21:37 +00:00
fix thelper linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -31,38 +31,38 @@ func newDockerHubPullSuite() *DockerHubPullSuite {
|
||||
}
|
||||
|
||||
// SetUpSuite starts the suite daemon.
|
||||
func (s *DockerHubPullSuite) SetUpSuite(ctx context.Context, c *testing.T) {
|
||||
testRequires(c, DaemonIsLinux, testEnv.IsLocalDaemon)
|
||||
s.d = daemon.New(c, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
|
||||
s.d.Start(c)
|
||||
func (s *DockerHubPullSuite) SetUpSuite(ctx context.Context, t *testing.T) {
|
||||
testRequires(t, DaemonIsLinux, testEnv.IsLocalDaemon)
|
||||
s.d = daemon.New(t, dockerBinary, dockerdBinary, testdaemon.WithEnvironment(testEnv.Execution))
|
||||
s.d.Start(t)
|
||||
}
|
||||
|
||||
// TearDownSuite stops the suite daemon.
|
||||
func (s *DockerHubPullSuite) TearDownSuite(ctx context.Context, c *testing.T) {
|
||||
func (s *DockerHubPullSuite) TearDownSuite(ctx context.Context, t *testing.T) {
|
||||
if s.d != nil {
|
||||
s.d.Stop(c)
|
||||
s.d.Stop(t)
|
||||
}
|
||||
}
|
||||
|
||||
// SetUpTest declares that all tests of this suite require network.
|
||||
func (s *DockerHubPullSuite) SetUpTest(ctx context.Context, c *testing.T) {
|
||||
testRequires(c, Network)
|
||||
func (s *DockerHubPullSuite) SetUpTest(ctx context.Context, t *testing.T) {
|
||||
testRequires(t, Network)
|
||||
}
|
||||
|
||||
// TearDownTest removes all images from the suite daemon.
|
||||
func (s *DockerHubPullSuite) TearDownTest(ctx context.Context, c *testing.T) {
|
||||
out := s.Cmd(c, "images", "-aq")
|
||||
func (s *DockerHubPullSuite) TearDownTest(ctx context.Context, t *testing.T) {
|
||||
out := s.Cmd(t, "images", "-aq")
|
||||
images := strings.Split(out, "\n")
|
||||
images = append([]string{"rmi", "-f"}, images...)
|
||||
s.d.Cmd(images...)
|
||||
s.ds.TearDownTest(ctx, c)
|
||||
s.ds.TearDownTest(ctx, t)
|
||||
}
|
||||
|
||||
// Cmd executes a command against the suite daemon and returns the combined
|
||||
// output. The function fails the test when the command returns an error.
|
||||
func (s *DockerHubPullSuite) Cmd(c *testing.T, name string, arg ...string) string {
|
||||
func (s *DockerHubPullSuite) Cmd(t *testing.T, name string, arg ...string) string {
|
||||
out, err := s.CmdWithError(name, arg...)
|
||||
assert.Assert(c, err == nil, "%q failed with errors: %s, %v", strings.Join(arg, " "), out, err)
|
||||
assert.Assert(t, err == nil, "%q failed with errors: %s, %v", strings.Join(arg, " "), out, err)
|
||||
return out
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user