From 12fcb24932ca369970f13fc4cee7d886e8d20498 Mon Sep 17 00:00:00 2001 From: Clinton Wolfe Date: Fri, 14 Jun 2019 09:53:14 -0400 Subject: [PATCH] Experiment with git subrepo storage Signed-off-by: Clinton Wolfe --- .../profiles/git-fetcher/basic-local/README.md | 1 + .../basic-local/controls/basic-local.rb | 5 +++++ .../basic-local/git-fixture/COMMIT_EDITMSG | 1 + .../git-fetcher/basic-local/git-fixture/HEAD | 1 + .../git-fetcher/basic-local/git-fixture/config | 10 ++++++++++ .../basic-local/git-fixture/description | 1 + .../git-fetcher/basic-local/git-fixture/index | Bin 0 -> 266 bytes .../basic-local/git-fixture/info/exclude | 6 ++++++ .../git-fetcher/basic-local/git-fixture/logs/HEAD | 4 ++++ .../git-fixture/logs/refs/heads/master | 1 + .../git-fixture/logs/refs/heads/test-branch | 2 ++ .../02/145c02bed66651584950fd3c56a0f8e08495ad | Bin 0 -> 59 bytes .../0e/7d2b9c2c5a1372341e36febceab86558439149 | Bin 0 -> 124 bytes .../26/dec4a490f980527c06528510ed85512fd55e10 | 4 ++++ .../38/b63f30119439953105a30b6b54201ccdf161ad | 2 ++ .../53/7a2ff34c95a18643627a95ae39b1af3f645346 | Bin 0 -> 59 bytes .../54/d0671d3e2c4a28865a0ecc98863859bd4d7475 | 4 ++++ .../b7/b45291b2ed5c7885e355f12dd8da6bcd6c2437 | Bin 0 -> 89 bytes .../d4/7c4fc2bd4c7e35dc5e1f40885335cc63bcd241 | Bin 0 -> 130 bytes .../ea/56cd2cd0923474011fb248a3cd3c2a18585b5f | Bin 0 -> 89 bytes .../basic-local/git-fixture/refs/heads/master | 1 + .../git-fixture/refs/heads/test-branch | 1 + .../basic-local/git-fixture/refs/tags/v1.0 | 1 + .../profiles/git-fetcher/basic-local/inspec.yml | 8 ++++++++ .../profiles/git-fetcher/git-repo-01/README.md | 1 + .../git-repo-01/child-01/controls/child-01.rb | 5 +++++ .../git-fetcher/git-repo-01/child-01/inspec.yml | 8 ++++++++ .../in/repo/child-02/controls/child-02.rb | 5 +++++ .../deeper-path/in/repo/child-02/inspec.yml | 8 ++++++++ .../git-repo-01/git-fixture/COMMIT_EDITMSG | 1 + .../git-fetcher/git-repo-01/git-fixture/HEAD | 1 + .../git-fetcher/git-repo-01/git-fixture/config | 10 ++++++++++ .../git-repo-01/git-fixture/description | 1 + .../git-fetcher/git-repo-01/git-fixture/index | Bin 0 -> 689 bytes .../git-repo-01/git-fixture/info/exclude | 6 ++++++ .../git-fetcher/git-repo-01/git-fixture/logs/HEAD | 2 ++ .../git-fixture/logs/refs/heads/master | 2 ++ .../0c/0abc0b6dc094bf6756b369db878c69f11839c5 | Bin 0 -> 51 bytes .../16/d0355317bef35f2dc7e71607b5e6df7c812713 | Bin 0 -> 90 bytes .../36/f4c4ecd2b870c0d0869c14a3e41dd506e5a887 | 3 +++ .../3d/06a6c531116e47438e0009be37aad4c19eeec1 | Bin 0 -> 50 bytes .../4e/45530f8d46d447cba28d4a41e55cd5b06c0f72 | Bin 0 -> 44 bytes .../65/dcdc3491c0c138538379f404f2517d968282a7 | Bin 0 -> 140 bytes .../74/198b01ae86430df0149b4389f112f6a94ba47d | Bin 0 -> 46 bytes .../87/da758286290d2ec7de5d0a748b4db7a5c4eff5 | Bin 0 -> 85 bytes .../a6/a86bbacc7daf98fb1155a7ebfca37164f8873f | Bin 0 -> 90 bytes .../b7/923d86b8b8951df0eee505671907a59410a978 | Bin 0 -> 56 bytes .../df/e8db2e9636f83a29b42d790c4061f08da60ccd | Bin 0 -> 89 bytes .../e0/a79951d85e314d4f091201bceaeab5001ea8e9 | Bin 0 -> 56 bytes .../e6/d4da70d17f77ab9276a448633b69de7d253f39 | Bin 0 -> 90 bytes .../e9/dd6fd217cced2639b2ad64319bfd73b28a413a | 3 +++ .../ff/13d726419b64726a7ef787377367d598cbb509 | 1 + .../git-repo-01/git-fixture/refs/heads/master | 1 + .../top-level-relative/controls/top-level.rb | 8 ++++++++ .../git-fetcher/top-level-relative/inspec.yml | 14 ++++++++++++++ 55 files changed, 133 insertions(+) create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/README.md create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/controls/basic-local.rb create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/COMMIT_EDITMSG create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/HEAD create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/config create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/description create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/index create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/info/exclude create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/HEAD create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/master create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/test-branch create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/02/145c02bed66651584950fd3c56a0f8e08495ad create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/0e/7d2b9c2c5a1372341e36febceab86558439149 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/26/dec4a490f980527c06528510ed85512fd55e10 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/38/b63f30119439953105a30b6b54201ccdf161ad create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/53/7a2ff34c95a18643627a95ae39b1af3f645346 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/54/d0671d3e2c4a28865a0ecc98863859bd4d7475 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/b7/b45291b2ed5c7885e355f12dd8da6bcd6c2437 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/d4/7c4fc2bd4c7e35dc5e1f40885335cc63bcd241 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/ea/56cd2cd0923474011fb248a3cd3c2a18585b5f create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/master create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/test-branch create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/tags/v1.0 create mode 100644 test/unit/mock/profiles/git-fetcher/basic-local/inspec.yml create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/README.md create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/controls/child-01.rb create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/inspec.yml create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/controls/child-02.rb create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/inspec.yml create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/COMMIT_EDITMSG create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/HEAD create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/config create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/description create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/index create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/info/exclude create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/HEAD create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/refs/heads/master create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/0c/0abc0b6dc094bf6756b369db878c69f11839c5 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/16/d0355317bef35f2dc7e71607b5e6df7c812713 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/36/f4c4ecd2b870c0d0869c14a3e41dd506e5a887 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/3d/06a6c531116e47438e0009be37aad4c19eeec1 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/4e/45530f8d46d447cba28d4a41e55cd5b06c0f72 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/65/dcdc3491c0c138538379f404f2517d968282a7 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/74/198b01ae86430df0149b4389f112f6a94ba47d create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/87/da758286290d2ec7de5d0a748b4db7a5c4eff5 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/a6/a86bbacc7daf98fb1155a7ebfca37164f8873f create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/b7/923d86b8b8951df0eee505671907a59410a978 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/df/e8db2e9636f83a29b42d790c4061f08da60ccd create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e0/a79951d85e314d4f091201bceaeab5001ea8e9 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e6/d4da70d17f77ab9276a448633b69de7d253f39 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e9/dd6fd217cced2639b2ad64319bfd73b28a413a create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/ff/13d726419b64726a7ef787377367d598cbb509 create mode 100644 test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/refs/heads/master create mode 100644 test/unit/mock/profiles/git-fetcher/top-level-relative/controls/top-level.rb create mode 100644 test/unit/mock/profiles/git-fetcher/top-level-relative/inspec.yml diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/README.md b/test/unit/mock/profiles/git-fetcher/basic-local/README.md new file mode 100644 index 000000000..1a577de31 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/README.md @@ -0,0 +1 @@ +This is a git repo used as a test fixture. Because we cannot directly store the .git/ directory, it is stored as git-fixture/, and a symlink is created at test runtime. diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/controls/basic-local.rb b/test/unit/mock/profiles/git-fetcher/basic-local/controls/basic-local.rb new file mode 100644 index 000000000..38b63f301 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/controls/basic-local.rb @@ -0,0 +1,5 @@ +control 'basic-local-01' do + describe 'always-pass' do + it { should cmp 'always-pass'} + end +end \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/COMMIT_EDITMSG b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/COMMIT_EDITMSG new file mode 100644 index 000000000..718d0a25f --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/COMMIT_EDITMSG @@ -0,0 +1 @@ +Add change only on one branch diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/HEAD b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/config b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/config new file mode 100644 index 000000000..271d6fa51 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/config @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + name = test user + email = test@test.org diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/description b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/index b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/index new file mode 100644 index 0000000000000000000000000000000000000000..3aa985884432c3cdeb2a850a8e559f32ddcd093c GIT binary patch literal 266 zcmZ?q402{*U|<5_SY~-6o{PJyVKgHH0}I37d^QG##w834j9-CjM1VNOVw=5z;1tWL zhOCRZvqKbQ&VEc>%OIYdpI1_ppHr-#lvtdZtecacoS36mlmyfe%Pf7&aH7L37!5Hu z=LMR%bFS3*AKL3vXL=`2-k~Gd^i1-eOO6a&nR&$psmXekxj8_iz#t^Z)fLFFVlYxL z 1560485536 -0400 commit (initial): Initial commit +0e7d2b9c2c5a1372341e36febceab86558439149 0e7d2b9c2c5a1372341e36febceab86558439149 test user 1560485563 -0400 checkout: moving from master to test-branch +0e7d2b9c2c5a1372341e36febceab86558439149 54d0671d3e2c4a28865a0ecc98863859bd4d7475 test user 1560485674 -0400 commit: Add change only on one branch +54d0671d3e2c4a28865a0ecc98863859bd4d7475 0e7d2b9c2c5a1372341e36febceab86558439149 test user 1560485682 -0400 checkout: moving from test-branch to master diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/master b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/master new file mode 100644 index 000000000..3f84a39cb --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/master @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 0e7d2b9c2c5a1372341e36febceab86558439149 test user 1560485536 -0400 commit (initial): Initial commit diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/test-branch b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/test-branch new file mode 100644 index 000000000..d5f96b612 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/refs/heads/test-branch @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 0e7d2b9c2c5a1372341e36febceab86558439149 test user 1560485563 -0400 branch: Created from HEAD +0e7d2b9c2c5a1372341e36febceab86558439149 54d0671d3e2c4a28865a0ecc98863859bd4d7475 test user 1560485674 -0400 commit: Add change only on one branch diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/02/145c02bed66651584950fd3c56a0f8e08495ad b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/02/145c02bed66651584950fd3c56a0f8e08495ad new file mode 100644 index 0000000000000000000000000000000000000000..b1f7bd8791d612fec8dae54a0acdcdd9bdb6d76b GIT binary patch literal 59 zcmb)oD2-}C4|%gXQCA> literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/0e/7d2b9c2c5a1372341e36febceab86558439149 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/0e/7d2b9c2c5a1372341e36febceab86558439149 new file mode 100644 index 0000000000000000000000000000000000000000..165073fb28e0c207478115af7d76ba1531f3b45a GIT binary patch literal 124 zcmV-?0E7Q{0hNtG4#FT1MO|}>xj@YTGl+>XZhH(mP$jXF(CPiPdIC2;Z}DEfv}LIZ zHt<1vDNqsz$xbq!ou?C_we#dCCNJ5GOEz-kiD#2GeY6f*R)uXX9WFcG_BpnGzk=m} e6q$X10SVE__ewwNACVbfRcm^}uQqRr5jC0yp*E)g literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/26/dec4a490f980527c06528510ed85512fd55e10 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/26/dec4a490f980527c06528510ed85512fd55e10 new file mode 100644 index 000000000..283de660e --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/26/dec4a490f980527c06528510ed85512fd55e10 @@ -0,0 +1,4 @@ +x +0 D;+n$h{$j+o +] +;-'y6ܐ)+ (5t4lwރVl@@,~^;e&E2W kI \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/38/b63f30119439953105a30b6b54201ccdf161ad b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/38/b63f30119439953105a30b6b54201ccdf161ad new file mode 100644 index 000000000..32b3d0d2f --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/38/b63f30119439953105a30b6b54201ccdf161ad @@ -0,0 +1,2 @@ +xU +0 oT HS.7]McXTY $!YqtYs@a- {# \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/53/7a2ff34c95a18643627a95ae39b1af3f645346 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/53/7a2ff34c95a18643627a95ae39b1af3f645346 new file mode 100644 index 0000000000000000000000000000000000000000..14270ee3d040a695b708f84cd07d844d26dc54f4 GIT binary patch literal 59 zcmV-B0L1@z0V^p=O;s>4VlXr?Ff%bxNJ=cuOxDfGPfpCyD@tOp*k*4aIK^_RA?sr9 R><|T+vmX=J0swd>5Iul|7JvW% literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/54/d0671d3e2c4a28865a0ecc98863859bd4d7475 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/54/d0671d3e2c4a28865a0ecc98863859bd4d7475 new file mode 100644 index 000000000..671488c97 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/54/d0671d3e2c4a28865a0ecc98863859bd4d7475 @@ -0,0 +1,4 @@ +xQ +0D)J&)QͶl+im0AW-u`T0)^!Kypp2)oMHwhkr<|Z*U|zbJOlpPge~~-pk?Y> vLjwad6BC8ZyyAk?WWCDV9EK}3{)hJZ)S2FilXvI{Ha(NP=aM4;l9?Y>+MOxs literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/d4/7c4fc2bd4c7e35dc5e1f40885335cc63bcd241 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/d4/7c4fc2bd4c7e35dc5e1f40885335cc63bcd241 new file mode 100644 index 0000000000000000000000000000000000000000..87dfa22738e73c7efc1d7cb266fbebae811047ff GIT binary patch literal 130 zcmV-|0Db>>0bR^74#F@DMq%ch;=e$v772!I9K{JPL^yR6y9jPi)sgj+-bAW-u`T0)^!Kypp2)oMMLHD*ewsQx~>5Csj>dXSs2`eM+#K vp@D&!iHSmHUU5NcvR-9w4#Sli|3iCy>P+v%$vboeo1RJDbIB0^n3^93*BU4& literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/master b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/master new file mode 100644 index 000000000..79075aec4 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/master @@ -0,0 +1 @@ +0e7d2b9c2c5a1372341e36febceab86558439149 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/test-branch b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/test-branch new file mode 100644 index 000000000..5ebfd1b19 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/heads/test-branch @@ -0,0 +1 @@ +54d0671d3e2c4a28865a0ecc98863859bd4d7475 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/tags/v1.0 b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/tags/v1.0 new file mode 100644 index 000000000..79075aec4 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/refs/tags/v1.0 @@ -0,0 +1 @@ +0e7d2b9c2c5a1372341e36febceab86558439149 diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/inspec.yml b/test/unit/mock/profiles/git-fetcher/basic-local/inspec.yml new file mode 100644 index 000000000..d47c4fc2b --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/inspec.yml @@ -0,0 +1,8 @@ +name: basic-local +title: basic-local +license: Apache-2.0 +summary: A profile to be executed as a local git checkout +version: 0.1.0 +supports: + platform: os + diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/README.md b/test/unit/mock/profiles/git-fetcher/git-repo-01/README.md new file mode 100644 index 000000000..1a577de31 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/README.md @@ -0,0 +1 @@ +This is a git repo used as a test fixture. Because we cannot directly store the .git/ directory, it is stored as git-fixture/, and a symlink is created at test runtime. diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/controls/child-01.rb b/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/controls/child-01.rb new file mode 100644 index 000000000..e6d4da70d --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/controls/child-01.rb @@ -0,0 +1,5 @@ +control 'child-01' do + describe 'always-pass' do + it { should cmp 'always-pass'} + end +end \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/inspec.yml b/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/inspec.yml new file mode 100644 index 000000000..ff13d7264 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/child-01/inspec.yml @@ -0,0 +1,8 @@ +name: child-01 +title: child-01 +license: Apache-2.0 +summary: A profile to be included via git and a relative path +version: 0.1.0 +supports: + platform: os + diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/controls/child-02.rb b/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/controls/child-02.rb new file mode 100644 index 000000000..16d035531 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/controls/child-02.rb @@ -0,0 +1,5 @@ +control 'child-02' do + describe 'always-pass' do + it { should cmp 'always-pass'} + end +end \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/inspec.yml b/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/inspec.yml new file mode 100644 index 000000000..e9dd6fd21 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/deeper-path/in/repo/child-02/inspec.yml @@ -0,0 +1,8 @@ +name: child-02 +title: child-02 +license: Apache-2.0 +summary: A profile to be included via git and a deep relative path +version: 0.1.0 +supports: + platform: os + diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/COMMIT_EDITMSG b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/COMMIT_EDITMSG new file mode 100644 index 000000000..07ae63da3 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/COMMIT_EDITMSG @@ -0,0 +1 @@ +Add child-02 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/HEAD b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/HEAD new file mode 100644 index 000000000..cb089cd89 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/config b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/config new file mode 100644 index 000000000..ed0b78f63 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/config @@ -0,0 +1,10 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = false + logallrefupdates = true + ignorecase = true + precomposeunicode = true +[user] + name = InSpec Test Fixture + email = inspec@chef.io diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/description b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/description new file mode 100644 index 000000000..498b267a8 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/index b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/index new file mode 100644 index 0000000000000000000000000000000000000000..b139775260ed7aafbbebc09a47a100e245dd7642 GIT binary patch literal 689 zcmZ?q402{*U|<4bmY4;b0$CZH7rheV^lXk3Sb<-}>x+O{2OngJDW)YC&p|Zb4#62GD5z zqSS(Xn9GeY{9*+13(y{A4uj`cVKmgfGBo?A`tNm7KQ=2BQ-tl{}TqWJU+m{}B{}mP_3`PouT=!qx)|+Pb z!%B0DZY7UH;)mX4JZE81!Cv16+2 mhj&j|(H_Z|S2I{h2~ literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/info/exclude b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/info/exclude new file mode 100644 index 000000000..a5196d1be --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/HEAD b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/HEAD new file mode 100644 index 000000000..2626ce40e --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/HEAD @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 65dcdc3491c0c138538379f404f2517d968282a7 InSpec Test Fixture 1554036073 -0400 commit (initial): Add child-01 profile +65dcdc3491c0c138538379f404f2517d968282a7 36f4c4ecd2b870c0d0869c14a3e41dd506e5a887 InSpec Test Fixture 1554036109 -0400 commit: Add child-02 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/refs/heads/master b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/refs/heads/master new file mode 100644 index 000000000..2626ce40e --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/logs/refs/heads/master @@ -0,0 +1,2 @@ +0000000000000000000000000000000000000000 65dcdc3491c0c138538379f404f2517d968282a7 InSpec Test Fixture 1554036073 -0400 commit (initial): Add child-01 profile +65dcdc3491c0c138538379f404f2517d968282a7 36f4c4ecd2b870c0d0869c14a3e41dd506e5a887 InSpec Test Fixture 1554036109 -0400 commit: Add child-02 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/0c/0abc0b6dc094bf6756b369db878c69f11839c5 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/0c/0abc0b6dc094bf6756b369db878c69f11839c5 new file mode 100644 index 0000000000000000000000000000000000000000..69749181e53fda6f7ba98ba945fa3d75f19562aa GIT binary patch literal 51 zcmb3Y4G__9A4+u0eM HLxng1-aix0 literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/16/d0355317bef35f2dc7e71607b5e6df7c812713 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/16/d0355317bef35f2dc7e71607b5e6df7c812713 new file mode 100644 index 0000000000000000000000000000000000000000..0b4a5004af9fd360335a755a6eee9d39ca1a9530 GIT binary patch literal 90 zcmV-g0HyzU0ZYosPg1ZnVMxx;D=Es)QBY6L$jnL6H84_FNXh3?P)JEFPAxx# w%qdT-EY>YZEG~x1DJW!?C{!yHXXKaWq$nik7N9Ds1!_;tOW^`y0EU(zw)2@K{{R30 literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/36/f4c4ecd2b870c0d0869c14a3e41dd506e5a887 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/36/f4c4ecd2b870c0d0869c14a3e41dd506e5a887 new file mode 100644 index 000000000..26486e354 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/36/f4c4ecd2b870c0d0869c14a3e41dd506e5a887 @@ -0,0 +1,3 @@ +xK +1 @]~2mAD7k@MR32VGp={_ER)4┣( 55⠵yE -#['s #%ߖ+єWN }v8w- +6=pϣMw`b5Dÿˮ <љ-H8 \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/3d/06a6c531116e47438e0009be37aad4c19eeec1 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/3d/06a6c531116e47438e0009be37aad4c19eeec1 new file mode 100644 index 0000000000000000000000000000000000000000..22fa52dcaff97be8dc8635f3d84d32b4ede02d0a GIT binary patch literal 50 zcmV-20L}k+0V^p=O;s>9WiT-S0)^y^%$yWm14D-UFK+8iGy7qsxka~<$06}U?=qgV I05HlA+1K3_Jpcdz literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/4e/45530f8d46d447cba28d4a41e55cd5b06c0f72 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/4e/45530f8d46d447cba28d4a41e55cd5b06c0f72 new file mode 100644 index 0000000000000000000000000000000000000000..55e7ac97d79c3337ffb92f4d439b4428be74fd4f GIT binary patch literal 44 zcmb)5VqnO?)OyCIP3UCavC`agd*ofxtjp^}er>x{?WxOf={&D30As5W ATmS$7 literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/65/dcdc3491c0c138538379f404f2517d968282a7 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/65/dcdc3491c0c138538379f404f2517d968282a7 new file mode 100644 index 0000000000000000000000000000000000000000..a529d9ee70862a3799b733cfb3c416ba62af890b GIT binary patch literal 140 zcmV;70CWF%0iDf33c@fDMq$@E#ay5=L(1@i&&4n71B&O^!o literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/74/198b01ae86430df0149b4389f112f6a94ba47d b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/74/198b01ae86430df0149b4389f112f6a94ba47d new file mode 100644 index 0000000000000000000000000000000000000000..b0a8988ac63e0ccd74c8225986ecb09d63664122 GIT binary patch literal 46 zcmV+}0MY+=0V^p=O;s>9WH2!R0)?W~f_w%Zu07nj2d3;#58Ir1yS*p#qlD#A0Q2<@ ElZM|D;{X5v literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/87/da758286290d2ec7de5d0a748b4db7a5c4eff5 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/87/da758286290d2ec7de5d0a748b4db7a5c4eff5 new file mode 100644 index 0000000000000000000000000000000000000000..9eb0fd8cc41633a53ffcb2344512979391a0ba1f GIT binary patch literal 85 zcmV-b0IL6Z0V^p=O;s>AW-u`T0)^y^%$yWm14D-UFK+8iGy7qsxka~<$06}U?=qgV r5G5(8sRgM;x&?_P84P}|!Th~$SKLo8>h*Gb8gq3+4u25AW-u`T0)^!Kypp2)oMMLUlWf~|?3gP1;oVc#bV>H5Qv_C4 w7#bLunV2YK<`oyDChJw^<}kdxn}13C%v&|fO>0vOXa6nU)a7Ue0Mv6J=X822m;e9( literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/b7/923d86b8b8951df0eee505671907a59410a978 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/b7/923d86b8b8951df0eee505671907a59410a978 new file mode 100644 index 0000000000000000000000000000000000000000..512aea4a76be3ccc2dba81d0438b17aa3b683ce9 GIT binary patch literal 56 zcmV-80LTA$0V^p=O;s?qWH2-^Ff%bxNY2R2NzpYh(kn`05W8R+EWYn^yzcSmV(eR= O-LGj>7X|=Tc@SS`92ZRh literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/df/e8db2e9636f83a29b42d790c4061f08da60ccd b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/df/e8db2e9636f83a29b42d790c4061f08da60ccd new file mode 100644 index 0000000000000000000000000000000000000000..9bdf8409c1b7ca8a4f9459a06d07bedfba227269 GIT binary patch literal 89 zcmV-f0H*(V0V^p=O;s>AW-u`T0)^!Kypp2)oMMIt%V!4Oh%@x{=M-Yx^Xk=B2Due4 v4Gj#;OiUCq^NI^nll3Zda~S>$UsrRSol=xl_r2Y`IQ{C3(_1+Krz#)D(J?66 literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e0/a79951d85e314d4f091201bceaeab5001ea8e9 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e0/a79951d85e314d4f091201bceaeab5001ea8e9 new file mode 100644 index 0000000000000000000000000000000000000000..ef9e9a4c2aa4e180a0726a90f233d65a17b6acf4 GIT binary patch literal 56 zcmV-80LTA$0V^p=O;s?qWH2-^Ff%bxNY2R2NzpYh)GJD2cy{Gh!NvOW)sxDWcqChA O-m6u$w*&xmxDknlH5n!V literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e6/d4da70d17f77ab9276a448633b69de7d253f39 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e6/d4da70d17f77ab9276a448633b69de7d253f39 new file mode 100644 index 0000000000000000000000000000000000000000..3cb4847fc1fcb9e5038cd45029288d5eb25e4179 GIT binary patch literal 90 zcmV-g0HyzU0ZYosPg1ZnVMxx;D=Es)QBY6L$jnL6H850HNXh3?P)JEFPAxx# w%qdT-EY>YZEG~x1DJW!?C{!yHXXKaWq$nik7N9Ds1!_;tOW^`y0ES2)weu_`vH$=8 literal 0 HcmV?d00001 diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e9/dd6fd217cced2639b2ad64319bfd73b28a413a b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e9/dd6fd217cced2639b2ad64319bfd73b28a413a new file mode 100644 index 000000000..154842f2c --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e9/dd6fd217cced2639b2ad64319bfd73b28a413a @@ -0,0 +1,3 @@ +xMA +0E)hv=ʘu I}.֤+Q(G%aZ\9In6 +;8vL&+CJHGSĂʉ k-8fZ{۴fm}7+ \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/ff/13d726419b64726a7ef787377367d598cbb509 b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/ff/13d726419b64726a7ef787377367d598cbb509 new file mode 100644 index 000000000..8fe1a3a2b --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/ff/13d726419b64726a7ef787377367d598cbb509 @@ -0,0 +1 @@ +xM1 S-;J< ppΖXRh4[ qT#$qZVgb2F!t7R.u0Ɛ9[ T#3F}Ve^ִhWk/:5f \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/refs/heads/master b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/refs/heads/master new file mode 100644 index 000000000..5798ee814 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/refs/heads/master @@ -0,0 +1 @@ +36f4c4ecd2b870c0d0869c14a3e41dd506e5a887 diff --git a/test/unit/mock/profiles/git-fetcher/top-level-relative/controls/top-level.rb b/test/unit/mock/profiles/git-fetcher/top-level-relative/controls/top-level.rb new file mode 100644 index 000000000..d0c3298ac --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/top-level-relative/controls/top-level.rb @@ -0,0 +1,8 @@ +# include_controls 'child-01' +# include_controls 'child-02' + +control 'top-level-01' do + describe 'always-pass' do + it { should cmp 'always-pass'} + end +end \ No newline at end of file diff --git a/test/unit/mock/profiles/git-fetcher/top-level-relative/inspec.yml b/test/unit/mock/profiles/git-fetcher/top-level-relative/inspec.yml new file mode 100644 index 000000000..bd94c6bca --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/top-level-relative/inspec.yml @@ -0,0 +1,14 @@ +name: top-level-relative +title: top-level-relative +license: Apache-2.0 +summary: A profile that depends on profiles that are stored in a repo in subdirs +version: 0.1.0 +supports: + platform: os +depends: +- name: child-01 + git: test/unit/mock/profiles/git-fetcher/git-repo-01 + relative_path: child-01 +# - name: child-02 +# git: ./git-repo-01 +# relative_path: deeper-path/in/repo/child-01