inspec 0.9.7 → 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (365) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -2
  3. data/Gemfile +1 -0
  4. data/README.md +21 -2
  5. data/Rakefile +1 -1
  6. data/bin/inspec +25 -3
  7. data/bin/os +23 -0
  8. data/docs/dsl_resource.rst +90 -0
  9. data/docs/profiles.rst +167 -0
  10. data/docs/resources.rst +79 -0
  11. data/examples/README.md +1 -0
  12. data/examples/kitchen-ansible/.kitchen/logs/default-centos-71.log +0 -0
  13. data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1204.log +0 -0
  14. data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1404.log +432 -0
  15. data/examples/kitchen-ansible/.kitchen/logs/kitchen.log +10 -0
  16. data/examples/kitchen-ansible/Gemfile.lock +154 -0
  17. data/examples/kitchen-chef/.kitchen/default-centos-71.yml +6 -0
  18. data/examples/kitchen-chef/.kitchen/default-ubuntu-1204.yml +6 -0
  19. data/examples/kitchen-chef/.kitchen/default-ubuntu-1404.yml +6 -0
  20. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  21. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  22. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
  23. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  24. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
  25. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  26. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/Vagrantfile +9 -0
  27. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  28. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  29. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
  30. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  31. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
  32. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  33. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/Vagrantfile +9 -0
  34. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  35. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  36. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  37. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  38. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  39. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  40. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/Vagrantfile +9 -0
  41. data/examples/kitchen-chef/.kitchen/logs/default-centos-71.log +4 -0
  42. data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1204.log +4 -0
  43. data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1404.log +4 -0
  44. data/examples/kitchen-chef/.kitchen/logs/kitchen.log +8 -0
  45. data/examples/kitchen-chef/Berksfile.lock +11 -0
  46. data/examples/kitchen-chef/Gemfile.lock +223 -0
  47. data/examples/kitchen-puppet/.bundle/config +2 -0
  48. data/examples/kitchen-puppet/.kitchen/logs/default-centos-71.log +0 -0
  49. data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1204.log +0 -0
  50. data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1404.log +306 -0
  51. data/examples/kitchen-puppet/.kitchen/logs/kitchen.log +10 -0
  52. data/examples/kitchen-puppet/.librarian/puppet/config +2 -0
  53. data/examples/kitchen-puppet/Gemfile.lock +174 -0
  54. data/examples/kitchen-puppet/Puppetfile.lock +2 -0
  55. data/examples/profile/README.md +30 -0
  56. data/examples/profile/controls/example.rb +14 -0
  57. data/examples/profile/controls/gordon.rb +20 -0
  58. data/examples/profile/inspec.yml +10 -0
  59. data/examples/profile/libraries/.DS_Store +0 -0
  60. data/examples/profile/libraries/gordon_config.rb +17 -0
  61. data/examples/test-kitchen/.kitchen/logs/default-centos-71.log +5 -0
  62. data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1204.log +5 -0
  63. data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1404.log +5 -0
  64. data/examples/test-kitchen/.kitchen/logs/kitchen.log +5 -0
  65. data/examples/test-kitchen/Berksfile.lock +11 -0
  66. data/examples/test-kitchen/Gemfile.lock +233 -0
  67. data/inspec.gemspec +1 -1
  68. data/lib/.DS_Store +0 -0
  69. data/lib/inspec/archive/tar.rb +29 -0
  70. data/lib/inspec/archive/zip.rb +19 -0
  71. data/lib/inspec/metadata.rb +110 -15
  72. data/lib/inspec/profile.rb +88 -19
  73. data/lib/inspec/profile_context.rb +10 -4
  74. data/lib/inspec/resource.rb +1 -0
  75. data/lib/inspec/runner.rb +21 -4
  76. data/lib/inspec/targets.rb +2 -1
  77. data/lib/inspec/targets/archive.rb +39 -0
  78. data/lib/inspec/targets/core.rb +2 -2
  79. data/lib/inspec/targets/dir.rb +18 -2
  80. data/lib/inspec/targets/file.rb +4 -0
  81. data/lib/inspec/targets/folder.rb +21 -11
  82. data/lib/inspec/targets/tar.rb +36 -5
  83. data/lib/inspec/targets/url.rb +45 -13
  84. data/lib/inspec/targets/zip.rb +22 -15
  85. data/lib/inspec/version.rb +1 -1
  86. data/lib/matchers/matchers.rb +30 -0
  87. data/lib/resources/certificate.rb +0 -0
  88. data/lib/resources/etc_group.rb +1 -1
  89. data/lib/resources/file.rb +28 -3
  90. data/lib/resources/mount.rb +57 -0
  91. data/lib/resources/passwd.rb +1 -1
  92. data/lib/resources/private_key.rb +0 -0
  93. data/lib/resources/user.rb +3 -2
  94. data/lib/utils/hash.rb +29 -1
  95. data/lib/utils/parser.rb +34 -1
  96. data/lib/utils/simpleconfig.rb +1 -1
  97. data/test/chefdk/.gitignore +16 -0
  98. data/test/chefdk/.kitchen.yml +27 -0
  99. data/test/chefdk/Policyfile.rb +16 -0
  100. data/test/chefdk/README.md +4 -0
  101. data/test/chefdk/chefignore +100 -0
  102. data/test/chefdk/metadata.rb +7 -0
  103. data/test/chefdk/recipes/default.rb +5 -0
  104. data/test/chefdk/spec/spec_helper.rb +2 -0
  105. data/test/chefdk/spec/unit/recipes/default_spec.rb +20 -0
  106. data/test/chefdk/test/integration/default/serverspec/default_spec.rb +9 -0
  107. data/test/chefdk/test/integration/helpers/serverspec/spec_helper.rb +8 -0
  108. data/test/helper.rb +3 -1
  109. data/test/integration/.DS_Store +0 -0
  110. data/test/integration/.kitchen.ec2.yml +67 -0
  111. data/test/integration/.kitchen.local.yml +68 -0
  112. data/test/integration/.kitchen/default-aws-linux.yml +4 -0
  113. data/test/integration/.kitchen/default-centos-511.yml +6 -0
  114. data/test/integration/.kitchen/default-centos-67.yml +6 -0
  115. data/test/integration/.kitchen/default-centos-7.yml +4 -0
  116. data/test/integration/.kitchen/default-centos-71.yml +6 -0
  117. data/test/integration/.kitchen/default-debian-6010.yml +6 -0
  118. data/test/integration/.kitchen/default-debian-78.yml +6 -0
  119. data/test/integration/.kitchen/default-debian-8.yml +4 -0
  120. data/test/integration/.kitchen/default-debian-81.yml +6 -0
  121. data/test/integration/.kitchen/default-fedora-21.yml +6 -0
  122. data/test/integration/.kitchen/default-fedora-22.yml +4 -0
  123. data/test/integration/.kitchen/default-freebsd-102.yml +6 -0
  124. data/test/integration/.kitchen/default-freebsd-93.yml +6 -0
  125. data/test/integration/.kitchen/default-opensuse-132-x86-64.yml +6 -0
  126. data/test/integration/.kitchen/default-redhat-65.yml +4 -0
  127. data/test/integration/.kitchen/default-redhat-71.yml +4 -0
  128. data/test/integration/.kitchen/default-suse-11sp3.yml +4 -0
  129. data/test/integration/.kitchen/default-suse-12.yml +4 -0
  130. data/test/integration/.kitchen/default-ubuntu-1004.yml +6 -0
  131. data/test/integration/.kitchen/default-ubuntu-1204.yml +4 -0
  132. data/test/integration/.kitchen/default-ubuntu-1404.yml +4 -0
  133. data/test/integration/.kitchen/default-ubuntu-1510.yml +4 -0
  134. data/test/integration/.kitchen/default-windows-2012.yml +5 -0
  135. data/test/integration/.kitchen/default-windows-2012r2.yml +6 -0
  136. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  137. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  138. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/id +1 -0
  139. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  140. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/private_key +27 -0
  141. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  142. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-511/Vagrantfile +9 -0
  143. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67-i386/Vagrantfile +9 -0
  144. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  145. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  146. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/id +1 -0
  147. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  148. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/private_key +27 -0
  149. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  150. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67/Vagrantfile +9 -0
  151. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  152. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  153. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
  154. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  155. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
  156. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  157. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-71/Vagrantfile +9 -0
  158. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  159. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  160. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/id +1 -0
  161. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  162. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/private_key +27 -0
  163. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  164. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-6010/Vagrantfile +9 -0
  165. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  166. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  167. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/id +1 -0
  168. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  169. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/private_key +27 -0
  170. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  171. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-78/Vagrantfile +9 -0
  172. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  173. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  174. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/id +1 -0
  175. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  176. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/private_key +27 -0
  177. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  178. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-debian-81/Vagrantfile +9 -0
  179. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  180. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  181. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/id +1 -0
  182. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  183. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/private_key +27 -0
  184. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  185. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-21/Vagrantfile +9 -0
  186. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  187. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  188. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/id +1 -0
  189. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  190. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/private_key +27 -0
  191. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  192. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/Vagrantfile +9 -0
  193. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  194. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  195. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/id +1 -0
  196. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  197. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/private_key +27 -0
  198. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  199. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-102/Vagrantfile +9 -0
  200. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  201. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  202. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/id +1 -0
  203. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  204. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/private_key +27 -0
  205. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  206. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-freebsd-93/Vagrantfile +9 -0
  207. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  208. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  209. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/id +1 -0
  210. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  211. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/private_key +27 -0
  212. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  213. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-opensuse-132-x86-64/Vagrantfile +9 -0
  214. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  215. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  216. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/id +1 -0
  217. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  218. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/private_key +27 -0
  219. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  220. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1004/Vagrantfile +9 -0
  221. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  222. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  223. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
  224. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  225. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
  226. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  227. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/Vagrantfile +9 -0
  228. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  229. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  230. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  231. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  232. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  233. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  234. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/Vagrantfile +9 -0
  235. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-new-ubuntu-1404/Vagrantfile +9 -0
  236. data/test/integration/.kitchen/logs/default-aws-linux.log +0 -0
  237. data/test/integration/.kitchen/logs/default-centos-511-i386.log +0 -0
  238. data/test/integration/.kitchen/logs/default-centos-511.log +0 -0
  239. data/test/integration/.kitchen/logs/default-centos-67-i386.log +0 -0
  240. data/test/integration/.kitchen/logs/default-centos-67.log +0 -0
  241. data/test/integration/.kitchen/logs/default-centos-7.log +0 -0
  242. data/test/integration/.kitchen/logs/default-centos-71.log +0 -0
  243. data/test/integration/.kitchen/logs/default-debian-6010-i386.log +0 -0
  244. data/test/integration/.kitchen/logs/default-debian-6010.log +0 -0
  245. data/test/integration/.kitchen/logs/default-debian-78-i386.log +0 -0
  246. data/test/integration/.kitchen/logs/default-debian-78.log +0 -0
  247. data/test/integration/.kitchen/logs/default-debian-8.log +0 -0
  248. data/test/integration/.kitchen/logs/default-debian-81-i386.log +0 -0
  249. data/test/integration/.kitchen/logs/default-debian-81.log +0 -0
  250. data/test/integration/.kitchen/logs/default-fedora-21-i386.log +0 -0
  251. data/test/integration/.kitchen/logs/default-fedora-21.log +0 -0
  252. data/test/integration/.kitchen/logs/default-fedora-22.log +0 -0
  253. data/test/integration/.kitchen/logs/default-freebsd-102.log +0 -0
  254. data/test/integration/.kitchen/logs/default-freebsd-93.log +0 -0
  255. data/test/integration/.kitchen/logs/default-mint-172-cinnamon.log +0 -0
  256. data/test/integration/.kitchen/logs/default-opensuse-132-i386.log +0 -0
  257. data/test/integration/.kitchen/logs/default-opensuse-132-x86-64.log +0 -0
  258. data/test/integration/.kitchen/logs/default-redhat-65.log +0 -0
  259. data/test/integration/.kitchen/logs/default-redhat-71.log +0 -0
  260. data/test/integration/.kitchen/logs/default-suse-11sp3.log +0 -0
  261. data/test/integration/.kitchen/logs/default-suse-12.log +0 -0
  262. data/test/integration/.kitchen/logs/default-ubuntu-1004-i386.log +0 -0
  263. data/test/integration/.kitchen/logs/default-ubuntu-1004.log +0 -0
  264. data/test/integration/.kitchen/logs/default-ubuntu-1204-i386.log +0 -0
  265. data/test/integration/.kitchen/logs/default-ubuntu-1204.log +23 -0
  266. data/test/integration/.kitchen/logs/default-ubuntu-1404-i386.log +0 -0
  267. data/test/integration/.kitchen/logs/default-ubuntu-1404.log +0 -0
  268. data/test/integration/.kitchen/logs/default-ubuntu-1510.log +0 -0
  269. data/test/integration/.kitchen/logs/default-windows-2012.log +0 -0
  270. data/test/integration/.kitchen/logs/default-windows-2012r2.log +0 -0
  271. data/test/integration/.kitchen/logs/kitchen.log +3 -0
  272. data/test/integration/.kitchen/logs/new-centos-511-i386.log +0 -0
  273. data/test/integration/.kitchen/logs/new-centos-511.log +0 -0
  274. data/test/integration/.kitchen/logs/new-centos-67-i386.log +0 -0
  275. data/test/integration/.kitchen/logs/new-centos-67.log +0 -0
  276. data/test/integration/.kitchen/logs/new-centos-71.log +0 -0
  277. data/test/integration/.kitchen/logs/new-debian-6010-i386.log +0 -0
  278. data/test/integration/.kitchen/logs/new-debian-6010.log +0 -0
  279. data/test/integration/.kitchen/logs/new-debian-78-i386.log +0 -0
  280. data/test/integration/.kitchen/logs/new-debian-78.log +0 -0
  281. data/test/integration/.kitchen/logs/new-debian-81-i386.log +0 -0
  282. data/test/integration/.kitchen/logs/new-debian-81.log +0 -0
  283. data/test/integration/.kitchen/logs/new-fedora-21-i386.log +0 -0
  284. data/test/integration/.kitchen/logs/new-fedora-21.log +0 -0
  285. data/test/integration/.kitchen/logs/new-fedora-22.log +0 -0
  286. data/test/integration/.kitchen/logs/new-freebsd-102.log +0 -0
  287. data/test/integration/.kitchen/logs/new-freebsd-93.log +0 -0
  288. data/test/integration/.kitchen/logs/new-opensuse-132-i386.log +0 -0
  289. data/test/integration/.kitchen/logs/new-opensuse-132-x86-64.log +0 -0
  290. data/test/integration/.kitchen/logs/new-ubuntu-1004-i386.log +0 -0
  291. data/test/integration/.kitchen/logs/new-ubuntu-1004.log +0 -0
  292. data/test/integration/.kitchen/logs/new-ubuntu-1204-i386.log +0 -0
  293. data/test/integration/.kitchen/logs/new-ubuntu-1204.log +0 -0
  294. data/test/integration/.kitchen/logs/new-ubuntu-1404-i386.log +0 -0
  295. data/test/integration/.kitchen/logs/new-ubuntu-1404.log +3 -0
  296. data/test/integration/.kitchen/logs/test-centos-511-i386.log +0 -0
  297. data/test/integration/.kitchen/logs/test-centos-511.log +0 -0
  298. data/test/integration/.kitchen/logs/test-centos-67-i386.log +0 -0
  299. data/test/integration/.kitchen/logs/test-centos-67.log +0 -0
  300. data/test/integration/.kitchen/logs/test-centos-71.log +0 -0
  301. data/test/integration/.kitchen/logs/test-debian-6010-i386.log +0 -0
  302. data/test/integration/.kitchen/logs/test-debian-6010.log +0 -0
  303. data/test/integration/.kitchen/logs/test-debian-78-i386.log +0 -0
  304. data/test/integration/.kitchen/logs/test-debian-78.log +0 -0
  305. data/test/integration/.kitchen/logs/test-debian-81-i386.log +0 -0
  306. data/test/integration/.kitchen/logs/test-debian-81.log +0 -0
  307. data/test/integration/.kitchen/logs/test-fedora-21-i386.log +0 -0
  308. data/test/integration/.kitchen/logs/test-fedora-21.log +0 -0
  309. data/test/integration/.kitchen/logs/test-fedora-22.log +0 -0
  310. data/test/integration/.kitchen/logs/test-freebsd-102.log +0 -0
  311. data/test/integration/.kitchen/logs/test-freebsd-93.log +0 -0
  312. data/test/integration/.kitchen/logs/test-opensuse-132-i386.log +0 -0
  313. data/test/integration/.kitchen/logs/test-opensuse-132-x86-64.log +0 -0
  314. data/test/integration/.kitchen/logs/test-ubuntu-1004-i386.log +0 -0
  315. data/test/integration/.kitchen/logs/test-ubuntu-1004.log +0 -0
  316. data/test/integration/.kitchen/logs/test-ubuntu-1204-i386.log +0 -0
  317. data/test/integration/.kitchen/logs/test-ubuntu-1204.log +0 -0
  318. data/test/integration/.kitchen/logs/test-ubuntu-1404-i386.log +0 -0
  319. data/test/integration/.kitchen/logs/test-ubuntu-1404.log +0 -0
  320. data/test/integration/.kitchen/new-ubuntu-1404.yml +1 -0
  321. data/test/integration/Berksfile.lock +11 -0
  322. data/test/integration/TODO.md +15 -0
  323. data/test/integration/cookbooks/os_prepare/recipes/default.rb +1 -0
  324. data/test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb +13 -6
  325. data/test/integration/cookbooks/os_prepare/recipes/mount.rb +29 -0
  326. data/test/integration/test/.DS_Store +0 -0
  327. data/test/integration/test/integration/.DS_Store +0 -0
  328. data/test/integration/test/integration/default/.DS_Store +0 -0
  329. data/test/integration/test/integration/default/certificate_spec.rb +7 -0
  330. data/test/integration/test/integration/default/csv_spec.rb +7 -1
  331. data/test/integration/test/integration/default/file_spec.rb +29 -0
  332. data/test/integration/test/integration/default/ini_spec.rb +7 -1
  333. data/test/integration/test/integration/default/json_spec.rb +7 -1
  334. data/test/integration/test/integration/default/mount_spec.rb +10 -0
  335. data/test/integration/test/integration/default/yaml_spec.rb +7 -1
  336. data/test/serverspec/.kitchen.yml +18 -0
  337. data/test/serverspec/.kitchen/default-ubuntu-1404.yml +6 -0
  338. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  339. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  340. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  341. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  342. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  343. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  344. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/Vagrantfile +9 -0
  345. data/test/serverspec/.kitchen/logs/default-ubuntu-1404.log +2 -0
  346. data/test/serverspec/.kitchen/logs/kitchen.log +3 -0
  347. data/test/serverspec/Berksfile +3 -0
  348. data/test/serverspec/Berksfile.lock +5 -0
  349. data/test/serverspec/TODO.md +2 -0
  350. data/test/serverspec/test/integration/default/serverspec/os_spec.rb +25 -0
  351. data/test/serverspec/test/integration/default/serverspec/spec_helper.rb +48 -0
  352. data/test/serverspec/test/integration/default/serverspec/sysctl_spec.rb +37 -0
  353. data/test/unit/metadata_test.rb +69 -0
  354. data/test/unit/mock/cmd/mount +1 -0
  355. data/test/unit/mock/cmd/mount-multiple +2 -0
  356. data/test/unit/mock/profiles/complete-meta/metadata.rb +7 -0
  357. data/test/unit/mock/profiles/complete-meta/test/.gitkeep +0 -0
  358. data/test/unit/mock/profiles/complete-profile/controls/filesystem_spec.rb +16 -0
  359. data/test/unit/mock/profiles/complete-profile/inspec.yml +10 -0
  360. data/test/unit/profile_context_test.rb +2 -2
  361. data/test/unit/profile_test.rb +63 -6
  362. data/test/unit/resources/file_test.rb +4 -0
  363. data/test/unit/resources/mount_test.rb +26 -0
  364. data/test/unit/utils/{content_parser_test.rb → passwd_parser_test.rb} +2 -2
  365. metadata +588 -5
