1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Rewrite TestBuildAddEtcToRoot to not use fixtures

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Alexandr Morozov 2014-09-22 21:26:51 +04:00
parent c58391bbd0
commit 570f1153b9
2 changed files with 13 additions and 10 deletions

View file

@ -1,2 +0,0 @@
FROM scratch
ADD . /

View file

@ -301,16 +301,21 @@ func TestBuildAddWholeDirToRoot(t *testing.T) {
logDone("build - add whole directory to root") logDone("build - add whole directory to root")
} }
// Testing #5941
func TestBuildAddEtcToRoot(t *testing.T) { func TestBuildAddEtcToRoot(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestAdd") name := "testaddetctoroot"
out, exitCode, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testaddimg", "EtcToRoot") defer deleteImages(name)
errorOut(err, t, fmt.Sprintf("build failed to complete: %v %v", out, err)) ctx, err := fakeContext(`FROM scratch
ADD . /`,
if err != nil || exitCode != 0 { map[string]string{
t.Fatal("failed to build the image") "etc/test_file": "test1",
})
if err != nil {
t.Fatal(err)
}
if _, err := buildImageFromContext(name, ctx, true); err != nil {
t.Fatal(err)
} }
deleteImages("testaddimg")
logDone("build - add etc directory to root") logDone("build - add etc directory to root")
} }