inspec 0.9.9 → 0.9.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -2
  3. data/README.md +5 -1
  4. data/bin/os +23 -0
  5. data/examples/kitchen-ansible/.kitchen/default-centos-71.yml +6 -0
  6. data/examples/kitchen-ansible/.kitchen/default-ubuntu-1204.yml +6 -0
  7. data/examples/kitchen-ansible/.kitchen/default-ubuntu-1404.yml +6 -0
  8. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  9. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  10. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
  11. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  12. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
  13. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  14. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-centos-71/Vagrantfile +9 -0
  15. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  16. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  17. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
  18. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  19. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
  20. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  21. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1204/Vagrantfile +9 -0
  22. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  23. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  24. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  25. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  26. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  27. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  28. data/examples/kitchen-ansible/.kitchen/kitchen-vagrant/kitchen-kitchen-ansible-default-ubuntu-1404/Vagrantfile +9 -0
  29. data/examples/kitchen-ansible/.kitchen/logs/default-centos-71.log +4 -0
  30. data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1204.log +4 -0
  31. data/examples/kitchen-ansible/.kitchen/logs/default-ubuntu-1404.log +4 -0
  32. data/examples/kitchen-ansible/.kitchen/logs/kitchen.log +8 -0
  33. data/examples/kitchen-ansible/Gemfile.lock +154 -0
  34. data/examples/kitchen-chef/.kitchen/default-centos-71.yml +6 -0
  35. data/examples/kitchen-chef/.kitchen/default-ubuntu-1204.yml +6 -0
  36. data/examples/kitchen-chef/.kitchen/default-ubuntu-1404.yml +6 -0
  37. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  38. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  39. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/id +1 -0
  40. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  41. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/private_key +27 -0
  42. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  43. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-centos-71/Vagrantfile +9 -0
  44. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  45. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  46. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
  47. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  48. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
  49. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  50. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1204/Vagrantfile +9 -0
  51. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  52. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  53. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  54. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  55. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  56. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  57. data/examples/kitchen-chef/.kitchen/kitchen-vagrant/kitchen-kitchen-chef-default-ubuntu-1404/Vagrantfile +9 -0
  58. data/examples/kitchen-chef/.kitchen/logs/default-centos-71.log +4 -0
  59. data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1204.log +4 -0
  60. data/examples/kitchen-chef/.kitchen/logs/default-ubuntu-1404.log +4 -0
  61. data/examples/kitchen-chef/.kitchen/logs/kitchen.log +8 -0
  62. data/examples/kitchen-chef/Berksfile.lock +11 -0
  63. data/examples/kitchen-chef/Gemfile.lock +223 -0
  64. data/examples/kitchen-puppet/.bundle/config +2 -0
  65. data/examples/kitchen-puppet/.kitchen/logs/default-centos-71.log +5 -0
  66. data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1204.log +5 -0
  67. data/examples/kitchen-puppet/.kitchen/logs/default-ubuntu-1404.log +5 -0
  68. data/examples/kitchen-puppet/.kitchen/logs/kitchen.log +5 -0
  69. data/examples/kitchen-puppet/.librarian/puppet/config +2 -0
  70. data/examples/kitchen-puppet/Gemfile.lock +174 -0
  71. data/examples/kitchen-puppet/Puppetfile.lock +2 -0
  72. data/examples/profile/libraries/.DS_Store +0 -0
  73. data/examples/test-kitchen/.kitchen/logs/default-centos-71.log +5 -0
  74. data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1204.log +5 -0
  75. data/examples/test-kitchen/.kitchen/logs/default-ubuntu-1404.log +5 -0
  76. data/examples/test-kitchen/.kitchen/logs/kitchen.log +5 -0
  77. data/examples/test-kitchen/Berksfile.lock +11 -0
  78. data/examples/test-kitchen/Gemfile.lock +233 -0
  79. data/inspec.gemspec +2 -2
  80. data/lib/.DS_Store +0 -0
  81. data/lib/extras/compliance/README.md +15 -0
  82. data/lib/extras/compliance/compliance.rb +245 -0
  83. data/lib/inspec/metadata.rb +3 -1
  84. data/lib/inspec/profile.rb +2 -0
  85. data/lib/inspec/profile_context.rb +34 -63
  86. data/lib/inspec/resource.rb +23 -0
  87. data/lib/inspec/runner.rb +17 -35
  88. data/lib/inspec/runner_mock.rb +31 -0
  89. data/lib/inspec/runner_rspec.rb +94 -0
  90. data/lib/inspec/targets/dir.rb +2 -4
  91. data/lib/inspec/version.rb +1 -1
  92. data/{test/unit/mock/profiles/complete-meta/test/.gitkeep → lib/resources/certificate.rb} +0 -0
  93. data/lib/resources/command.rb +1 -1
  94. data/lib/resources/postgres_session.rb +10 -15
  95. data/{test/unit/mock/profiles/custom-resource/test/.gitkeep → lib/resources/private_key.rb} +0 -0
  96. data/lib/resources/registry_key.rb +10 -6
  97. data/lib/resources/service.rb +232 -63
  98. data/test/chefdk/.gitignore +16 -0
  99. data/test/chefdk/.kitchen.yml +27 -0
  100. data/test/chefdk/Policyfile.rb +16 -0
  101. data/test/chefdk/README.md +4 -0
  102. data/test/chefdk/chefignore +100 -0
  103. data/test/chefdk/metadata.rb +7 -0
  104. data/test/chefdk/recipes/default.rb +5 -0
  105. data/test/chefdk/spec/spec_helper.rb +2 -0
  106. data/test/chefdk/spec/unit/recipes/default_spec.rb +20 -0
  107. data/test/chefdk/test/integration/default/serverspec/default_spec.rb +9 -0
  108. data/test/chefdk/test/integration/helpers/serverspec/spec_helper.rb +8 -0
  109. data/test/docker_run.rb +5 -1
  110. data/test/docker_test.rb +1 -2
  111. data/test/helper.rb +1 -0
  112. data/test/integration/.kitchen/default-aws-linux.yml +4 -0
  113. data/test/integration/.kitchen/default-centos-7.yml +4 -0
  114. data/test/integration/.kitchen/default-debian-8.yml +4 -0
  115. data/test/integration/.kitchen/default-fedora-22.yml +4 -0
  116. data/test/integration/.kitchen/default-redhat-65.yml +4 -0
  117. data/test/integration/.kitchen/default-redhat-71.yml +4 -0
  118. data/test/integration/.kitchen/default-suse-11sp3.yml +4 -0
  119. data/test/integration/.kitchen/default-suse-12.yml +4 -0
  120. data/test/integration/.kitchen/default-ubuntu-1204.yml +3 -0
  121. data/test/integration/.kitchen/default-ubuntu-1404.yml +4 -0
  122. data/test/integration/.kitchen/default-windows-2012.yml +1 -0
  123. data/test/integration/.kitchen/default-windows-2012r2.yml +2 -0
  124. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-centos-67-i386/Vagrantfile +9 -0
  125. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  126. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  127. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/id +1 -0
  128. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  129. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/private_key +27 -0
  130. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  131. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-fedora-22/Vagrantfile +9 -0
  132. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-modernIE-w10-edge/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  133. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-modernIE-w10-edge/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  134. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-modernIE-w10-edge/.vagrant/machines/default/virtualbox/id +1 -0
  135. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-modernIE-w10-edge/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  136. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-modernIE-w10-edge/Vagrantfile +8 -0
  137. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  138. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  139. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/id +1 -0
  140. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  141. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/private_key +27 -0
  142. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  143. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1204/Vagrantfile +9 -0
  144. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  145. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  146. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  147. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  148. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  149. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  150. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-ubuntu-1404/Vagrantfile +9 -0
  151. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-windows-2012R2-matt/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  152. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-windows-2012R2-matt/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  153. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-windows-2012R2-matt/.vagrant/machines/default/virtualbox/id +1 -0
  154. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-windows-2012R2-matt/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  155. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-default-windows-2012R2-matt/Vagrantfile +8 -0
  156. data/test/integration/.kitchen/kitchen-vagrant/kitchen-integration-new-ubuntu-1404/Vagrantfile +9 -0
  157. data/test/{unit/mock/profiles/empty/metadata.rb → integration/.kitchen/logs/default-aws-linux.log} +0 -0
  158. data/test/integration/.kitchen/logs/default-centos-511-i386.log +2 -0
  159. data/test/integration/.kitchen/logs/default-centos-511.log +2 -0
  160. data/test/integration/.kitchen/logs/default-centos-67-i386.log +2 -0
  161. data/test/integration/.kitchen/logs/default-centos-67.log +2 -0
  162. data/test/integration/.kitchen/logs/default-centos-7.log +0 -0
  163. data/test/integration/.kitchen/logs/default-centos-71.log +2 -0
  164. data/test/integration/.kitchen/logs/default-debian-6010-i386.log +2 -0
  165. data/test/integration/.kitchen/logs/default-debian-6010.log +2 -0
  166. data/test/integration/.kitchen/logs/default-debian-78-i386.log +2 -0
  167. data/test/integration/.kitchen/logs/default-debian-78.log +2 -0
  168. data/test/integration/.kitchen/logs/default-debian-8.log +0 -0
  169. data/test/integration/.kitchen/logs/default-debian-81-i386.log +2 -0
  170. data/test/integration/.kitchen/logs/default-debian-81.log +2 -0
  171. data/test/integration/.kitchen/logs/default-fedora-21-i386.log +2 -0
  172. data/test/integration/.kitchen/logs/default-fedora-21.log +2 -0
  173. data/test/integration/.kitchen/logs/default-fedora-22.log +0 -0
  174. data/test/integration/.kitchen/logs/default-freebsd-102.log +2 -0
  175. data/test/integration/.kitchen/logs/default-freebsd-93.log +2 -0
  176. data/test/integration/.kitchen/logs/default-mint-172-cinnamon.log +2 -0
  177. data/test/integration/.kitchen/logs/default-modernIE-w10-edge.log +2 -0
  178. data/test/integration/.kitchen/logs/default-modernIE-w7-ie11.log +2 -0
  179. data/test/integration/.kitchen/logs/default-modernIE-w81-ie11.log +2 -0
  180. data/test/integration/.kitchen/logs/default-opensuse-132-i386.log +2 -0
  181. data/test/integration/.kitchen/logs/default-opensuse-132-x86-64.log +2 -0
  182. data/test/integration/.kitchen/logs/default-opentable-win-2008r2-standard-amd64-nocm.log +0 -0
  183. data/test/integration/.kitchen/logs/default-opentable-win-2012r2-standard-amd64-nocm.log +0 -0
  184. data/test/integration/.kitchen/logs/default-redhat-65.log +0 -0
  185. data/test/integration/.kitchen/logs/default-redhat-71.log +0 -0
  186. data/test/integration/.kitchen/logs/default-suse-11sp3.log +0 -0
  187. data/test/integration/.kitchen/logs/default-suse-12.log +0 -0
  188. data/test/integration/.kitchen/logs/default-ubuntu-1004-i386.log +2 -0
  189. data/test/integration/.kitchen/logs/default-ubuntu-1004.log +2 -0
  190. data/test/integration/.kitchen/logs/default-ubuntu-1204-i386.log +2 -0
  191. data/test/integration/.kitchen/logs/default-ubuntu-1204.log +0 -0
  192. data/test/integration/.kitchen/logs/default-ubuntu-1404-i386.log +2 -0
  193. data/test/integration/.kitchen/logs/default-ubuntu-1404.log +0 -0
  194. data/test/integration/.kitchen/logs/default-ubuntu-1510.log +0 -0
  195. data/test/integration/.kitchen/logs/default-windows-2008-opentable.log +2 -0
  196. data/test/integration/.kitchen/logs/default-windows-2008.log +0 -0
  197. data/test/integration/.kitchen/logs/default-windows-2012.log +0 -0
  198. data/test/integration/.kitchen/logs/default-windows-2012R2-matt.log +2 -0
  199. data/test/integration/.kitchen/logs/default-windows-2012r2-opentable.log +2 -0
  200. data/test/integration/.kitchen/logs/default-windows-2012r2.log +41 -0
  201. data/test/integration/.kitchen/logs/kitchen.log +0 -0
  202. data/test/integration/.kitchen/logs/new-centos-511-i386.log +0 -0
  203. data/test/integration/.kitchen/logs/new-centos-511.log +0 -0
  204. data/test/integration/.kitchen/logs/new-centos-67-i386.log +0 -0
  205. data/test/integration/.kitchen/logs/new-centos-67.log +0 -0
  206. data/test/integration/.kitchen/logs/new-centos-71.log +0 -0
  207. data/test/integration/.kitchen/logs/new-debian-6010-i386.log +0 -0
  208. data/test/integration/.kitchen/logs/new-debian-6010.log +0 -0
  209. data/test/integration/.kitchen/logs/new-debian-78-i386.log +0 -0
  210. data/test/integration/.kitchen/logs/new-debian-78.log +0 -0
  211. data/test/integration/.kitchen/logs/new-debian-81-i386.log +0 -0
  212. data/test/integration/.kitchen/logs/new-debian-81.log +0 -0
  213. data/test/integration/.kitchen/logs/new-fedora-21-i386.log +0 -0
  214. data/test/integration/.kitchen/logs/new-fedora-21.log +0 -0
  215. data/test/integration/.kitchen/logs/new-fedora-22.log +0 -0
  216. data/test/integration/.kitchen/logs/new-freebsd-102.log +0 -0
  217. data/test/integration/.kitchen/logs/new-freebsd-93.log +0 -0
  218. data/test/integration/.kitchen/logs/new-opensuse-132-i386.log +0 -0
  219. data/test/integration/.kitchen/logs/new-opensuse-132-x86-64.log +0 -0
  220. data/test/integration/.kitchen/logs/new-ubuntu-1004-i386.log +0 -0
  221. data/test/integration/.kitchen/logs/new-ubuntu-1004.log +0 -0
  222. data/test/integration/.kitchen/logs/new-ubuntu-1204-i386.log +0 -0
  223. data/test/integration/.kitchen/logs/new-ubuntu-1204.log +0 -0
  224. data/test/integration/.kitchen/logs/new-ubuntu-1404-i386.log +0 -0
  225. data/test/integration/.kitchen/logs/new-ubuntu-1404.log +3 -0
  226. data/test/integration/.kitchen/logs/test-centos-511-i386.log +0 -0
  227. data/test/integration/.kitchen/logs/test-centos-511.log +0 -0
  228. data/test/integration/.kitchen/logs/test-centos-67-i386.log +0 -0
  229. data/test/integration/.kitchen/logs/test-centos-67.log +0 -0
  230. data/test/integration/.kitchen/logs/test-centos-71.log +0 -0
  231. data/test/integration/.kitchen/logs/test-debian-6010-i386.log +0 -0
  232. data/test/integration/.kitchen/logs/test-debian-6010.log +0 -0
  233. data/test/integration/.kitchen/logs/test-debian-78-i386.log +0 -0
  234. data/test/integration/.kitchen/logs/test-debian-78.log +0 -0
  235. data/test/integration/.kitchen/logs/test-debian-81-i386.log +0 -0
  236. data/test/integration/.kitchen/logs/test-debian-81.log +0 -0
  237. data/test/integration/.kitchen/logs/test-fedora-21-i386.log +0 -0
  238. data/test/integration/.kitchen/logs/test-fedora-21.log +0 -0
  239. data/test/integration/.kitchen/logs/test-fedora-22.log +0 -0
  240. data/test/integration/.kitchen/logs/test-freebsd-102.log +0 -0
  241. data/test/integration/.kitchen/logs/test-freebsd-93.log +0 -0
  242. data/test/integration/.kitchen/logs/test-opensuse-132-i386.log +0 -0
  243. data/test/integration/.kitchen/logs/test-opensuse-132-x86-64.log +0 -0
  244. data/test/integration/.kitchen/logs/test-ubuntu-1004-i386.log +0 -0
  245. data/test/integration/.kitchen/logs/test-ubuntu-1004.log +0 -0
  246. data/test/integration/.kitchen/logs/test-ubuntu-1204-i386.log +0 -0
  247. data/test/integration/.kitchen/logs/test-ubuntu-1204.log +0 -0
  248. data/test/integration/.kitchen/logs/test-ubuntu-1404-i386.log +0 -0
  249. data/test/integration/.kitchen/logs/test-ubuntu-1404.log +0 -0
  250. data/test/integration/.kitchen/new-ubuntu-1404.yml +1 -0
  251. data/test/integration/Berksfile +1 -0
  252. data/test/integration/Berksfile.lock +27 -0
  253. data/test/integration/TODO.md +15 -0
  254. data/test/integration/cookbooks/os_prepare/files/empty.iso +0 -0
  255. data/test/integration/cookbooks/os_prepare/metadata.rb +2 -0
  256. data/test/integration/cookbooks/os_prepare/recipes/_runit_service_centos.rb +34 -0
  257. data/test/integration/cookbooks/os_prepare/recipes/default.rb +1 -0
  258. data/test/integration/cookbooks/os_prepare/recipes/mount.rb +5 -5
  259. data/test/integration/cookbooks/os_prepare/recipes/postgres.rb +12 -0
  260. data/test/integration/cookbooks/os_prepare/recipes/service.rb +6 -2
  261. data/test/integration/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb +3 -0
  262. data/test/integration/test/.DS_Store +0 -0
  263. data/test/integration/test/integration/.DS_Store +0 -0
  264. data/test/integration/test/integration/default/.DS_Store +0 -0
  265. data/test/integration/test/integration/default/certificate_spec.rb +7 -0
  266. data/test/integration/test/integration/default/file_spec.rb +2 -2
  267. data/test/integration/test/integration/default/mount_spec.rb +1 -1
  268. data/test/integration/test/integration/default/postgres_session_spec.rb +9 -0
  269. data/test/integration/test/integration/default/service_spec.rb +34 -0
  270. data/test/mac/service_spec.rb +5 -0
  271. data/test/serverspec/.kitchen.yml +18 -0
  272. data/test/serverspec/.kitchen/default-ubuntu-1404.yml +6 -0
  273. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/action_set_name +1 -0
  274. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/creator_uid +1 -0
  275. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/id +1 -0
  276. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/index_uuid +1 -0
  277. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key +27 -0
  278. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/synced_folders +1 -0
  279. data/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/Vagrantfile +9 -0
  280. data/test/serverspec/.kitchen/logs/default-ubuntu-1404.log +2 -0
  281. data/test/serverspec/.kitchen/logs/kitchen.log +3 -0
  282. data/test/serverspec/Berksfile +3 -0
  283. data/test/serverspec/Berksfile.lock +5 -0
  284. data/test/serverspec/TODO.md +2 -0
  285. data/test/serverspec/test/integration/default/serverspec/os_spec.rb +25 -0
  286. data/test/serverspec/test/integration/default/serverspec/spec_helper.rb +48 -0
  287. data/test/serverspec/test/integration/default/serverspec/sysctl_spec.rb +37 -0
  288. data/test/unit/metadata_test.rb +13 -1
  289. data/test/unit/mock/profiles/complete-metadata/inspec.yml +7 -0
  290. data/test/unit/mock/profiles/empty-metadata/inspec.yml +0 -0
  291. data/test/unit/mock/profiles/{complete-meta → legacy-complete-metadata}/metadata.rb +0 -0
  292. data/test/unit/mock/profiles/legacy-complete-metadata/test/.gitkeep +0 -0
  293. data/test/unit/mock/profiles/legacy-empty-metadata/controls/.gitkeep +0 -0
  294. data/test/unit/mock/profiles/legacy-empty-metadata/metadata.rb +0 -0
  295. data/test/unit/mock/profiles/{metadata → legacy-simple-metadata}/metadata.rb +0 -0
  296. data/test/unit/mock/profiles/legacy-simple-metadata/test/.gitkeep +0 -0
  297. data/test/unit/mock/profiles/simple-metadata/inspec.yml +1 -0
  298. data/test/unit/profile_test.rb +82 -31
  299. data/test/unit/resources/service_test.rb +67 -3
  300. metadata +466 -23
  301. data/examples/resource/controls/tiny.rb +0 -3
  302. data/examples/resource/inspec.yml +0 -10
  303. data/examples/resource/libraries/tiny.rb +0 -3
  304. data/lib/inspec/targets/url.rb.orig +0 -87
  305. data/test/unit/mock/profiles/custom-resource/libraries/resource.rb +0 -3
  306. data/test/unit/mock/profiles/custom-resource/metadata.rb +0 -7
