From 38569c85082bd895df50b304c7bbe2641d4504b1 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 21 Sep 2017 13:06:47 -0500 Subject: [PATCH] add tests for get from tar subdir Test that we can get a subdirectory from a tarball (or any other "packed" source that we support). The 'tar-subdir-to-parent' test highlights a regression where the subdirectory module references a module in its parent directory. This breaks the intended use ofr the subdirectory and the implementation in go-getter. We need to fix this in terraform, and possible plan warnings and deprecations for this type of source. --- .../test-fixtures/basic-tar-subdir/foo.tgz | Bin 0 -> 236 bytes .../test-fixtures/basic-tar-subdir/main.tf | 3 + .../tar-subdir-to-parent/foo.tgz | Bin 0 -> 235 bytes .../tar-subdir-to-parent/main.tf | 4 ++ config/module/tree_test.go | 64 ++++++++++-------- 5 files changed, 44 insertions(+), 27 deletions(-) create mode 100644 config/module/test-fixtures/basic-tar-subdir/foo.tgz create mode 100644 config/module/test-fixtures/basic-tar-subdir/main.tf create mode 100644 config/module/test-fixtures/tar-subdir-to-parent/foo.tgz create mode 100644 config/module/test-fixtures/tar-subdir-to-parent/main.tf diff --git a/config/module/test-fixtures/basic-tar-subdir/foo.tgz b/config/module/test-fixtures/basic-tar-subdir/foo.tgz new file mode 100644 index 0000000000000000000000000000000000000000..7ea938b7b3d689b9463009f22ee76ab1f6f8b47e GIT binary patch literal 236 zcmV9?wF=3 z0z?2IgAnhtnT-|Aw)=O_#bcYz%y%wxTz9-gm_R z5zJ=tx9}=|Q*)VUqJCcZ=lSmrtMP6vMV!8n`&^>oF!sx}+(=PAErue0$bY*_r1HG~ m)9ru{-~XHaZ$Ulp9{>OV000000001h&w2zDNG!GhC;$MV9(o@D literal 0 HcmV?d00001 diff --git a/config/module/test-fixtures/basic-tar-subdir/main.tf b/config/module/test-fixtures/basic-tar-subdir/main.tf new file mode 100644 index 000000000..ceb0a19de --- /dev/null +++ b/config/module/test-fixtures/basic-tar-subdir/main.tf @@ -0,0 +1,3 @@ +module "foo" { + source = "./foo.tgz//sub" +} diff --git a/config/module/test-fixtures/tar-subdir-to-parent/foo.tgz b/config/module/test-fixtures/tar-subdir-to-parent/foo.tgz new file mode 100644 index 0000000000000000000000000000000000000000..62125bf1a1259dc01162c56f2d29a1fe0392263b GIT binary patch literal 235 zcmV