Merge pull request #39844 from thaJeztah/fix_test_bashisms

Fix some bashisms/non-standard comparisons in integration tests
This commit is contained in:
Michael Crosby 2019-09-12 14:49:56 -04:00 committed by GitHub
commit 9f08135e02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 14 deletions

View file

@ -4535,17 +4535,17 @@ func (s *DockerSuite) TestBuildBuildTimeArgEnv(c *testing.T) {
ARG FOO6
ARG FO10
RUN env
RUN [ "$FOO1" == "fromcmd" ]
RUN [ "$FOO2" == "" ]
RUN [ "$FOO3" == "fromenv" ]
RUN [ "$FOO4" == "fromfile" ]
RUN [ "$FOO5" == "fromcmd" ]
RUN [ "$FOO1" = "fromcmd" ]
RUN [ "$FOO2" = "" ]
RUN [ "$FOO3" = "fromenv" ]
RUN [ "$FOO4" = "fromfile" ]
RUN [ "$FOO5" = "fromcmd" ]
# The following should not exist at all in the env
RUN [ "$(env | grep FOO6)" == "" ]
RUN [ "$(env | grep FOO7)" == "" ]
RUN [ "$(env | grep FOO8)" == "" ]
RUN [ "$(env | grep FOO9)" == "" ]
RUN [ "$FO10" == "" ]
RUN [ "$(env | grep FOO6)" = "" ]
RUN [ "$(env | grep FOO7)" = "" ]
RUN [ "$(env | grep FOO8)" = "" ]
RUN [ "$(env | grep FOO9)" = "" ]
RUN [ "$FO10" = "" ]
`
result := buildImage("testbuildtimeargenv",
cli.WithFlags(
@ -4615,9 +4615,9 @@ func (s *DockerSuite) TestBuildBuildTimeArgEmptyValVariants(c *testing.T) {
ARG %s=
ARG %s=""
ARG %s=''
RUN [ "$%s" == "$%s" ]
RUN [ "$%s" == "$%s" ]
RUN [ "$%s" == "$%s" ]`, envKey, envKey1, envKey2, envKey, envKey1, envKey1, envKey2, envKey, envKey2)
RUN [ "$%s" = "$%s" ]
RUN [ "$%s" = "$%s" ]
RUN [ "$%s" = "$%s" ]`, envKey, envKey1, envKey2, envKey, envKey1, envKey1, envKey2, envKey, envKey2)
buildImageSuccessfully(c, imgName, build.WithDockerfile(dockerfile))
}

View file

@ -100,7 +100,7 @@ func TestBuildSquashParent(t *testing.T) {
)
container.Run(ctx, t, client,
container.WithImage(name),
container.WithCmd("/bin/sh", "-c", `[ "$(echo $HELLO)" == "world" ]`),
container.WithCmd("/bin/sh", "-c", `[ "$(echo $HELLO)" = "world" ]`),
)
origHistory, err := client.ImageHistory(ctx, origID)