mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add --target
name case sensitive test code for multi-stage build
Add testing code to cover the `--target` name case sensitive issue reported by issue #36956. Signed-off-by: Dennis Chen <dennis.chen@arm.com>
This commit is contained in:
parent
7c0570473c
commit
a95fabc70e
1 changed files with 7 additions and 1 deletions
|
@ -5965,10 +5965,16 @@ func (s *DockerSuite) TestBuildIntermediateTarget(c *check.C) {
|
|||
cli.BuildCmd(c, "build1", build.WithExternalBuildContext(ctx),
|
||||
cli.WithFlags("--target", "build-env"))
|
||||
|
||||
//res := inspectFieldJSON(c, "build1", "Config.Cmd")
|
||||
res := cli.InspectCmd(c, "build1", cli.Format("json .Config.Cmd")).Combined()
|
||||
c.Assert(strings.TrimSpace(res), checker.Equals, `["/dev"]`)
|
||||
|
||||
// Stage name is case-insensitive by design
|
||||
cli.BuildCmd(c, "build1", build.WithExternalBuildContext(ctx),
|
||||
cli.WithFlags("--target", "BUIld-EnV"))
|
||||
|
||||
res = cli.InspectCmd(c, "build1", cli.Format("json .Config.Cmd")).Combined()
|
||||
c.Assert(strings.TrimSpace(res), checker.Equals, `["/dev"]`)
|
||||
|
||||
result := cli.Docker(cli.Build("build1"), build.WithExternalBuildContext(ctx),
|
||||
cli.WithFlags("--target", "nosuchtarget"))
|
||||
result.Assert(c, icmd.Expected{
|
||||
|
|
Loading…
Reference in a new issue