mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
integration-cli: DockerRegistrySuite: replace dockerCmd
Also renaming vars that collided with package-level vars and using consts for fixed values. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"regexp"
|
||||
@@ -80,7 +79,7 @@ func (s *DockerRegistrySuite) TestUserAgentPassThrough(c *testing.T) {
|
||||
defer reg.Close()
|
||||
|
||||
registerUserAgentHandler(reg, &ua)
|
||||
repoName := fmt.Sprintf("%s/busybox", reg.URL())
|
||||
imgRepo := reg.URL() + "/busybox"
|
||||
|
||||
s.d.StartWithBusybox(ctx, c, "--insecure-registry", reg.URL())
|
||||
|
||||
@@ -88,7 +87,7 @@ func (s *DockerRegistrySuite) TestUserAgentPassThrough(c *testing.T) {
|
||||
assert.NilError(c, err)
|
||||
defer os.RemoveAll(tmp)
|
||||
|
||||
dockerfile, err := makefile(tmp, fmt.Sprintf("FROM %s", repoName))
|
||||
dockerfile, err := makefile(tmp, "FROM "+imgRepo)
|
||||
assert.NilError(c, err, "Unable to create test dockerfile")
|
||||
|
||||
s.d.Cmd("build", "--file", dockerfile, tmp)
|
||||
@@ -97,10 +96,10 @@ func (s *DockerRegistrySuite) TestUserAgentPassThrough(c *testing.T) {
|
||||
s.d.Cmd("login", "-u", "richard", "-p", "testtest", reg.URL())
|
||||
regexpCheckUA(c, ua)
|
||||
|
||||
s.d.Cmd("pull", repoName)
|
||||
s.d.Cmd("pull", imgRepo)
|
||||
regexpCheckUA(c, ua)
|
||||
|
||||
s.d.Cmd("tag", "busybox", repoName)
|
||||
s.d.Cmd("push", repoName)
|
||||
s.d.Cmd("tag", "busybox", imgRepo)
|
||||
s.d.Cmd("push", imgRepo)
|
||||
regexpCheckUA(c, ua)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user