@@ -0,0 +1 @@
1
+ --- {}
@@ -2,3 +2,4 @@ source 'https://supermarket.chef.io'
2
2
 
3
3
  cookbook 'apt'
4
4
  cookbook 'os_prepare', path: './cookbooks/os_prepare'
5
+ cookbook 'runit', github: 'hw-cookbooks/runit'
@@ -0,0 +1,27 @@
1
+ DEPENDENCIES
2
+ apt
3
+ os_prepare
4
+ path: cookbooks/os_prepare
5
+ runit
6
+ git: git://github.com/hw-cookbooks/runit.git
7
+ revision: 994febbc29e2bb0d9d1c54662f19b65da76505a3
8
+
9
+ GRAPH
10
+ apt (2.8.2)
11
+ build-essential (2.2.4)
12
+ chef-sugar (3.3.0)
13
+ openssl (4.4.0)
14
+ chef-sugar (>= 3.1.1)
15
+ os_prepare (1.0.0)
16
+ apt (>= 0.0.0)
17
+ postgresql (>= 0.0.0)
18
+ runit (>= 0.0.0)
19
+ yum (>= 0.0.0)
20
+ packagecloud (0.1.1)
21
+ postgresql (4.0.0)
22
+ apt (>= 1.9.0)
23
+ build-essential (>= 0.0.0)
24
+ openssl (~> 4.0)
25
+ runit (1.7.6)
26
+ packagecloud (>= 0.0.0)
27
+ yum (3.8.1)
@@ -0,0 +1,15 @@
1
+ # linux
2
+ directory
3
+ group
4
+ host
5
+ os_env
6
+ port
7
+ service
8
+ user
9
+
10
+
11
+ # windows
12
+ registry_key
13
+ windows_feature
14
+ audit_policy
15
+ security_policy
@@ -6,3 +6,5 @@ description 'This cookbook prepares the test operating systems'
6
6
  version '1.0.0'
