test-kitchen 1.23.3 → 1.23.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kitchen/version.rb +1 -1
  3. data/support/chef-client-zero.rb +1 -1
  4. metadata +5 -324
  5. data/.gitattributes +0 -3
  6. data/.github/ISSUE_TEMPLATE.md +0 -56
  7. data/.github/lock.yml +0 -1
  8. data/.gitignore +0 -38
  9. data/.gitmodules +0 -0
  10. data/.kitchen.appveyor.yml +0 -25
  11. data/.kitchen.dokken.yml +0 -31
  12. data/.kitchen.proxy.yml +0 -27
  13. data/.rubocop.yml +0 -5
  14. data/.travis.yml +0 -57
  15. data/.yardopts +0 -3
  16. data/Berksfile +0 -3
  17. data/CHANGELOG.md +0 -1510
  18. data/CONTRIBUTING.md +0 -14
  19. data/ECOSYSTEM.md +0 -93
  20. data/Gemfile +0 -40
  21. data/Gemfile.proxy_tests +0 -4
  22. data/Guardfile +0 -42
  23. data/MAINTAINERS.md +0 -29
  24. data/README.md +0 -138
  25. data/RELEASE_NOTES.md +0 -167
  26. data/Rakefile +0 -77
  27. data/appveyor.yml +0 -47
  28. data/docs/CONTRIBUTING.md +0 -8
  29. data/docs/LICENSE +0 -22
  30. data/docs/README.md +0 -78
  31. data/docs/archetypes/default.md +0 -6
  32. data/docs/config.toml +0 -36
  33. data/docs/content/docs/_index.md +0 -5
  34. data/docs/content/docs/drivers/_index.md +0 -27
  35. data/docs/content/docs/drivers/azurerm.md +0 -44
  36. data/docs/content/docs/drivers/vagrant.md +0 -39
  37. data/docs/content/docs/getting-started/00-introduction.md +0 -14
  38. data/docs/content/docs/getting-started/01-installing.md +0 -64
  39. data/docs/content/docs/getting-started/02-getting-help.md +0 -59
  40. data/docs/content/docs/getting-started/03-creating-cookbook.md +0 -46
  41. data/docs/content/docs/getting-started/04-kitchen-yml.md +0 -56
  42. data/docs/content/docs/getting-started/05-instances.md +0 -79
  43. data/docs/content/docs/getting-started/06-writing-recipe.md +0 -21
  44. data/docs/content/docs/getting-started/07-running-converge.md +0 -134
  45. data/docs/content/docs/getting-started/08-manually-verifying.md +0 -55
  46. data/docs/content/docs/getting-started/09-writing-test.md +0 -49
  47. data/docs/content/docs/getting-started/10-running-verify.md +0 -120
  48. data/docs/content/docs/getting-started/11-running-test.md +0 -168
  49. data/docs/content/docs/getting-started/12-adding-platform.md +0 -206
  50. data/docs/content/docs/getting-started/13-adding-feature.md +0 -30
  51. data/docs/content/docs/getting-started/14-adding-suite.md +0 -60
  52. data/docs/content/docs/getting-started/15-adding-test.md +0 -66
  53. data/docs/content/docs/getting-started/16-adding-recipe.md +0 -53
  54. data/docs/content/docs/getting-started/17-excluding-platforms.md +0 -101
  55. data/docs/content/docs/getting-started/18-next-steps.md +0 -23
  56. data/docs/content/docs/getting-started/_index.md +0 -5
  57. data/docs/content/docs/provisioners/_index.md +0 -36
  58. data/docs/content/docs/provisioners/chef.md +0 -69
  59. data/docs/content/docs/provisioners/shell.md +0 -31
  60. data/docs/content/docs/reference/_index.md +0 -5
  61. data/docs/content/docs/reference/configuration.md +0 -53
  62. data/docs/content/docs/reference/examples.md +0 -97
  63. data/docs/content/docs/reference/faq.md +0 -58
  64. data/docs/content/docs/reference/fixtures.md +0 -32
  65. data/docs/content/docs/reference/glossary.md +0 -34
  66. data/docs/content/docs/reference/lifecycle-hooks.md +0 -68
  67. data/docs/content/docs/reference/reboots.md +0 -24
  68. data/docs/content/docs/verifiers/_index.md +0 -14
  69. data/docs/content/docs/verifiers/inspec.md +0 -44
  70. data/docs/content/docs/verifiers/serverspec.md +0 -20
  71. data/docs/static/images/chef-logo.png +0 -0
  72. data/docs/static/images/chef-logo.svg +0 -1
  73. data/docs/static/images/github-banner.png +0 -0
  74. data/docs/static/images/github-banner.svg +0 -71
  75. data/docs/static/images/kitchen-logo.png +0 -0
  76. data/docs/static/images/logo-block.svg +0 -222
  77. data/docs/static/images/logo.png +0 -0
  78. data/docs/static/images/logos-group.png +0 -0
  79. data/docs/static/images/terminal-1.png +0 -0
  80. data/docs/static/images/terminal-1.svg +0 -589
  81. data/docs/static/images/terminal-2.png +0 -0
  82. data/docs/static/images/terminal-2.svg +0 -235
  83. data/docs/static/images/terminal-3.png +0 -0
  84. data/docs/static/images/terminal-3.svg +0 -439
  85. data/docs/static/index.html +0 -59
  86. data/docs/static/javascripts/all.js +0 -348
  87. data/docs/static/javascripts/vendor/foundation.min.js +0 -4
  88. data/docs/static/javascripts/vendor/jquery.min.js +0 -5
  89. data/docs/static/javascripts/vendor/what-input.js +0 -336
  90. data/docs/static/stylesheets/site.css +0 -4667
  91. data/docs/themes/kitchen/layouts/_default/baseof.html +0 -53
  92. data/docs/themes/kitchen/layouts/_default/list.html +0 -4
  93. data/docs/themes/kitchen/layouts/_default/redirect.html +0 -10
  94. data/docs/themes/kitchen/layouts/_default/single.html +0 -6
  95. data/docs/themes/kitchen/layouts/partials/core/head.html +0 -6
  96. data/docs/themes/kitchen/layouts/partials/kitchen/footer.html +0 -18
  97. data/docs/themes/kitchen/layouts/partials/kitchen/head.html +0 -4
  98. data/docs/themes/kitchen/layouts/partials/kitchen/header.html +0 -26
  99. data/docs/themes/kitchen/layouts/partials/search-docs.html +0 -3
  100. data/docs/themes/kitchen/layouts/partials/sidebar.html +0 -33
  101. data/docs/themes/kitchen/layouts/shortcodes/button.html +0 -1
  102. data/docs/themes/kitchen/layouts/shortcodes/codeblock.html +0 -8
  103. data/docs/themes/kitchen/layouts/shortcodes/cta.html +0 -5
  104. data/docs/themes/kitchen/layouts/shortcodes/danger.html +0 -1
  105. data/docs/themes/kitchen/layouts/shortcodes/example_fqdn.html +0 -1
  106. data/docs/themes/kitchen/layouts/shortcodes/info.html +0 -1
  107. data/docs/themes/kitchen/layouts/shortcodes/ol-styled.html +0 -3
  108. data/docs/themes/kitchen/layouts/shortcodes/success.html +0 -1
  109. data/docs/themes/kitchen/layouts/shortcodes/tip.html +0 -1
  110. data/docs/themes/kitchen/layouts/shortcodes/warning.html +0 -1
  111. data/docs/themes/kitchen/static/css/kitchen.css +0 -10
  112. data/docs/themes/kitchen/static/css/kitchen.css.map +0 -7
  113. data/docs/themes/kitchen/static/fonts/Muli-Bold.ttf +0 -0
  114. data/docs/themes/kitchen/static/fonts/Muli-Regular.ttf +0 -0
  115. data/docs/themes/kitchen/static/fonts/Muli-SemiBold.ttf +0 -0
  116. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.eot +0 -0
  117. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.svg +0 -1104
  118. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.ttf +0 -0
  119. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.woff +0 -0
  120. data/docs/themes/kitchen/static/fonts/fontawesome/fa-brands-400.woff2 +0 -0
  121. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.eot +0 -0
  122. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.svg +0 -372
  123. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.ttf +0 -0
  124. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.woff +0 -0
  125. data/docs/themes/kitchen/static/fonts/fontawesome/fa-regular-400.woff2 +0 -0
  126. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.eot +0 -0
  127. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.svg +0 -1896
  128. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.ttf +0 -0
  129. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.woff +0 -0
  130. data/docs/themes/kitchen/static/fonts/fontawesome/fa-solid-900.woff2 +0 -0
  131. data/docs/themes/kitchen/static/images/chef-logo-light.svg +0 -36
  132. data/docs/themes/kitchen/static/images/chef-logo-white.svg +0 -38
  133. data/docs/themes/kitchen/static/images/chef-logo.svg +0 -37
  134. data/docs/themes/kitchen/static/images/favicon.ico +0 -0
  135. data/docs/themes/kitchen/static/js/scripts-all.js +0 -7
  136. data/docs/themes/kitchen/static/js/source/chef-hugo.js +0 -116
  137. data/docs/themes/kitchen/static/js/source/omnitruck.js +0 -82
  138. data/docs/themes/kitchen/static/js/source/segment.js +0 -52
  139. data/docs/themes/kitchen/static/sass/_buttons.scss +0 -161
  140. data/docs/themes/kitchen/static/sass/_core.scss +0 -24
  141. data/docs/themes/kitchen/static/sass/_forms.scss +0 -14
  142. data/docs/themes/kitchen/static/sass/_mixins.scss +0 -133
  143. data/docs/themes/kitchen/static/sass/_typography.scss +0 -34
  144. data/docs/themes/kitchen/static/sass/_variables.scss +0 -82
  145. data/docs/themes/kitchen/static/sass/kitchen.scss +0 -7
  146. data/docs/themes/kitchen/static/sass/kitchen/_footer.scss +0 -50
  147. data/docs/themes/kitchen/static/sass/kitchen/_header.scss +0 -187
  148. data/docs/themes/kitchen/static/sass/kitchen/_homepage.scss +0 -27
  149. data/docs/themes/kitchen/static/sass/kitchen/_utility-bar.scss +0 -173
  150. data/docs/themes/kitchen/static/sass/partials/_alerts.scss +0 -32
  151. data/docs/themes/kitchen/static/sass/partials/_bg.scss +0 -19
  152. data/docs/themes/kitchen/static/sass/partials/_blurbs.scss +0 -25
  153. data/docs/themes/kitchen/static/sass/partials/_callout.scss +0 -15
  154. data/docs/themes/kitchen/static/sass/partials/_cards.scss +0 -54
  155. data/docs/themes/kitchen/static/sass/partials/_dropdown.scss +0 -77
  156. data/docs/themes/kitchen/static/sass/partials/_grid.scss +0 -87
  157. data/docs/themes/kitchen/static/sass/partials/_padding.scss +0 -73
  158. data/docs/themes/kitchen/static/sass/partials/_sidebar.scss +0 -71
  159. data/docs/themes/kitchen/static/sass/partials/_tabs.scss +0 -125
  160. data/docs/themes/kitchen/static/sass/typography/_chroma.scss +0 -366
  161. data/docs/themes/kitchen/static/sass/typography/_code.scss +0 -72
  162. data/docs/themes/kitchen/static/sass/typography/_headers.scss +0 -90
  163. data/docs/themes/kitchen/static/sass/typography/_links.scss +0 -127
  164. data/docs/themes/kitchen/static/sass/typography/_lists.scss +0 -155
  165. data/docs/themes/kitchen/static/sass/typography/_prose.scss +0 -29
  166. data/docs/themes/kitchen/static/sass/typography/_text.scss +0 -221
  167. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_animated.scss +0 -20
  168. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_bordered-pulled.scss +0 -20
  169. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_core.scss +0 -16
  170. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_fixed-width.scss +0 -6
  171. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_icons.scss +0 -992
  172. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_larger.scss +0 -23
  173. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_list.scss +0 -18
  174. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_mixins.scss +0 -57
  175. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_rotated-flipped.scss +0 -23
  176. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_screen-reader.scss +0 -5
  177. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_stacked.scss +0 -31
  178. data/docs/themes/kitchen/static/sass/vendor/fontawesome/_variables.scss +0 -1005
  179. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-brands.scss +0 -21
  180. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-regular.scss +0 -22
  181. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fa-solid.scss +0 -23
  182. data/docs/themes/kitchen/static/sass/vendor/fontawesome/fontawesome.scss +0 -16
  183. data/docs/themes/kitchen/theme.toml +0 -8
  184. data/features/kitchen_action_commands.feature +0 -164
  185. data/features/kitchen_command.feature +0 -16
  186. data/features/kitchen_console_command.feature +0 -35
  187. data/features/kitchen_defaults.feature +0 -38
  188. data/features/kitchen_diagnose_command.feature +0 -96
  189. data/features/kitchen_help_command.feature +0 -16
  190. data/features/kitchen_init_command.feature +0 -254
  191. data/features/kitchen_list_command.feature +0 -140
  192. data/features/kitchen_login_command.feature +0 -62
  193. data/features/kitchen_sink_command.feature +0 -30
  194. data/features/kitchen_test_command.feature +0 -88
  195. data/features/step_definitions/gem_steps.rb +0 -24
  196. data/features/step_definitions/git_steps.rb +0 -5
  197. data/features/step_definitions/output_steps.rb +0 -5
  198. data/features/support/env.rb +0 -74
  199. data/spec/kitchen/base64_stream_spec.rb +0 -74
  200. data/spec/kitchen/cli_spec.rb +0 -54
  201. data/spec/kitchen/collection_spec.rb +0 -76
  202. data/spec/kitchen/color_spec.rb +0 -51
  203. data/spec/kitchen/config_spec.rb +0 -434
  204. data/spec/kitchen/configurable_spec.rb +0 -1113
  205. data/spec/kitchen/data_munger_spec.rb +0 -2800
  206. data/spec/kitchen/diagnostic_spec.rb +0 -128
  207. data/spec/kitchen/driver/base_spec.rb +0 -132
  208. data/spec/kitchen/driver/dummy_spec.rb +0 -193
  209. data/spec/kitchen/driver/exec_spec.rb +0 -75
  210. data/spec/kitchen/driver/proxy_spec.rb +0 -127
  211. data/spec/kitchen/driver/ssh_base_spec.rb +0 -1136
  212. data/spec/kitchen/driver_spec.rb +0 -106
  213. data/spec/kitchen/errors_spec.rb +0 -317
  214. data/spec/kitchen/instance_spec.rb +0 -1372
  215. data/spec/kitchen/lazy_hash_spec.rb +0 -113
  216. data/spec/kitchen/lifecycle_hooks_spec.rb +0 -171
  217. data/spec/kitchen/loader/yaml_spec.rb +0 -787
  218. data/spec/kitchen/logger_spec.rb +0 -425
  219. data/spec/kitchen/logging_spec.rb +0 -56
  220. data/spec/kitchen/login_command_spec.rb +0 -67
  221. data/spec/kitchen/metadata_chopper_spec.rb +0 -79
  222. data/spec/kitchen/platform_spec.rb +0 -88
  223. data/spec/kitchen/provisioner/base_spec.rb +0 -393
  224. data/spec/kitchen/provisioner/chef/policyfile_spec.rb +0 -140
  225. data/spec/kitchen/provisioner/chef_apply_spec.rb +0 -131
  226. data/spec/kitchen/provisioner/chef_base_spec.rb +0 -1565
  227. data/spec/kitchen/provisioner/chef_solo_spec.rb +0 -602
  228. data/spec/kitchen/provisioner/chef_zero_spec.rb +0 -1013
  229. data/spec/kitchen/provisioner/dummy_spec.rb +0 -96
  230. data/spec/kitchen/provisioner/shell_spec.rb +0 -623
  231. data/spec/kitchen/provisioner_spec.rb +0 -101
  232. data/spec/kitchen/shell_out_spec.rb +0 -146
  233. data/spec/kitchen/ssh_spec.rb +0 -584
  234. data/spec/kitchen/state_file_spec.rb +0 -122
  235. data/spec/kitchen/suite_spec.rb +0 -61
  236. data/spec/kitchen/transport/base_spec.rb +0 -140
  237. data/spec/kitchen/transport/exec_spec.rb +0 -79
  238. data/spec/kitchen/transport/ssh_spec.rb +0 -1317
  239. data/spec/kitchen/transport/winrm_spec.rb +0 -1320
  240. data/spec/kitchen/transport_spec.rb +0 -106
  241. data/spec/kitchen/util_spec.rb +0 -250
  242. data/spec/kitchen/verifier/base_spec.rb +0 -346
  243. data/spec/kitchen/verifier/busser_spec.rb +0 -580
  244. data/spec/kitchen/verifier/dummy_spec.rb +0 -96
  245. data/spec/kitchen/verifier/shell_spec.rb +0 -157
  246. data/spec/kitchen/verifier_spec.rb +0 -114
  247. data/spec/kitchen_spec.rb +0 -112
  248. data/spec/spec_helper.rb +0 -110
  249. data/spec/support/powershell_max_size_spec.rb +0 -39
  250. data/test-kitchen.gemspec +0 -49
  251. data/test/cookbooks/test_cookbook/metadata.rb +0 -6
  252. data/test/cookbooks/test_cookbook/recipes/default.rb +0 -1
  253. data/test/integration/default/default_spec.rb +0 -3
  254. data/testing_windows.md +0 -38
