From 140d49d5064fb1fa2aaa46cae7c687842f196dfc Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 14 Mar 2018 17:07:07 -0700 Subject: [PATCH] Integration test copy command --- integration_tests/dockerfiles/Dockerfile_test_copy | 12 ++++++++++++ integration_tests/dockerfiles/config_test_copy.json | 12 ++++++++++++ integration_tests/dockerfiles/config_test_run.json | 12 ++++++------ integration_tests/integration_test_yaml.go | 9 ++++++++- 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 integration_tests/dockerfiles/Dockerfile_test_copy create mode 100644 integration_tests/dockerfiles/config_test_copy.json diff --git a/integration_tests/dockerfiles/Dockerfile_test_copy b/integration_tests/dockerfiles/Dockerfile_test_copy new file mode 100644 index 0000000000..517f655a29 --- /dev/null +++ b/integration_tests/dockerfiles/Dockerfile_test_copy @@ -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/ diff --git a/integration_tests/dockerfiles/config_test_copy.json b/integration_tests/dockerfiles/config_test_copy.json new file mode 100644 index 0000000000..6d222de515 --- /dev/null +++ b/integration_tests/dockerfiles/config_test_copy.json @@ -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 + } + } +] \ No newline at end of file diff --git a/integration_tests/dockerfiles/config_test_run.json b/integration_tests/dockerfiles/config_test_run.json index 0544a3d22e..19cab32199 100644 --- a/integration_tests/dockerfiles/config_test_run.json +++ b/integration_tests/dockerfiles/config_test_run.json @@ -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", @@ -24,8 +24,8 @@ }, { "Name": "/var/log/apt/history.log", - "Size1": 5089, - "Size2": 5089 + "Size1": 5415, + "Size2": 5415 }, { "Name": "/var/log/alternatives.log", diff --git a/integration_tests/integration_test_yaml.go b/integration_tests/integration_test_yaml.go index d13be52e9d..2928d307a4 100644 --- a/integration_tests/integration_test_yaml.go +++ b/integration_tests/integration_test_yaml.go @@ -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 { @@ -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