@@ -0,0 +1,57 @@
1
+ # encoding: utf-8
2
+ # author: Christoph Hartmann
3
+ # author: Dominik Richter
4
+
5
+ require 'utils/simpleconfig'
6
+
7
+ class Mount < Inspec.resource(1)
8
+ name 'mount'
9
+ desc 'Use the mount InSpec audit resource to test if mount points.'
10
+ example "
11
+ describe mount('/') do
12
+ it { should be_mounted }
13
+ its(:count) { should eq 1 }
14
+ its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
15
+ its('type') { should eq 'ext4' }
16
+ its('options') { should eq ['rw', 'mode=620'] }
17
+ end
18
+ "
19
+ include MountParser
20
+
21
+ attr_reader :file
22
+
23
+ def initialize(path)
24
+ @path = path
25
+ return skip_resource 'The `mount` resource is not supported on your OS yet.' if !inspec.os.linux?
26
+ @file = inspec.backend.file(@path)
27
+ end
28
+
29
+ def mounted?
30
+ file.mounted?
31
+ end
32
+
33
+ def count
34
+ mounted = file.mounted
35
+ return nil if mounted.nil? || mounted.stdout.nil?
36
+ mounted.stdout.lines.count
37
+ end
38
+
39
+ def method_missing(name)
40
+ return nil if !file.mounted?
41
+
42
+ mounted = file.mounted
43
+ return nil if mounted.nil? || mounted.stdout.nil?
44
+
45
+ line = mounted.stdout
46
+ # if we got multiple lines, only use the last entry
47
+ line = mounted.stdout.lines.to_a.last if mounted.stdout.lines.count > 1
48
+
49
+ # parse content if we are on linux
50
+ @mount_options ||= parse_mount_options(line)
51
+ @mount_options[name]
52
+ end
53
+
54
+ def to_s
55
+ "Mount #{@path}"
56
+ end
57
+ end
@@ -37,7 +37,7 @@ class Passwd < Inspec.resource(1)
37
37
  end