7
7
  depends 'apt'
8
8
  depends 'yum'
9
+ depends 'runit'
10
+ depends 'postgresql'
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+ # author: Stephan Renatus
3
+
4
+ include_recipe 'runit::default'
5
+
6
+ # put ctl in alt location
7
+ directory '/opt/chef/embedded/sbin' do
8
+ recursive true
9
+ action :create
10
+ end
11
+
12
+ link '/opt/chef/embedded/sbin/sv' do
13
+ to '/sbin/sv' # default location
14
+ end
15
+
16
+ runit_service 'running-runit-service' do
17
+ default_logger true
18
+ run_template_name 'default-svlog'
19
+ end
20
+
21
+ runit_service 'not-enabled-runit-service' do
22
+ default_logger true
23
+ run_template_name 'default-svlog'
24
+ start_down true
25
+ action :enable
26
+ end
27
+
28
+ runit_service 'not-running-runit-service' do
29
+ default_logger true
30
+ run_template_name 'default-svlog'
31
+ action :create
32
+ end
33
+
34
+ execute 'sv down not-running-runit-service'
@@ -11,3 +11,4 @@ include_recipe('os_prepare::json_yaml_csv_ini')
11
11
  include_recipe('os_prepare::package')
12
12
  include_recipe('os_prepare::registry_key')
