Rewrite TestBuildCopyEtcToRoot to not use fixtures

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Alexandr Morozov 2014-10-14 10:32:00 -07:00
parent 6582ea574c
commit c8a5d56fd7
2 changed files with 12 additions and 7 deletions

View File

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

View File

@ -810,12 +810,19 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
}
func TestBuildCopyEtcToRoot(t *testing.T) {
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestCopy")
if out, _, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testcopyimg", "EtcToRoot"); err != nil {
t.Fatalf("build failed to complete: %s, %v", out, err)
name := "testcopyetctoroot"
defer deleteImages(name)
ctx, err := fakeContext(`FROM scratch
COPY . /`,
map[string]string{
"etc/test_file": "test1",
})
if err != nil {
t.Fatal(err)
}
if _, err := buildImageFromContext(name, ctx, true); err != nil {
t.Fatal(err)
}
deleteImages("testcopyimg")
logDone("build - copy etc directory to root")
}