38
38
  "
39
39
 
40
- include ContentParser
40
+ include PasswdParser
41
41
 
42
42
  attr_reader :uid
43
43
  attr_reader :parsed
File without changes
@@ -230,7 +230,8 @@ class UnixUser < UserInfo
230
230
  end
231
231
 
232
232
  class LinuxUser < UnixUser
233
- include ContentParser
233
+ include PasswdParser
234
+ include CommentParser
234
235
 
235
236
  def meta_info(username)
236
237
  cmd = inspec.command("getent passwd #{username}")
@@ -295,7 +296,7 @@ end
295
296
  # - chpass(1) A flexible tool for changing user database information.
296
297
  # - passwd(1) The command-line tool to change user passwords.
297
298
  class FreeBSDUser < UnixUser
298
- include ContentParser
299
+ include PasswdParser
299
300
 
300
301
  def meta_info(username)
301
302
  cmd = inspec.command("pw usershow #{username} -7")
@@ -1,13 +1,41 @@
1
1
  # encoding: utf-8
2
- # Inspired by: http://stackoverflow.com/a/9381776
3
2
  # author: Dominik Richter
4
3
  # author: Christoph Hartmann
5
4
 
6
5
  class ::Hash
6
+ # Inspired by: http://stackoverflow.com/a/9381776
7
7
  def deep_merge(second)