13
13
  include_recipe('os_prepare::service')
14
+ include_recipe('os_prepare::postgres')
@@ -4,9 +4,9 @@
4
4
  #
5
5
  # file mount tests
6
6
 
7
- # download alpine linux for file mount tests
8
- remote_file '/root/alpine-3.3.0-x86_64.iso' do
9
- source 'http://wiki.alpinelinux.org/cgi-bin/dl.cgi/v3.3/releases/x86_64/alpine-3.3.0-x86_64.iso'
7
+ # copy iso file for mount tests
8
+ # NB created using `mkdir empty; mkisofs -o empty.iso empty/`
9
+ cookbook_file '/root/empty.iso' do
10
10
  owner 'root'
11
11
  group 'root'
12
12
  mode '0755'
@@ -21,9 +21,9 @@ directory '/mnt/iso-disk' do
21
21
  action :create
22
22
  end
23
23
 
24
- # mount -o loop /root/alpine-3.3.0-x86_64.iso /mnt/iso-disk
24
+ # mount -o loop /root/empty.iso /mnt/iso-disk
25
25
  mount '/mnt/iso-disk' do
26
- device '/root/alpine-3.3.0-x86_64.iso'
26
+ device '/root/empty.iso'
27
27
  options 'loop'
28
28
  action [:mount, :enable]
