Rewrite TestBuildCopyEtcToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
parent
6582ea574c
commit
c8a5d56fd7
|
@ -1,2 +0,0 @@
|
||||||
FROM scratch
|
|
||||||
COPY . /
|
|
|
@ -810,12 +810,19 @@ RUN [ $(ls -l /exists | awk '{print $3":"$4}') = 'dockerio:dockerio' ]`,
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestBuildCopyEtcToRoot(t *testing.T) {
|
func TestBuildCopyEtcToRoot(t *testing.T) {
|
||||||
buildDirectory := filepath.Join(workingDirectory, "build_tests", "TestCopy")
|
name := "testcopyetctoroot"
|
||||||
if out, _, err := dockerCmdInDir(t, buildDirectory, "build", "-t", "testcopyimg", "EtcToRoot"); err != nil {
|
defer deleteImages(name)
|
||||||
t.Fatalf("build failed to complete: %s, %v", out, err)
|
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")
|
logDone("build - copy etc directory to root")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue