Skip to content

Commit

Permalink
Integration test copy command
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya Wadhwa committed Mar 15, 2018
1 parent 21a9207 commit 140d49d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 7 deletions.
12 changes: 12 additions & 0 deletions integration_tests/dockerfiles/Dockerfile_test_copy
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM gcr.io/distroless/base
COPY context/foo foo
COPY context/foo /foodir/
COPY context/bar/b* bar/
COPY context/fo? /foo2
COPY context/bar/doesnotexist* context/foo hello
COPY ./context/empty /empty
COPY ./ dir/
COPY . newdir
COPY context/bar /baz/
COPY ["context/foo", "/tmp/foo" ]
COPY context/b* /baz/
12 changes: 12 additions & 0 deletions integration_tests/dockerfiles/config_test_copy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"Image1": "gcr.io/kbuild-test/docker-test-copy:latest",
"Image2": "gcr.io/kbuild-test/kbuild-test-copy:latest",
"DiffType": "File",
"Diff": {
"Adds": null,
"Dels": null,
"Mods": null
}
}
]
12 changes: 6 additions & 6 deletions integration_tests/dockerfiles/config_test_run.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
"Mods": [
{
"Name": "/var/log/dpkg.log",
"Size1": 57425,
"Size2": 57425
"Size1": 57481,
"Size2": 57481
},
{
"Name": "/var/log/apt/term.log",
"Size1": 24400,
"Size2": 24400
"Size1": 24421,
"Size2": 24421
},
{
"Name": "/var/cache/ldconfig/aux-cache",
Expand All @@ -24,8 +24,8 @@
},
{
"Name": "/var/log/apt/history.log",
"Size1": 5089,
"Size2": 5089
"Size1": 5415,
"Size2": 5415
},
{
"Name": "/var/log/alternatives.log",
Expand Down
9 changes: 8 additions & 1 deletion integration_tests/integration_test_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ var tests = []struct {
context: "integration_tests/dockerfiles/",
repo: "test-run-2",
},
{
description: "test copy",
dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_copy",
configPath: "/workspace/integration_tests/dockerfiles/config_test_copy.json",
context: "/workspace/integration_tests/",
repo: "test-copy",
},
}

type step struct {
Expand Down Expand Up @@ -102,7 +109,7 @@ func main() {
kbuildImage := testRepo + kbuildPrefix + test.repo
kbuild := step{
Name: executorImage,
Args: []string{executorCommand, "--destination", kbuildImage, "--dockerfile", test.dockerfilePath},
Args: []string{executorCommand, "--destination", kbuildImage, "--dockerfile", test.dockerfilePath, "--context", test.context},
}

// Pull the kbuild image
Expand Down

0 comments on commit 140d49d

Please sign in to comment.