29
29
  end
@@ -0,0 +1,12 @@
1
+ # encoding: utf-8
2
+ # author: Stephan Renatus
3
+ #
4
+ # installs everyting for the postgres tests
5
+
6
+ # hw-cookbooks/postgresql is tested on these platforms
7
+ case node['platform']
8
+ when 'ubuntu', 'centos'
9
+ node.default['postgresql']['config']['listen_addresses'] = 'localhost'
10
+ node.default['postgresql']['password']['postgres'] = 'md506be11be01439cb4abd537e454df34ea' # "inspec"
11
+ include_recipe 'postgresql::server'
12
+ end
@@ -4,9 +4,13 @@
4
4
  #
5
5
  # prepares services
6
6
 
7
- # install ntp as a service on ubuntu
8
7
  case node['platform']
9
8
  when 'ubuntu'
10
- include_recipe('apt')
9
+ # install ntp as a service
10
+ include_recipe 'apt::default'
11
11
  package 'ntp'
12
+
13
+ when 'centos'
14
+ # install runit for alternative service mgmt
15
+ include_recipe 'os_prepare::_runit_service_centos'
12
16
  end
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ exec > /dev/null
3
+ exec yes
Binary file
@@ -0,0 +1,7 @@
1
+
2
+ # certificate "mail" do
3
+ # cert_path "/etc/postfix/ssl"
4
+ # owner "postfix"
5
+ # group "postfix"
6
+ # end
7
+ # /etc/ssl/certs
@@ -124,7 +124,7 @@ if os.unix?
124
124
  it { should be_mounted }