8
8
  merger = proc { |_key, v1, v2|
9
9
  v1.is_a?(Hash) && v2.is_a?(Hash) ? v1.merge(v2, &merger) : v2
10
10
  }
11
11
  merge(second, &merger)
12
12
  end
13
+
14
+ # converts a deep hash into a flat hash
15
+ # hash = {
16
+ # 'a' => 1,
17
+ # 'b' => {'c' => 2},
18
+ # }
19
+ # hash.smash # => {"a"=>1, "b-c"=>2}
20
+ def smash(prefix = nil)
21
+ inject({}) do |acc, (key, value)|
22
+ index = prefix.to_s + key.to_s
23
+ if value.is_a?(Hash)
24
+ acc.merge(value.smash(index + '-'))
25
+ else
26
+ acc.merge(index => value)
27
+ end
28
+ end
29
+ end
30
+
31
+ # deep check if all values are contained
32
+ def contains(contains)
33
+ hash = smash
34
+ contains = contains.smash
35
+
36
+ contains.each do |key, val|
37
+ return false if hash[key] != val
38
+ end
39
+ true
40
+ end
13
41
  end
@@ -2,7 +2,7 @@
2
2
  # author: Christoph Hartmann
3
3
  # author: Dominik Richter
4
4
 
5
- module ContentParser
5
+ module PasswdParser
6
6
  # Parse /etc/passwd files.
