From 56519c913d283c8ff9a91d1f19836f16fa0ac266 Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Wed, 28 Mar 2018 13:35:13 -0700 Subject: [PATCH] Add cmd integration test --- integration_tests/context/tars/file | 1 + integration_tests/context/tars/file.bz2 | Bin 0 -> 196 bytes integration_tests/context/tars/file.tar | Bin 0 -> 10240 bytes integration_tests/context/tars/file.tar.gz | Bin 0 -> 199 bytes .../dockerfiles/Dockerfile_test_add | 18 ++++++++++++++++++ .../dockerfiles/config_test_add.json | 12 ++++++++++++ integration_tests/integration_test_yaml.go | 7 +++++++ 7 files changed, 38 insertions(+) create mode 100644 integration_tests/context/tars/file create mode 100644 integration_tests/context/tars/file.bz2 create mode 100644 integration_tests/context/tars/file.tar create mode 100644 integration_tests/context/tars/file.tar.gz create mode 100644 integration_tests/dockerfiles/Dockerfile_test_add create mode 100644 integration_tests/dockerfiles/config_test_add.json diff --git a/integration_tests/context/tars/file b/integration_tests/context/tars/file new file mode 100644 index 000000000..faddca8a8 --- /dev/null +++ b/integration_tests/context/tars/file @@ -0,0 +1 @@ +normal file diff --git a/integration_tests/context/tars/file.bz2 b/integration_tests/context/tars/file.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..53c13149a1a2a8e4f309d9c4f1920a8eec06f199 GIT binary patch literal 196 zcmV;#06YIeT4*^jL0KkKSt*-N;{X6?e}uu1AP7JK|9}Yr00DO9-mn0G00=MuyIK;c z&;vjKXbl5E(x0jxpa1{>01`+>Q_-k;fB*n`n+tHlwC-Gx6Os}}a;B#-Drt1cg+>ww z5ENu?2%qXhZUC2F;7J-Fk}QfOwL*!5DvT*ARKsiI0^yuwVp3_uc-MmuffC&yAA{-a yu&Z;>@rr;*w+Wj)X`MKHJ3nP)!rB-ho|uFQJuF^gP_c-Re;0B^I8cx&n@;0WB=1||~uvs?kcOkxS zv7d&`1LsWU#q_-P-4L5`Z0bw_M$&mlY>P2!~DCNHjU@vpR?Uf_Rv%e zJm#{iR;*EAYsNy|s`*dP9QgC#EO+GGS*-6}rz`FdaFLYXv$6lP`o(J%>$iL?v%4N9 ztvfTme%1+#n50uiFN2GFgV*>4*Zj`gm!G^#F4+8A^qX5AaWcEM`F}OIa&@2O_3S@| w{4rMFckbWjUH|ymzokKLMq7`~2(Q0azjFWYuObY{AbuBP=Ei7Q1`P%V06MT)5C8xG literal 0 HcmV?d00001 diff --git a/integration_tests/dockerfiles/Dockerfile_test_add b/integration_tests/dockerfiles/Dockerfile_test_add new file mode 100644 index 000000000..6fb9d73a7 --- /dev/null +++ b/integration_tests/dockerfiles/Dockerfile_test_add @@ -0,0 +1,18 @@ +FROM gcr.io/google-appengine/debian9:latest +# First, try adding some regular files +ADD context/foo foo +ADD context/foo /foodir/ +ADD context/bar/b* bar/ +ADD . newdir +ADD ["context/foo", "/tmp/foo" ] + +# Next, make sure environment replacement works +ENV contextenv ./context +ADD $contextenv/* /tmp/${contextenv}/ + +# Now, test extracting local tar archives +ADD context/tars/fil* /tars/ +ADD context/tars/file.tar /tars_again + +# Finally, test adding a remote URL, concurrently with a normal file +ADD https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v1.4.3/docker-credential-gcr_linux_386-1.4.3.tar.gz context/foo /test/all/ diff --git a/integration_tests/dockerfiles/config_test_add.json b/integration_tests/dockerfiles/config_test_add.json new file mode 100644 index 000000000..b6d7a2020 --- /dev/null +++ b/integration_tests/dockerfiles/config_test_add.json @@ -0,0 +1,12 @@ +[ + { + "Image1": "gcr.io/kbuild-test/docker-test-add:latest", + "Image2": "gcr.io/kbuild-test/kbuild-test-add:latest", + "DiffType": "File", + "Diff": { + "Adds": null, + "Dels": null, + "Mods": null + } + } +] \ No newline at end of file diff --git a/integration_tests/integration_test_yaml.go b/integration_tests/integration_test_yaml.go index 3129456ff..abfc03db8 100644 --- a/integration_tests/integration_test_yaml.go +++ b/integration_tests/integration_test_yaml.go @@ -57,6 +57,13 @@ var fileTests = []struct { context: "/workspace/integration_tests/", repo: "test-copy", }, + { + description: "test add", + dockerfilePath: "/workspace/integration_tests/dockerfiles/Dockerfile_test_add", + configPath: "/workspace/integration_tests/dockerfiles/config_test_add.json", + context: "/workspace/integration_tests/", + repo: "test-add", + }, } var structureTests = []struct {