@@ -1,30 +0,0 @@
1
- ---
2
- title: Adding a New Feature
3
- slug: adding-feature
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 130
8
- ---
9
-
10
- Now we're going to add limited support to our Git cookbook for a read-only Git daemon. This will walk us through adding a new suite, recipe, and corresponding set of tests.
11
-
12
- > **We're not looking to make the perfect Chef cookbook in this guide. There will be more than a couple style and code smells as we go but this is to keep us focused on driving our tool. Think of it as a dirty first-pass implementation. Plenty of room for refactoring!**
13
-
14
- It seems like the reasonable thing to do would be to create another recipe in our Chef cookbook to deal with the Git server. After all, not every server that requires the Git tool needs to be a server. We are adding net-new behavior that needs to operate independently of the default recipe. So it's natural that we want to test these two behaviors in isolation.
15
-
16
- > **Testing different behaviors of a codebase in isolation is the primary use case for Kitchen Suites.**
17
-
18
- Now that we have a feel for developing a Chef cookbook with Kitchen let's up the ante and add this feature test-first. That is, let's determine the acceptance criteria for a simple Git daemon and encode this as an executable test.
19
-
20
- After consulting the web and the man page for `git-daemon`, two simple acceptance criteria emerge:
21
-
22
- * A process is listening on port `9418` (the default Git daemon port).
23
- * A service is running called `git-daemon`. This name is arbitrary but shouldn't surprise anyone using this cookbook.
24
-
25
- Let's work through this step by step.
26
-
27
- <div class="sidebar--footer">
28
- <a class="button primary-cta" href="/docs/getting-started/adding-suite">Next - Adding a Suite</a>
29
- <a class="sidebar--footer--back" href="/docs/getting-started/adding-platform">Back to previous step</a>
30
- </div>
@@ -1,60 +0,0 @@
1
- ---
2
- title: Adding a Suite
3
- slug: adding-suite
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 140
8
- ---
9
-
10
- We're going to call our new suite `"server"` by editing `.kitchen.yml` in your editor of choice so that it looks similar to:
11
-
12
- ~~~
13
- ---
14
- driver:
15
- name: vagrant
16
-
17
- provisioner:
18
- name: chef_zero
19
-
20
- verifier:
21
- name: inspec
22
-
23
- platforms:
24
- - name: ubuntu-16.04
25
- - name: centos-7
26
-
27
- suites:
28
- - name: default
29
- run_list:
30
- - recipe[git_cookbook::default]
31
- verifier:
32
- inspec_tests:
33
- - test/integration/default
34
- attributes:
35
- - name: server
36
- run_list:
37
- - recipe[git_cookbook::server]
38
- verifier:
39
- inspec_tests:
40
- - test/integration/server
41
- attributes:
42
- ~~~
43
-
44
- Now run `kitchen list` to see our new suite in action:
45
-
46
- ~~~
47
- $ kitchen list
48
- Instance Driver Provisioner Verifier Transport Last Action Last Error
49
- default-ubuntu-1604 Vagrant ChefZero Inspec Ssh <Not Created> <None>
50
- default-centos-7 Vagrant ChefZero Inspec Ssh <Not Created> <None>
51
- server-ubuntu-1604 Vagrant ChefZero Inspec Ssh <Not Created> <None>
52
- server-centos-7 Vagrant ChefZero Inspec Ssh <Not Created> <None>
53
- ~~~
54
-
55
- Woah, we've doubled our number of instances! Yes, that is going to happen. This explosion of test cases is just one reason why testing is hard.
56
-
57
- <div class="sidebar--footer">
58
- <a class="button primary-cta" href="/docs/getting-started/adding-test">Next - Adding a Test</a>
59
- <a class="sidebar--footer--back" href="/docs/getting-started/adding-feature">Back to previous step</a>
60
- </div>
@@ -1,66 +0,0 @@
1
- ---
2
- title: Adding a Test
3
- slug: adding-test
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 150
8
- ---
9
-
10
- Our first test was created for us automatically for us by our cookbook generator so here we will create the folders and files manually.
11
-
12
- First we're going to create a directory for our test file:
13
-
14
- ~~~
15
- mkdir -p test/integration/server
16
- ~~~
17
-
18
- Next, create a file called `test/integration/server/git_daemon_test.rb` with the following:
19
-
20
- ~~~
21
- # # encoding: utf-8
22
-
23
- # Inspec test for recipe git_cookbook::server
24
-
25
- describe port(9418) do
26
- it { should be_listening }
27
- end
28
-
29
- describe service('git-daemon') do
30
- it { should be_enabled }
31
- it { should be_running }
32
- end
33
- ~~~
34
-
35
- This test checks that a process is listening on port 9418 and a service called "git-daemon" is installed, enabled, and running.
36
-
37
- As our primary target platform was Ubuntu 16.04, we'll target this one first for development. Now, in Test-Driven style we'll run `kitchen verify` to watch our tests fail spectacularly:
38
-
39
- ~~~
40
- ...
41
- ================================================================================
42
- Recipe Compile Error
43
- ================================================================================
44
-
45
- Chef::Exceptions::RecipeNotFound
46
- --------------------------------
47
- could not find recipe server for cookbook git_cookbook
48
- ...
49
- ~~~
50
-
51
- One quick check of `kitchen list` tells us that our instance was created but not successfully converged:
52
-
53
- ~~~
54
- $ kitchen list server-ubuntu-1604
55
- Instance Driver Provisioner Verifier Transport Last Action Last Error
56
- server-ubuntu-1604 Vagrant ChefZero Inspec Ssh Created Kitchen::ActionFailed
57
- ~~~
58
-
59
- Yes, you can specify one or more instances with the same Ruby regular expression globbing as any other `kitchen` sub-commands.
60
-
61
- Okay, no recipe called `server` in our Git cookbook. Let's go create one.
62
-
63
- <div class="sidebar--footer">
64
- <a class="button primary-cta" href="/docs/getting-started/adding-recipe">Next - Adding a Recipe</a>
65
- <a class="sidebar--footer--back" href="/docs/getting-started/adding-suite">Back to previous step</a>
66
- </div>
@@ -1,53 +0,0 @@
1
- ---
2
- title: Adding a Recipe
3
- slug: adding-recipe
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 160
8
- ---
9
-
10
- As we've already added our tests, we have a pretty good idea of what needs to happen.
11
-
12
- With this solution in mind we'll create a file called `recipes/server.rb` with the following:
13
-
14
- ~~~
15
- # the default recipe is implied if only the cookbook name is provided
16
- # effectively `include_recipe "git_cookbook::default"`
17
- include_recipe "git_cookbook"
18
-
19
- # install the above `daemon_pkg`
20
- package 'git-daemon-run'
21
-
22
- # create our data directory
23
- directory '/opt/git'
24
-
25
- # setup the systemd unit (service) with the above `daemon_bin`, enable, and
26
- # start it
27
- systemd_unit 'git-daemon.service' do
28
- content <<-EOU.gsub(/^\s+/, '')
29
- [Unit]
30
- Description=Git Repositories Server Daemon
31
- Documentation=man:git-daemon(1)
32
-
33
- [Service]
34
- ExecStart=/usr/bin/git daemon \
35
- --reuseaddr \
36
- --base-path=/opt/git/ \
37
- /opt/git/
38
-
39
- [Install]
40
- WantedBy=getty.target
41
- DefaultInstance=tty1
42
- EOU
43
-
44
- action [ :create, :enable, :start ]
45
- end
46
- ~~~
47
-
48
- Before we give our new recipe a go, a quick detour to cover how we might exclude a particular platform from a suite's tests.
49
-
50
- <div class="sidebar--footer">
51
- <a class="button primary-cta" href="/docs/getting-started/excluding-platforms">Next - Excluding Platforms</a>
52
- <a class="sidebar--footer--back" href="/docs/getting-started/adding-test">Back to previous step</a>
53
- </div>
@@ -1,101 +0,0 @@
1
- ---
2
- title: Excluding Platforms
3
- slug: excluding-platforms
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 170
8
- ---
9
-
10
- Perhaps our enterprise has standardized on Ubuntu 16.04 for server tasks so we really only care about testing that our `server` recipe works on that platform. That said we still want to be able to test our default recipe against CentOS.
11
-
12
- Let's give `kitchen list` a look:
13
-
14
- ~~~
15
- $ kitchen list
16
- Instance Driver Provisioner Verifier Transport Last Action Last Error
17
- default-ubuntu-1604 Vagrant ChefZero Inspec Ssh <Not Created> <None>
18
- default-centos-7 Vagrant ChefZero Inspec Ssh <Not Created> <None>
19
- server-ubuntu-1604 Vagrant ChefZero Inspec Ssh Verified <None>
20
- server-centos-7 Vagrant ChefZero Inspec Ssh <Not Created> <None>
21
- ~~~
22
-
23
- > **Add a platform name to an `excludes` array in a suite to remove the platform/suite combination from testing.**
24
-
25
- Let's exclude the `centos-7` platform from the `server` suite so that it
26
- doesn't accidentally get run. Update `.kitchen.yml` to look like the following:
27
-
28
- ~~~
29
- ---
30
- driver:
31
- name: vagrant
32
-
33
- provisioner:
34
- name: chef_zero
35
-
36
- verifier:
37
- name: inspec
38
-
39
- platforms:
40
- - name: ubuntu-16.04
41
- - name: centos-7
42
-
43
- suites:
44
- - name: default
45
- run_list:
46
- - recipe[git_cookbook::default]
47
- verifier:
48
- inspec_tests:
49
- - test/integration/default
50
- attributes:
51
- - name: server
52
- run_list:
53
- - recipe[git_cookbook::server]
54
- verifier:
55
- inspec_tests:
56
- - test/integration/server
57
- attributes:
58
- excludes:
59
- - centos-7
60
- ~~~
61
-
62
- Now let's run `kitchen list` to ensure the instance is gone:
63
-
64
- ~~~
65
- $ kitchen list
66
- Instance Driver Provisioner Verifier Transport Last Action Last Error
67
- default-ubuntu-1604 Vagrant ChefZero Inspec Ssh <Not Created> <None>
68
- default-centos-7 Vagrant ChefZero Inspec Ssh <Not Created> <None>
69
- server-ubuntu-1604 Vagrant ChefZero Inspec Ssh Verified <None>
70
- ~~~
71
-
72
- Finally let's destroy our running instances:
73
-
74
- ~~~
75
- $ kitchen destroy
76
- -----> Starting Kitchen (v1.23.2)
77
- -----> Destroying <default-ubuntu-1604>...
78
- Finished destroying <default-ubuntu-1604> (0m0.00s).
79
- -----> Destroying <default-centos-7>...
80
- Finished destroying <default-centos-7> (0m0.00s).
81
- -----> Destroying <server-ubuntu-1604>...
82
- ==> default: Forcing shutdown of VM...
83
- ==> default: Destroying VM and associated drives...
84
- Vagrant instance <server-ubuntu-1604> destroyed.
85
- Finished destroying <server-ubuntu-1604> (0m12.55s).
86
- -----> Kitchen is finished. (0m17.39s)
87
- ~~~
88
-
89
- Now that we've completed our git daemon feature and made sure we're testing it on only the
90
- platform we care about we've come to the end of our guide!
91
-
92
- #### Congratulations!
93
-
94
- You've just written a valid Chef cookbook, complete with tests, that is ready to
95
- be improved upon further. Before you leave, check out some further resources to
96
- help you along your testing journey.
97
-
98
- <div class="sidebar--footer">
99
- <a class="button primary-cta" href="/docs/getting-started/next-steps">Next Steps</a>
100
- <a class="sidebar--footer--back" href="/docs/getting-started/adding-recipe">Back to previous step</a>
101
- </div>
@@ -1,23 +0,0 @@
1
- ---
2
- title: Next Steps
3
- slug: next-steps
4
- menu:
5
- docs:
6
- parent: getting_started
7
- weight: 180
8
- ---
9
-
10
- This concludes the getting started guide for kitchen. Hopefully you are now more comfortable with Kitchen's basic usage, fundamental concepts, and a feel for a testing workflow.
11
-
12
- From here, there are a few resources that can help you along your infrastructure testing journey:
13
-
14
- * Jump in the `#test-kitchen` channel on [Chef Community Slack](http://community-slack.chef.io/)
15
- * Check out the [test-kitchen repo](https://github.com/test-kitchen/test-kitchen) on GitHub
16
- * Submit an [issue](https://github.com/test-kitchen/test-kitchen/issues)
17
- * Write a blog post describing getting started with kitchen, or an interesting problem kitchen has allowed you to solve
18
-
19
- Everyone can contribute to making kitchen better, including the documentation. If you've learned something and want to contribute, please [fork the docs](https://github.com/test-kitchen/kitchen-docs) and open a [pull request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/)!
20
-
21
- <div class="sidebar--footer">
22
- <a class="sidebar--footer--back" href="/docs/getting-started/excluding-platforms">Back to previous step</a>
23
- </div>
@@ -1,5 +0,0 @@
1
- ---
2
- title: "Getting Started"
3
- layout: redirect
4
- redirect_url: /docs/getting-started/introduction
5
- ---
@@ -1,36 +0,0 @@
1
- ---
2
- title: Provisioners
3
- menu:
4
- docs:
5
- parent: provisioners
6
- weight: 1
7
- ---
8
-
9
- A Test-Kitchen *provisioner* takes care of configuring the compute instance provided by the *driver*. This is most commonly a configuration management framework like Chef or the Shell provisioner, both of which are included in test-kitchen by default.
10
-
11
- There are common settings that all provisioners inherit and can override. These are typically set in the context of a specific provisioner but are provided here for reference.
12
-
13
- ```
14
- provisioner:
15
- root_path: '/tmp/kitchen' # when platform is Windows '$env:TEMP\\kitchen'
16
- sudo: true # when platform is Windows, nil
17
- sudo_command: 'sudo -E' # when platform is Windows, nil
18
- command_prefix: nil # prefix the provisioner exec with a command
19
- http_proxy: nil
20
- https_proxy: nil
21
- ftp_proxy: nil
22
- retry_on_exit_code: []
23
- max_retries: 1
24
- wait_for_retry: 30
25
- downloads: # a Hash of remote => local file mappings to download post-converge
26
- # if the local value is an existing dir, the file will be copied into it
27
- # if the local value does not exist, a file with that value as name will be created
28
- "/tmp/kitchen/client.rb": "./downloads"
29
- "/tmp/kitchen/validation.pem": "./downloads/validation.pem"
30
- ```
31
-
32
- Community provisioners:
33
-
34
- * [kitchen-ansible](https://github.com/neillturner/kitchen-ansible)
35
- * [kitchen-puppet](https://github.com/neillturner/kitchen-puppet)
36
- * [kitchen-dsc](https://github.com/test-kitchen/kitchen-dsc)
@@ -1,69 +0,0 @@
1
- ---
2
- title: Chef
3
- slug: chef
4
- menu:
5
- docs:
6
- parent: provisioners
7
- weight: 5
8
- ---
9
-
10
- Test-kitchen includes two provisioners for Chef, `chef_solo` and `chef_zero`, which support nearly identical options.
11
-
12
- ```
13
- ---
14
- provisioner:
15
- name: chef_zero # chef_solo or chef_zero
16
- data_path: test/data # Path to directory of files to copy to instance
17
- data_bags_path: test/data_bags # Path to directory containing data_bags
18
- environments_path: test/envs # Path to directory containing environments
19
- encrypted_data_bag_secret_key_path: test/secret_key # Path to secret file
20
- nodes_path: test/nodes # Path to directory containing nodes
21
- roles_path: test/roles # Path to directory containing roles
22
- profile_ruby: false # true enables chef's Ruby profiling
23
- deprecations_as_errors: false # true configures chef to exception on deprecation warnings
24
- client_rb: # use solo_rb when chef_solo is used
25
- environment: kitchen # requires a corresponding file in environments_path
26
- silence_deprecation_warnings: # true for all or an array of deprecations to silence
27
- - deploy_resource # deprecation key name
28
- - chef-23 # deprecation numeric ID
29
- - recipes/install.rb:22 # specific line in a file
30
- product_name: chef # which package to install chef || chefdk
31
- product_version: latest # 'latest', partial, or full version number
32
- channel: stable # stable, current or unstable
33
- install_strategy: once # once (install only if needed), always, skip (don't install)
34
- download_url: https://url.to/specific-package.ext
35
- checksum: <SHA256> # used in conjunction with download_url to validate
36
-
37
- platforms:
38
- - name: ubuntu-16.04
39
- attributes:
40
- cookbook_a:
41
- attr_b: "value"
42
-
43
- suites:
44
- - name: default
45
- attributes:
46
- cookbook_b:
47
- attr_c: "value"
48
- run_list:
49
- - role[role_a] # requires a corresponding file in roles_path
50
- - recipe[cookbook_a]
51
- - recipe[cookbook_b::recipe_c]
52
- ```
53
-
54
- If not explicitly set, the following keys:
55
-
56
- - data_path
57
- - data_bags_path
58
- - encrypted_data_bag_secret_key_path
59
- - environments_path
60
- - nodes_path
61
- - roles_path
62
-
63
- Will be set to the first match, in the following order:
64
-
65
- 1. test/integration/$SUITE/$KEY
66
- 2. test/integration/$KEY
67
- 3. $KEY
68
-
69
- Where `$KEY` corresponds to a folder named `data, data_bags, environments, nodes, roles` - the exception being `encrypted_data_bag_secret_key_path` which looks for a file named `encrypted_data_bag_secret_key`.