7
7
  #
8
8
  # @param [String] content the raw content of /etc/passwd
@@ -29,7 +29,9 @@ module ContentParser
29
29
  'shell' => x.at(6),
30
30
  }
31
31
  end
32
+ end
32
33
 
34
+ module CommentParser
33
35
  # Parse a line with a command. For example: `a = b # comment`.
34
36
  # Retrieves the actual content.
35
37
  #
@@ -59,3 +61,34 @@ module ContentParser
59
61
  [line, idx_nl]
60
62
  end
61
63
  end
64
+
65
+ module MountParser
66
+ # this parses the output of mount command (only tested on linux)
67
+ # this method expects only one line of the mount output
68
+ def parse_mount_options(mount_line, compatibility = false)
69
+ mount = mount_line.scan(/\S+/)
70
+
71
+ # parse device and type
72
+ mount_options = { device: mount[0], type: mount[4] }
73
+
74
+ if compatibility == false
75
+ # parse options as array
76
+ mount_options[:options] = mount[5].gsub(/\(|\)/, '').split(',')
77
+ else
78
+ # parse options as serverspec uses it, tbis is deprecated
79
+ mount_options[:options] = {}
80
+ mount[5].gsub(/\(|\)/, '').split(',').each do |option|
81
+ name, val = option.split('=')
82
+ if val.nil?
83
+ val = true
84
+ else
85
+ # parse numbers
86
+ val = val.to_i if val.match(/^\d+$/)
87
+ end
88
+ mount_options[:options][name.to_sym] = val
89
+ end
90
+ end
91
+
92
+ mount_options
93
+ end
94
+ end
@@ -7,7 +7,7 @@
7
7
  require 'utils/parser'