125
125
  it { should be_mounted.with( :type => 'iso9660' ) }
126
126
  it { should be_mounted.with( :type => 'iso9660', :options => { :ro => true } ) }
127
- it { should be_mounted.with( :type => 'iso9660', :device => '/root/alpine-3.3.0-x86_64.iso' ) }
127
+ it { should be_mounted.with( :type => 'iso9660', :device => '/root/empty.iso' ) }
128
128
  it { should_not be_mounted.with( :type => 'ext4' ) }
129
129
  it { should_not be_mounted.with( :type => 'xfs' ) }
130
130
  end
@@ -133,7 +133,7 @@ if os.unix?
133
133
  # also see mount_spec.rb
134
134
  describe file('/mnt/iso-disk') do
135
135
  it { should be_mounted.only_with( {
136
- :device=>"/root/alpine-3.3.0-x86_64.iso",
136
+ :device=>"/root/empty.iso",
137
137
  :type=>"iso9660",
138
138
  :options=>{
139
139
  :ro=>true}
@@ -4,7 +4,7 @@
4
4
  describe mount '/mnt/iso-disk' do
5
5
  it { should be_mounted }
6
6
  its('count') { should eq 1 }
7
- its('device') { should eq '/root/alpine-3.3.0-x86_64.iso' }
7
+ its('device') { should eq '/root/empty.iso' }
8
8
  its('type') { should eq 'iso9660' }
9
9
  its('options') { should eq ['ro'] }
10
10
  end
@@ -0,0 +1,9 @@
1
+ # encoding: utf-8
2
+
3
+ # postgres-server is installed on these platforms
4
+ if ['ubuntu', 'centos'].include? os['family']
5
+ postgres = postgres_session('postgres', 'inspec')
6
+ describe postgres.query('show ssl;') do
7
+ its('output') { should eq 'on' }
8
+ end
9
+ end
@@ -42,3 +42,37 @@ if os[:family] == 'ubuntu'
42
42
  it { should be_running }
43
43
  end
44
44
  end
45
+
46
+ # extra tests for alt. runit on centos with runit_service
47
+ if os[:family] == 'centos'
48
+ describe runit_service('running-runit-service') do
49
+ it { should be_enabled }
50
+ it { should be_installed }
51
+ it { should be_running }
52
+ end
53
+
54
+ describe runit_service('not-running-runit-service') do
55
+ it { should be_enabled }
56
+ it { should be_installed }
57
+ it { should_not be_running }
58
+ end
59
+
60
+ describe runit_service('not-enabled-runit-service') do
61
+ it { should_not be_enabled }
62
+ it { should be_installed }
63
+ it { should_not be_running }
64
+ end
65
+
66
+ # alt. ctl location
67
+ describe runit_service('running-runit-service', '/opt/chef/embedded/sbin/sv') do
68
+ it { should be_enabled }
69
+ it { should be_installed }
70
+ it { should be_running }
71
+ end
72
+
73
+ describe runit_service('unknown') do
74
+ it { should_not be_enabled }
75
+ it { should_not be_installed }
76
+ it { should_not be_running }
77
+ end
78
+ end
@@ -0,0 +1,5 @@
1
+ describe service('com.apple.quicklook') do
2
+ it { should be_enabled }
3
+ it { should be_installed }
4
+ it { should be_running }
5
+ end
@@ -0,0 +1,18 @@
1
+ ---
2
+ driver:
3
+ name: vagrant
4
+
5
+ provisioner:
6
+ name: chef_zero
7
+
8
+ verifier:
9
+ name: inspec
10
+ sudo: true
11
+
12
+ platforms:
13
+ - name: ubuntu-14.04
14
+
15
+ suites:
16
+ - name: default
17
+ run_list:
18
+ attributes:
@@ -0,0 +1,6 @@
1
+ ---
2
+ hostname: 127.0.0.1
3
+ port: '2205'
4
+ username: vagrant
5
+ ssh_key: "/Users/chartmann/Development/vulcano/vulcano-cli/test/serverspec/.kitchen/kitchen-vagrant/kitchen-serverspec-default-ubuntu-1404/.vagrant/machines/default/virtualbox/private_key"
6
+ last_action: verify
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEowIBAAKCAQEA1KWrGcypqQFzz4ZFYjHBqk/d4QV9c6JYO9xV7mNWmLknpivT
3
+ ry976zBqeV923vUvZ2vndMtI+Z7tg5YpsaJCdbNuc078AyjzG+ahVPWrcMLa+hyk
4
+ VuzLgqyrlWLRc5PcB4JSVVDIVzamarMz9Xo7MOv2KjQBeBSRPQCAWXlrC0zcop5g
5
+ QGgokclPYF780JGBVTFt00y1AS6ZKUbin+YB9RzuQetixe8QIQfKCrljMJeQ9Ppt
6
+ bW2Fiyukfg0YAc3SLZnNyrLWtqgLgCkk86jICKr0cZeqeIeZ8Qojo9ERDi5igItg
7
+ 0HP+W2P47k42NUXTZZ8tZ54HmJ/pWsnclJN5WwIDAQABAoIBADzEOujce384Uwfy
8
+ rtEottcci6NKFld9BQnWJRhCevSZtKLf01Y0k4zaARM+HJIKLsm3JCVUEj6DFAyO
9
+ VMvWOne4FtAMuieNBCvs9B17Nsq6ZCklFjFg6acmAMJnwsLsdewPacfHlfiWPWgw
10
+ XaDAlTmdtHLK+cB+4CI2incHI3fOsbfus/EhT9rNrUhw3Zn5/dq0TaEO5amp8QEN
11
+ /Tblo2LpqEjudqvPO3Yud5WZb1ByFjE1FvPglgrPAsXztInKSHYaURjQ8K6CFNhg
12
+ ITmqBF5Da9Ha8u9pCTPP6a4/FQkK0JcOuiTgy3EIWTa+Ioqz3VWhX4/qXWgQdyAH
13
+ 74jWh4ECgYEA78k8s3ZtCKoVCgZWDVn6Y1cLiAJkl0bMS4sUMwDCHYaghDa5mXiz
14
+ CbkIw/3MGPooXMQhwewJxex0LXEFJhHDyvjIP1G2CE0qEOiScOhSTKeEney/50Xe
15
+ ZC/neay57IlQUNBRfJVokjMTUX40+xahpuS24FKWuv5IbtZcbgek8VkCgYEA4wam
16
+ FAW574ORmqyfi0FXCZarMmaNQnay3IEDk+NWtg67P+gbz7j6UAmYsqqaVOdaAfOs
17
+ DQlu/F/8uESaqlgpRdyH+LkKrIUDBJ6E90XoY21KgYhb6Dyq14iVaVyPt2GMP8+C
18
+ 0JtYn2uEPShC4KvzIKw6ywqdCvTqrnRBeiGuVdMCgYBhSnZtnoxo6pG0ypNZwXtd
19
+ mTDdk5L66kf0Es80Tod0cW5plsbBpX6HYGNVGoIYVE/SK+ZCh6IDg4gz89qR8r1N
20
+ epnNTzsbrSt3RtY8J5dU8NdXOHs4vFmarvEtpk6d0a0bzRpzATA3ua+J7jpS8oDO
21
+ dZhZ9kigQJJlHmbMYh+jqQKBgAGEa9u6ZhG5uWFlQfO2ThScUyyVDuCg1nUuz41P
22
+ eabh1lKJBJaQz+t1BPY8uadTnIBi1oWHyJwbMB8zJi15RV1YKfh5lB6vDOQdAxp7
23
+ 9x+i/Vp8RND6htHF8emwWq2JE1zh0CgAwcje+RVHjZrey1Muk34D5iTKmj7sO/vK
24
+ +dVNAoGBAIphTIYzt1D73qtagNdp5v4qAs87HviY6Us5PC3Hfewm1zqBofeY/DAw
25
+ l/6zjmUNPnTvvV6eiFDPvSgoXeKlO7fCY0Jbpr88Izm/jfClSSdRXPHD59ZS8w6Q
26
+ 0xKjdXvfwmxo8xHKheB1tuiHSTPNlq/eSEFEDw7U51L8pcm2Mx7w
27
+ -----END RSA PRIVATE KEY-----
@@ -0,0 +1,9 @@
1
+ Vagrant.configure("2") do |c|
2
+ c.berkshelf.enabled = false if Vagrant.has_plugin?("vagrant-berkshelf")
3
+ c.vm.box = "opscode-ubuntu-14.04"
4
+ c.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-14.04_chef-provisionerless.box"
5
+ c.vm.hostname = "default-ubuntu-1404"
6
+ c.vm.synced_folder ".", "/vagrant", disabled: true
7
+ c.vm.provider :virtualbox do |p|
8
+ end
9
+ end
@@ -0,0 +1,2 @@
1
+ I, [2015-12-08T23:48:01.367628 #25801] INFO -- default-ubuntu-1404: -----> Verifying <default-ubuntu-1404>...
2
+ I, [2015-12-08T23:48:01.990146 #25801] INFO -- default-ubuntu-1404: Finished verifying <default-ubuntu-1404> (0m0.62s).
@@ -0,0 +1,3 @@
1
+ I, [2015-12-08T23:48:00.475985 #25801] INFO -- Kitchen: -----> Starting Kitchen (v1.4.2)
2
+ I, [2015-12-08T23:48:01.367571 #25801] INFO -- Kitchen: -----> Verifying <default-ubuntu-1404>...
3
+ I, [2015-12-08T23:48:01.990267 #25801] INFO -- Kitchen: -----> Kitchen is finished. (0m1.51s)
@@ -0,0 +1,3 @@
1
+ source 'https://supermarket.chef.io'
2
+
3
+ cookbook 'apt'
@@ -0,0 +1,5 @@
1
+ DEPENDENCIES
2
+ apt
3
+
4
+ GRAPH
5
+ apt (2.9.2)
@@ -0,0 +1,2 @@
1
+ - nested describe
2
+ - require 'serverspec'
@@ -0,0 +1,25 @@
1
+ # encoding: utf-8
2
+
3
+ require 'spec_helper'
4
+
5
+ describe command('find / -name \'.rhosts\' | wc -l ') do
6
+ its(:stdout) { should match(/^0/) }
7
+ end
8
+
9
+ describe command('find / -name \'hosts.equiv\' | wc -l ') do
10
+ its(:stdout) { should match(/^0/) }
11
+ end
12
+
13
+ describe file('/etc/shadow') do
14
+ it { should exist }
15
+ it { should be_file }
16
+ it { should be_owned_by 'root' }
17
+ end
18
+
19
+ describe command('echo $PATH | grep -ci \'\.\'') do
20
+ its(:stdout) { should match(/^0/) }
21
+ end
22
+
23
+ describe file('/etc/login.defs') do
24
+ its(:content) { should match(/^SU_NAME\s*su/) }
25
+ end
@@ -0,0 +1,48 @@
1
+ # encoding: utf-8
2
+
3
+ if ENV['STANDALONE_SPEC']
4
+
5
+ # require 'serverspec'
6
+ require 'pathname'
7
+ require 'net/ssh'
8
+ require 'highline/import'
9
+
10
+ set :backend, :ssh
11
+
12
+ RSpec.configure do |c|
13
+
14
+ if ENV['ASK_SUDO_PASSWORD']
15
+ c.sudo_password = ask('Enter sudo password: ') { |q| q.echo = false }
16
+ else
17
+ c.sudo_password = ENV['SUDO_PASSWORD']
18
+ end
19
+
20
+ options = {}
21
+
22
+ if ENV['ASK_LOGIN_PASSWORD']
23
+ options[:password] = ask("\nEnter login password: ") { |q| q.echo = false }
24
+ else
25
+ options[:password] = ENV['LOGIN_PASSWORD']
26
+ end
27
+
28
+ if ENV['ASK_LOGIN_USERNAME']
29
+ options[:user] = ask("\nEnter login username: ") { |q| q.echo = false }
30
+ else
31
+ options[:user] = ENV['LOGIN_USERNAME'] || ENV['user'] || Etc.getlogin
32
+ end
33
+
34
+ if options[:user].nil?
35
+ puts 'specify login user env LOGIN_USERNAME= or user='
36
+ exit 1
37
+ end
38
+
39
+ c.host = ENV['TARGET_HOST']
40
+ c.ssh_options = options.merge(Net::SSH::Config.for(c.host))
41
+
42
+ end
43
+
44
+ else
45
+ # require 'serverspec'
46
+ #
47
+ set :backend, :exec
48
+ end