зеркало из https://github.com/microsoft/docker.git
Rewrite TestBuildCopyEtcToRoot to not use fixtures
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
This commit is contained in:
Родитель
6582ea574c
Коммит
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) {
|
||||
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")
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче