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 000000000..3aa985884 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/index differ diff --git a/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/info/exclude b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/info/exclude new file mode 100644 index 000000000..a5196d1be --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/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/basic-local/git-fixture/logs/HEAD b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/HEAD new file mode 100644 index 000000000..a1ce8a223 --- /dev/null +++ b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/logs/HEAD @@ -0,0 +1,4 @@ +0000000000000000000000000000000000000000 0e7d2b9c2c5a1372341e36febceab86558439149 test user 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 000000000..b1f7bd879 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/02/145c02bed66651584950fd3c56a0f8e08495ad differ 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 000000000..165073fb2 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/0e/7d2b9c2c5a1372341e36febceab86558439149 differ 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 000000000..14270ee3d Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/basic-local/git-fixture/objects/53/7a2ff34c95a18643627a95ae39b1af3f645346 differ 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+im0 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 000000000..69749181e Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/0c/0abc0b6dc094bf6756b369db878c69f11839c5 differ 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 000000000..0b4a5004a Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/16/d0355317bef35f2dc7e71607b5e6df7c812713 differ 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 000000000..22fa52dca Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/3d/06a6c531116e47438e0009be37aad4c19eeec1 differ 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 000000000..55e7ac97d Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/4e/45530f8d46d447cba28d4a41e55cd5b06c0f72 differ 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 000000000..a529d9ee7 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/65/dcdc3491c0c138538379f404f2517d968282a7 differ 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 000000000..b0a8988ac Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/74/198b01ae86430df0149b4389f112f6a94ba47d differ 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 000000000..9eb0fd8cc Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/87/da758286290d2ec7de5d0a748b4db7a5c4eff5 differ diff --git a/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/a6/a86bbacc7daf98fb1155a7ebfca37164f8873f b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/a6/a86bbacc7daf98fb1155a7ebfca37164f8873f new file mode 100644 index 000000000..3253f436f Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/a6/a86bbacc7daf98fb1155a7ebfca37164f8873f differ 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 000000000..512aea4a7 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/b7/923d86b8b8951df0eee505671907a59410a978 differ 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 000000000..9bdf8409c Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/df/e8db2e9636f83a29b42d790c4061f08da60ccd differ 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 000000000..ef9e9a4c2 Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e0/a79951d85e314d4f091201bceaeab5001ea8e9 differ 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 000000000..3cb4847fc Binary files /dev/null and b/test/unit/mock/profiles/git-fetcher/git-repo-01/git-fixture/objects/e6/d4da70d17f77ab9276a448633b69de7d253f39 differ 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