mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
intgration-cli: fix formatting
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit cc01289792
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
cf50c5bba8
commit
d98c74d38d
5 changed files with 12 additions and 67 deletions
|
@ -1064,12 +1064,7 @@ func (s *DockerSuite) TestContainerAPICopyResourcePathEmptyPre124(c *testing.T)
|
||||||
}
|
}
|
||||||
b, err := request.ReadBody(body)
|
b, err := request.ReadBody(body)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
assert.Assert(c, is.Regexp("^"+
|
assert.Assert(c, is.Regexp("^Path cannot be empty\n$", string(b)))
|
||||||
|
|
||||||
"Path cannot be empty\n"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
string(b)))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1091,12 +1086,7 @@ func (s *DockerSuite) TestContainerAPICopyResourcePathNotFoundPre124(c *testing.
|
||||||
}
|
}
|
||||||
b, err := request.ReadBody(body)
|
b, err := request.ReadBody(body)
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
assert.Assert(c, is.Regexp("^"+
|
assert.Assert(c, is.Regexp("^Could not find the file /notexist in container "+name+"\n$", string(b)))
|
||||||
|
|
||||||
("Could not find the file /notexist in container "+name+"\n")+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
string(b)))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4799,12 +4799,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
|
||||||
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
||||||
|
|
||||||
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
|
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^bar$", out))
|
||||||
|
|
||||||
"bar"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
// change target file should invalidate cache
|
// change target file should invalidate cache
|
||||||
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo"), []byte("baz"), 0644)
|
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo"), []byte("baz"), 0644)
|
||||||
|
@ -4813,12 +4808,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToFile(c *testing.T) {
|
||||||
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
||||||
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
||||||
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
|
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "target").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^baz$", out))
|
||||||
|
|
||||||
"baz"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4840,12 +4830,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
|
||||||
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
||||||
|
|
||||||
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^barbaz$", out))
|
||||||
|
|
||||||
"barbaz"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
// change target file should invalidate cache
|
// change target file should invalidate cache
|
||||||
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo/def"), []byte("bax"), 0644)
|
err = ioutil.WriteFile(filepath.Join(ctx.Dir, "foo/def"), []byte("bax"), 0644)
|
||||||
|
@ -4854,12 +4839,7 @@ func (s *DockerSuite) TestBuildFollowSymlinkToDir(c *testing.T) {
|
||||||
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
result := cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
||||||
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
assert.Assert(c, !strings.Contains(result.Combined(), "Using cache"))
|
||||||
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
out = cli.DockerCmd(c, "run", "--rm", name, "cat", "abc", "def").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^barbax$", out))
|
||||||
|
|
||||||
"barbax"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4882,12 +4862,7 @@ func (s *DockerSuite) TestBuildSymlinkBasename(c *testing.T) {
|
||||||
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
cli.BuildCmd(c, name, build.WithExternalBuildContext(ctx))
|
||||||
|
|
||||||
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
|
out := cli.DockerCmd(c, "run", "--rm", name, "cat", "asymlink").Combined()
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^bar$", out))
|
||||||
|
|
||||||
"bar"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,11 +115,7 @@ func (s *DockerSuite) TestHistoryHumanOptionTrue(c *testing.T) {
|
||||||
endIndex = len(lines[i])
|
endIndex = len(lines[i])
|
||||||
}
|
}
|
||||||
sizeString := lines[i][startIndex:endIndex]
|
sizeString := lines[i][startIndex:endIndex]
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^"+humanSizeRegexRaw+"$",
|
||||||
|
|
||||||
humanSizeRegexRaw+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
strings.TrimSpace(sizeString)), fmt.Sprintf("The size '%s' was not in human format", sizeString))
|
strings.TrimSpace(sizeString)), fmt.Sprintf("The size '%s' was not in human format", sizeString))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,21 +90,11 @@ func (s *DockerSuite) TestImagesFilterLabelMatch(c *testing.T) {
|
||||||
|
|
||||||
out, _ := dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match")
|
out, _ := dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match")
|
||||||
out = strings.TrimSpace(out)
|
out = strings.TrimSpace(out)
|
||||||
assert.Assert(c, is.Regexp("^"+
|
assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image1ID), out))
|
||||||
|
|
||||||
fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image1ID)+
|
assert.Assert(c, is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image2ID), out))
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
assert.Assert(c, !is.Regexp(fmt.Sprintf("^[\\s\\w:]*%s[\\s\\w:]*$", image3ID), out)().Success())
|
||||||
|
|
||||||
assert.Assert(c, is.Regexp("^"+
|
|
||||||
|
|
||||||
fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image2ID)+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
assert.Assert(c, !is.Regexp("^"+fmt.Sprintf("[\\s\\w:]*%s[\\s\\w:]*", image3ID)+"$", out)().Success())
|
|
||||||
|
|
||||||
out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
|
out, _ = dockerCmd(c, "images", "--no-trunc", "-q", "-f", "label=match=me too")
|
||||||
out = strings.TrimSpace(out)
|
out = strings.TrimSpace(out)
|
||||||
|
|
|
@ -229,13 +229,7 @@ func (s *DockerSuite) TestLinksEtcHostsRegularFile(c *testing.T) {
|
||||||
testRequires(c, DaemonIsLinux, NotUserNamespace)
|
testRequires(c, DaemonIsLinux, NotUserNamespace)
|
||||||
out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
|
out, _ := dockerCmd(c, "run", "--net=host", "busybox", "ls", "-la", "/etc/hosts")
|
||||||
// /etc/hosts should be a regular file
|
// /etc/hosts should be a regular file
|
||||||
assert.Assert(c, cmp.Regexp("^"+
|
assert.Assert(c, cmp.Regexp("^-.+\n$", out))
|
||||||
|
|
||||||
"^-.+\n"+
|
|
||||||
"$",
|
|
||||||
|
|
||||||
out))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *DockerSuite) TestLinksMultipleWithSameName(c *testing.T) {
|
func (s *DockerSuite) TestLinksMultipleWithSameName(c *testing.T) {
|
||||||
|
|
Loading…
Reference in a new issue