8
8
 
9
9
  class SimpleConfig
10
- include ContentParser
10
+ include CommentParser
11
11
 
12
12
  attr_reader :params, :groups
13
13
  def initialize(raw_data, opts = {})
@@ -0,0 +1,16 @@
1
+ .vagrant
2
+ Berksfile.lock
3
+ *~
4
+ *#
5
+ .#*
6
+ \#*#
7
+ .*.sw[a-z]
8
+ *.un~
9
+
10
+ # Bundler
11
+ Gemfile.lock
12
+ bin/*
13
+ .bundle/*
14
+
15
+ .kitchen/
16
+ .kitchen.local.yml
@@ -0,0 +1,27 @@
1
+ ---
2
+ driver:
3
+ name: vagrant
4
+
5
+ ## The forwarded_port port feature lets you connect to ports on the VM guest via
6
+ ## localhost on the host.
7
+ ## see also: https://docs.vagrantup.com/v2/networking/forwarded_ports.html
8
+
9
+ # network:
10
+ # - ["forwarded_port", {guest: 80, host: 8080}]
11
+
12
+ provisioner:
13
+ name: policyfile_zero
14
+
15
+ ## require_chef_omnibus specifies a specific chef version to install. You can
16
+ ## also set this to `true` to always use the latest version.
17
+ ## see also: https://docs.chef.io/config_yml_kitchen.html
18
+
19
+ # require_chef_omnibus: 12.5.0
20
+
21
+ platforms:
22
+ - name: ubuntu-14.04
23
+ - name: centos-7.1
24
+
25
+ suites:
26
+ - name: default
27
+ attributes:
@@ -0,0 +1,16 @@
1
+ # Policyfile.rb - Describe how you want Chef to build your system.
2
+ #
3
+ # For more information on the Policyfile feature, visit
4
+ # https://github.com/opscode/chef-dk/blob/master/POLICYFILE_README.md
5
+
6
+ # A name that describes what the system you're building with Chef does.
7
+ name "chefdk"
8
+
9
+ # Where to find external cookbooks:
10
+ default_source :supermarket
11
+
12
+ # run_list: chef-client will run these recipes in the order specified.
13
+ run_list "chefdk::default"
14
+
15
+ # Specify a custom source for a single cookbook:
16
+ cookbook "chefdk", path: "."
@@ -0,0 +1,4 @@
1
+ # chefdk
2
+
3
+ TODO: Enter the cookbook description here.
4
+
@@ -0,0 +1,100 @@
1
+ # Put files/directories that should be ignored in this file when uploading
2
+ # or sharing to the community site.
3
+ # Lines that start with '# ' are comments.
4
+
5
+ # OS generated files #
6
+ ######################
7
+ .DS_Store
8
+ Icon?
9
+ nohup.out
10
+ ehthumbs.db
11
+ Thumbs.db
12
+
13
+ # SASS #
14
+ ########
15
+ .sass-cache
16
+
17
+ # EDITORS #
18
+ ###########
19
+ \#*
20
+ .#*
21
+ *~
22
+ *.sw[a-z]
23
+ *.bak
24
+ REVISION
25
+ TAGS*
26
+ tmtags
27
+ *_flymake.*
28
+ *_flymake
29
+ *.tmproj
30
+ .project
31
+ .settings
32
+ mkmf.log
33
+
34
+ ## COMPILED ##
35
+ ##############
36
+ a.out
37
+ *.o
38
+ *.pyc
39
+ *.so
40
+ *.com
41
+ *.class
42
+ *.dll
43
+ *.exe
44
+ */rdoc/
45
+
46
+ # Testing #
47
+ ###########
48
+ .watchr
49
+ .rspec
50
+ spec/*
51
+ spec/fixtures/*
52
+ test/*
53
+ features/*
54
+ examples/*
55
+ Guardfile
56
+ Procfile
57
+ .kitchen*
58
+ .rubocop.yml
59
+
60
+ # SCM #
61
+ #######
62
+ .git
63
+ */.git
64
+ .gitignore
65
+ .gitmodules
66
+ .gitconfig
67
+ .gitattributes
68
+ .svn
69
+ */.bzr/*
70
+ */.hg/*
71
+ */.svn/*
72
+
73
+ # Berkshelf #
74
+ #############
75
+ Berksfile
76
+ Berksfile.lock
77
+ cookbooks/*
78
+ tmp
79
+
80
+ # Cookbooks #
81
+ #############
82
+ CONTRIBUTING*
83
+ CHANGELOG*
84
+ TESTING*
85
+
86
+ # Strainer #
87
+ ############
88
+ Colanderfile
89
+ Strainerfile
90
+ .colander
91
+ .strainer
92
+
93
+ # Vagrant #
94
+ ###########
95
+ .vagrant
96
+ Vagrantfile
97
+
98
+ # Travis #
99
+ ##########
100
+ .travis.yml
@@ -0,0 +1,7 @@
1
+ name 'chefdk'
2
+ maintainer 'The Authors'
3
+ maintainer_email 'you@example.com'
4
+ license 'all_rights'
5
+ description 'Installs/Configures chefdk'
6
+ long_description 'Installs/Configures chefdk'
7
+ version '0.1.0'
@@ -0,0 +1,5 @@
1
+ #
2
+ # Cookbook Name:: chefdk
3
+ # Recipe:: default
4
+ #
5
+ # Copyright (c) 2015 The Authors, All Rights Reserved.
@@ -0,0 +1,2 @@
1
+ require 'chefspec'
2
+ require 'chefspec/berkshelf'
@@ -0,0 +1,20 @@
1
+ #
2
+ # Cookbook Name:: chefdk
3
+ # Spec:: default
4
+ #
5
+ # Copyright (c) 2015 The Authors, All Rights Reserved.
6
+
7
+ require 'spec_helper'
8
+
9
+ describe 'chefdk::default' do
10
+ context 'When all attributes are default, on an unspecified platform' do
11
+ let(:chef_run) do
12
+ runner = ChefSpec::ServerRunner.new
13
+ runner.converge(described_recipe)
14
+ end
15
+
16
+ it 'converges successfully' do
17
+ expect { chef_run }.to_not raise_error
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'chefdk::default' do
4
+ # Serverspec examples can be found at
5
+ # http://serverspec.org/resource_types.html
6
+ it 'does something' do
7
+ skip 'Replace this with meaningful tests'
8
+ end
9
+ end
@@ -0,0 +1,8 @@
1
+ require 'serverspec'
2
+
3
+ if (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM).nil?
4
+ set :backend, :exec
5
+ else
6
+ set :backend, :cmd
7
+ set :os, family: 'windows'
8
+ end
@@ -196,7 +196,9 @@ class MockLoader
196
196
  # apache_conf
197
197
  'find /etc/apache2/ports.conf -maxdepth 1 -type f' => cmd.call('find-apache2-ports-conf'),
198
198
  'find /etc/apache2/conf-enabled/*.conf -maxdepth 1 -type f' => cmd.call('find-apache2-conf-enabled'),
199
-
199
+ # mount
200
+ "mount | grep -- ' on /'" => cmd.call("mount"),
201
+ "mount | grep -- ' on /mnt/iso-disk'" => cmd.call("mount-multiple"),
200
202
  }
201
203
 
202
204
  @backend
@@ -0,0 +1,67 @@
1
+ driver:
2
+ name: ec2
3
+ region: eu-central-1
4
+ instance_type: m3.large
5
+ associate_public_ip: true
6
+ interface: dns
7
+
8
+ transport:
9
+ ssh_key: /path/to/aws.pem
10
+ username: ec2-user
11
+
12
+ platforms:
13
+ - name: windows-2012
14
+ driver:
15
+ image_id: ami-58f7fb45
16
+ transport:
17
+ username: administrator
18
+ - name: windows-2012r2
19
+ driver:
20
+ image_id: ami-f2f5f9ef
21
+ transport:
22
+ username: administrator
23
+ - name: suse-11sp3
24
+ driver:
25
+ image_id: ami-fc0033e1
26
+ - name: suse-12
27
+ driver:
28
+ image_id: ami-a22610bf
29
+ - name: redhat-65
30
+ driver:
31
+ image_id: ami-008ebf1d
32
+ - name: redhat-71
33
+ driver:
34
+ image_id: ami-dafdcfc7
35
+ - name: ubuntu-1204
36
+ driver:
37
+ image_id: ami-24232f39
38
+ transport:
39
+ username: ubuntu
40
+ - name: ubuntu-1404
41
+ driver:
42
+ image_id: ami-48272b55
43
+ transport:
44
+ username: ubuntu
45
+ - name: ubuntu-1510
46
+ driver:
47
+ image_id: ami-1b4a5977
48
+ transport:
49
+ username: ubuntu
50
+ - name: fedora-22
51
+ driver:
52
+ image_id: ami-a88eb0b5
53
+ transport:
54
+ username: fedora
55
+ - name: debian-8
56
+ driver:
57
+ image_id: ami-b092aaad
58
+ transport:
59
+ username: admin
60
+ - name: centos-7
61
+ driver:
62
+ image_id: ami-e68f82fb
63
+ transport:
64
+ username: centos
65
+ - name: aws-linux
66
+ driver:
67
+ image_id: ami-daaeaec7