vagrant 1.0.7 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (416) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +14 -43
  3. data/Gemfile +2 -1
  4. data/LICENSE.txt +22 -0
  5. data/README.md +3 -90
  6. data/Rakefile +1 -18
  7. data/bin/vagrant +2 -58
  8. data/message.txt +17 -0
  9. data/vagrant.gemspec +20 -69
  10. metadata +43 -655
  11. data/.yardopts +0 -1
  12. data/CHANGELOG.md +0 -723
  13. data/LICENSE +0 -21
  14. data/config/default.rb +0 -30
  15. data/contrib/README.md +0 -12
  16. data/contrib/emacs/vagrant.el +0 -8
  17. data/contrib/vim/vagrantfile.vim +0 -9
  18. data/keys/README.md +0 -17
  19. data/keys/vagrant +0 -27
  20. data/keys/vagrant.pub +0 -1
  21. data/lib/vagrant.rb +0 -197
  22. data/lib/vagrant/action.rb +0 -63
  23. data/lib/vagrant/action/box/destroy.rb +0 -25
  24. data/lib/vagrant/action/box/download.rb +0 -84
  25. data/lib/vagrant/action/box/package.rb +0 -19
  26. data/lib/vagrant/action/box/unpackage.rb +0 -61
  27. data/lib/vagrant/action/box/verify.rb +0 -23
  28. data/lib/vagrant/action/builder.rb +0 -128
  29. data/lib/vagrant/action/builtin.rb +0 -171
  30. data/lib/vagrant/action/env/set.rb +0 -21
  31. data/lib/vagrant/action/environment.rb +0 -12
  32. data/lib/vagrant/action/general/check_virtualbox.rb +0 -28
  33. data/lib/vagrant/action/general/package.rb +0 -101
  34. data/lib/vagrant/action/general/validate.rb +0 -18
  35. data/lib/vagrant/action/runner.rb +0 -53
  36. data/lib/vagrant/action/vm/boot.rb +0 -53
  37. data/lib/vagrant/action/vm/check_accessible.rb +0 -23
  38. data/lib/vagrant/action/vm/check_box.rb +0 -33
  39. data/lib/vagrant/action/vm/check_guest_additions.rb +0 -38
  40. data/lib/vagrant/action/vm/check_port_collisions.rb +0 -89
  41. data/lib/vagrant/action/vm/clean_machine_folder.rb +0 -43
  42. data/lib/vagrant/action/vm/clear_forwarded_ports.rb +0 -18
  43. data/lib/vagrant/action/vm/clear_network_interfaces.rb +0 -31
  44. data/lib/vagrant/action/vm/clear_shared_folders.rb +0 -18
  45. data/lib/vagrant/action/vm/customize.rb +0 -36
  46. data/lib/vagrant/action/vm/default_name.rb +0 -22
  47. data/lib/vagrant/action/vm/destroy.rb +0 -19
  48. data/lib/vagrant/action/vm/destroy_unused_network_interfaces.rb +0 -20
  49. data/lib/vagrant/action/vm/discard_state.rb +0 -22
  50. data/lib/vagrant/action/vm/export.rb +0 -57
  51. data/lib/vagrant/action/vm/forward_ports.rb +0 -92
  52. data/lib/vagrant/action/vm/halt.rb +0 -32
  53. data/lib/vagrant/action/vm/host_name.rb +0 -21
  54. data/lib/vagrant/action/vm/import.rb +0 -48
  55. data/lib/vagrant/action/vm/match_mac_address.rb +0 -21
  56. data/lib/vagrant/action/vm/network.rb +0 -403
  57. data/lib/vagrant/action/vm/nfs.rb +0 -196
  58. data/lib/vagrant/action/vm/package.rb +0 -23
  59. data/lib/vagrant/action/vm/package_vagrantfile.rb +0 -36
  60. data/lib/vagrant/action/vm/provision.rb +0 -61
  61. data/lib/vagrant/action/vm/provisioner_cleanup.rb +0 -26
  62. data/lib/vagrant/action/vm/prune_nfs_exports.rb +0 -20
  63. data/lib/vagrant/action/vm/resume.rb +0 -20
  64. data/lib/vagrant/action/vm/sane_defaults.rb +0 -78
  65. data/lib/vagrant/action/vm/setup_package_files.rb +0 -54
  66. data/lib/vagrant/action/vm/share_folders.rb +0 -114
  67. data/lib/vagrant/action/vm/suspend.rb +0 -20
  68. data/lib/vagrant/action/warden.rb +0 -92
  69. data/lib/vagrant/box.rb +0 -44
  70. data/lib/vagrant/box_collection.rb +0 -58
  71. data/lib/vagrant/cli.rb +0 -76
  72. data/lib/vagrant/command.rb +0 -24
  73. data/lib/vagrant/command/base.rb +0 -167
  74. data/lib/vagrant/command/box.rb +0 -58
  75. data/lib/vagrant/command/box_add.rb +0 -37
  76. data/lib/vagrant/command/box_list.rb +0 -28
  77. data/lib/vagrant/command/box_remove.rb +0 -27
  78. data/lib/vagrant/command/box_repackage.rb +0 -27
  79. data/lib/vagrant/command/destroy.rb +0 -64
  80. data/lib/vagrant/command/gem.rb +0 -39
  81. data/lib/vagrant/command/halt.rb +0 -39
  82. data/lib/vagrant/command/init.rb +0 -40
  83. data/lib/vagrant/command/package.rb +0 -75
  84. data/lib/vagrant/command/provision.rb +0 -40
  85. data/lib/vagrant/command/reload.rb +0 -39
  86. data/lib/vagrant/command/resume.rb +0 -33
  87. data/lib/vagrant/command/ssh.rb +0 -90
  88. data/lib/vagrant/command/ssh_config.rb +0 -51
  89. data/lib/vagrant/command/start_mixins.rb +0 -26
  90. data/lib/vagrant/command/status.rb +0 -36
  91. data/lib/vagrant/command/suspend.rb +0 -33
  92. data/lib/vagrant/command/up.rb +0 -40
  93. data/lib/vagrant/communication.rb +0 -7
  94. data/lib/vagrant/communication/base.rb +0 -56
  95. data/lib/vagrant/communication/ssh.rb +0 -230
  96. data/lib/vagrant/config.rb +0 -49
  97. data/lib/vagrant/config/base.rb +0 -82
  98. data/lib/vagrant/config/container.rb +0 -37
  99. data/lib/vagrant/config/error_recorder.rb +0 -19
  100. data/lib/vagrant/config/loader.rb +0 -127
  101. data/lib/vagrant/config/nfs.rb +0 -8
  102. data/lib/vagrant/config/package.rb +0 -7
  103. data/lib/vagrant/config/ssh.rb +0 -27
  104. data/lib/vagrant/config/top.rb +0 -72
  105. data/lib/vagrant/config/vagrant.rb +0 -14
  106. data/lib/vagrant/config/vm.rb +0 -168
  107. data/lib/vagrant/config/vm/provisioner.rb +0 -52
  108. data/lib/vagrant/config/vm/sub_vm.rb +0 -17
  109. data/lib/vagrant/data_store.rb +0 -92
  110. data/lib/vagrant/downloaders.rb +0 -7
  111. data/lib/vagrant/downloaders/base.rb +0 -25
  112. data/lib/vagrant/downloaders/file.rb +0 -22
  113. data/lib/vagrant/downloaders/http.rb +0 -97
  114. data/lib/vagrant/driver.rb +0 -8
  115. data/lib/vagrant/driver/virtualbox.rb +0 -134
  116. data/lib/vagrant/driver/virtualbox_4_0.rb +0 -459
  117. data/lib/vagrant/driver/virtualbox_4_1.rb +0 -459
  118. data/lib/vagrant/driver/virtualbox_4_2.rb +0 -606
  119. data/lib/vagrant/driver/virtualbox_base.rb +0 -326
  120. data/lib/vagrant/environment.rb +0 -522
  121. data/lib/vagrant/errors.rb +0 -445
  122. data/lib/vagrant/guest.rb +0 -18
  123. data/lib/vagrant/guest/arch.rb +0 -56
  124. data/lib/vagrant/guest/base.rb +0 -99
  125. data/lib/vagrant/guest/debian.rb +0 -64
  126. data/lib/vagrant/guest/fedora.rb +0 -66
  127. data/lib/vagrant/guest/freebsd.rb +0 -86
  128. data/lib/vagrant/guest/gentoo.rb +0 -46
  129. data/lib/vagrant/guest/linux.rb +0 -118
  130. data/lib/vagrant/guest/linux/config.rb +0 -19
  131. data/lib/vagrant/guest/linux/error.rb +0 -9
  132. data/lib/vagrant/guest/openbsd.rb +0 -20
  133. data/lib/vagrant/guest/redhat.rb +0 -67
  134. data/lib/vagrant/guest/solaris.rb +0 -118
  135. data/lib/vagrant/guest/suse.rb +0 -17
  136. data/lib/vagrant/guest/ubuntu.rb +0 -23
  137. data/lib/vagrant/hosts.rb +0 -37
  138. data/lib/vagrant/hosts/arch.rb +0 -55
  139. data/lib/vagrant/hosts/base.rb +0 -66
  140. data/lib/vagrant/hosts/bsd.rb +0 -97
  141. data/lib/vagrant/hosts/fedora.rb +0 -47
  142. data/lib/vagrant/hosts/freebsd.rb +0 -41
  143. data/lib/vagrant/hosts/gentoo.rb +0 -20
  144. data/lib/vagrant/hosts/linux.rb +0 -94
  145. data/lib/vagrant/hosts/opensuse.rb +0 -30
  146. data/lib/vagrant/hosts/windows.rb +0 -16
  147. data/lib/vagrant/plugin.rb +0 -81
  148. data/lib/vagrant/provisioners.rb +0 -12
  149. data/lib/vagrant/provisioners/base.rb +0 -44
  150. data/lib/vagrant/provisioners/chef.rb +0 -168
  151. data/lib/vagrant/provisioners/chef_client.rb +0 -132
  152. data/lib/vagrant/provisioners/chef_solo.rb +0 -234
  153. data/lib/vagrant/provisioners/puppet.rb +0 -176
  154. data/lib/vagrant/provisioners/puppet_server.rb +0 -78
  155. data/lib/vagrant/provisioners/shell.rb +0 -103
  156. data/lib/vagrant/registry.rb +0 -52
  157. data/lib/vagrant/ssh.rb +0 -126
  158. data/lib/vagrant/test_helpers.rb +0 -154
  159. data/lib/vagrant/ui.rb +0 -168
  160. data/lib/vagrant/util.rb +0 -12
  161. data/lib/vagrant/util/ansi_escape_code_remover.rb +0 -34
  162. data/lib/vagrant/util/busy.rb +0 -59
  163. data/lib/vagrant/util/counter.rb +0 -24
  164. data/lib/vagrant/util/file_checksum.rb +0 -38
  165. data/lib/vagrant/util/file_mode.rb +0 -12
  166. data/lib/vagrant/util/hash_with_indifferent_access.rb +0 -63
  167. data/lib/vagrant/util/is_port_open.rb +0 -38
  168. data/lib/vagrant/util/line_ending_helpers.rb +0 -14
  169. data/lib/vagrant/util/network_ip.rb +0 -28
  170. data/lib/vagrant/util/platform.rb +0 -68
  171. data/lib/vagrant/util/retryable.rb +0 -25
  172. data/lib/vagrant/util/safe_exec.rb +0 -36
  173. data/lib/vagrant/util/safe_puts.rb +0 -31
  174. data/lib/vagrant/util/stacked_proc_runner.rb +0 -35
  175. data/lib/vagrant/util/subprocess.rb +0 -247
  176. data/lib/vagrant/util/template_renderer.rb +0 -83
  177. data/lib/vagrant/version.rb +0 -6
  178. data/lib/vagrant/vm.rb +0 -195
  179. data/tasks/acceptance.rake +0 -113
  180. data/tasks/bundler.rake +0 -3
  181. data/tasks/test.rake +0 -20
  182. data/templates/commands/init/Vagrantfile.erb +0 -99
  183. data/templates/commands/ssh_config/config.erb +0 -15
  184. data/templates/config/validation_failed.erb +0 -7
  185. data/templates/guests/arch/network_dhcp.erb +0 -7
  186. data/templates/guests/arch/network_static.erb +0 -7
  187. data/templates/guests/debian/network_dhcp.erb +0 -6
  188. data/templates/guests/debian/network_static.erb +0 -7
  189. data/templates/guests/fedora/network_dhcp.erb +0 -6
  190. data/templates/guests/fedora/network_static.erb +0 -13
  191. data/templates/guests/freebsd/network_dhcp.erb +0 -3
  192. data/templates/guests/freebsd/network_static.erb +0 -3
  193. data/templates/guests/gentoo/network_dhcp.erb +0 -4
  194. data/templates/guests/gentoo/network_static.erb +0 -4
  195. data/templates/guests/redhat/network_dhcp.erb +0 -6
  196. data/templates/guests/redhat/network_static.erb +0 -7
  197. data/templates/locales/en.yml +0 -759
  198. data/templates/nfs/exports.erb +0 -5
  199. data/templates/nfs/exports_freebsd.erb +0 -5
  200. data/templates/nfs/exports_linux.erb +0 -5
  201. data/templates/package_Vagrantfile.erb +0 -11
  202. data/templates/provisioners/chef_client/client.erb +0 -32
  203. data/templates/provisioners/chef_solo/solo.erb +0 -25
  204. data/test/acceptance/base.rb +0 -48
  205. data/test/acceptance/box_test.rb +0 -99
  206. data/test/acceptance/destroy_test.rb +0 -37
  207. data/test/acceptance/halt_test.rb +0 -72
  208. data/test/acceptance/init_test.rb +0 -33
  209. data/test/acceptance/networking/host_only_test.rb +0 -37
  210. data/test/acceptance/networking/port_forward_test.rb +0 -125
  211. data/test/acceptance/package_test.rb +0 -46
  212. data/test/acceptance/provisioning/basic_test.rb +0 -61
  213. data/test/acceptance/provisioning/chef_solo_test.rb +0 -37
  214. data/test/acceptance/provisioning/shell_test.rb +0 -53
  215. data/test/acceptance/resume_test.rb +0 -17
  216. data/test/acceptance/shared_folders_test.rb +0 -84
  217. data/test/acceptance/skeletons/chef_solo_basic/README.md +0 -3
  218. data/test/acceptance/skeletons/chef_solo_basic/cookbooks/basic/recipes/default.rb +0 -5
  219. data/test/acceptance/skeletons/chef_solo_json/README.md +0 -3
  220. data/test/acceptance/skeletons/chef_solo_json/cookbooks/basic/recipes/default.rb +0 -6
  221. data/test/acceptance/skeletons/provisioner_multi/README.md +0 -3
  222. data/test/acceptance/skeletons/provisioner_multi/cookbooks/basic/recipes/default.rb +0 -5
  223. data/test/acceptance/ssh_test.rb +0 -46
  224. data/test/acceptance/support/config.rb +0 -42
  225. data/test/acceptance/support/isolated_environment.rb +0 -117
  226. data/test/acceptance/support/matchers/have_color.rb +0 -9
  227. data/test/acceptance/support/matchers/match_output.rb +0 -14
  228. data/test/acceptance/support/matchers/succeed.rb +0 -14
  229. data/test/acceptance/support/network_tests.rb +0 -29
  230. data/test/acceptance/support/output.rb +0 -95
  231. data/test/acceptance/support/shared/base_context.rb +0 -72
  232. data/test/acceptance/support/shared/command_examples.rb +0 -33
  233. data/test/acceptance/support/virtualbox.rb +0 -36
  234. data/test/acceptance/suspend_test.rb +0 -56
  235. data/test/acceptance/up_basic_test.rb +0 -33
  236. data/test/acceptance/up_with_box_url.rb +0 -40
  237. data/test/acceptance/vagrant_test.rb +0 -47
  238. data/test/acceptance/version_test.rb +0 -15
  239. data/test/buildbot/README.md +0 -72
  240. data/test/buildbot/buildbot_config/__init__.py +0 -0
  241. data/test/buildbot/buildbot_config/config/__init__.py +0 -0
  242. data/test/buildbot/buildbot_config/config/loader.py +0 -24
  243. data/test/buildbot/buildbot_config/config/master.py +0 -24
  244. data/test/buildbot/buildbot_config/config/slave.py +0 -22
  245. data/test/buildbot/buildbot_config/master/__init__.py +0 -6
  246. data/test/buildbot/buildbot_config/master/builders.py +0 -78
  247. data/test/buildbot/buildbot_config/master/buildsteps.py +0 -100
  248. data/test/buildbot/buildbot_config/master/change_sources.py +0 -8
  249. data/test/buildbot/buildbot_config/master/schedulers.py +0 -32
  250. data/test/buildbot/buildbot_config/master/slaves.py +0 -60
  251. data/test/buildbot/buildbot_config/master/status.py +0 -52
  252. data/test/buildbot/master/Makefile.sample +0 -28
  253. data/test/buildbot/master/buildbot.tac +0 -36
  254. data/test/buildbot/master/master.cfg +0 -67
  255. data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
  256. data/test/buildbot/master/public_html/default.css +0 -545
  257. data/test/buildbot/master/public_html/favicon.ico +0 -0
  258. data/test/buildbot/master/public_html/robots.txt +0 -10
  259. data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +0 -356
  260. data/test/buildbot/master/public_html/static/css/prettify.css +0 -97
  261. data/test/buildbot/master/public_html/static/css/syntax.css +0 -60
  262. data/test/buildbot/master/public_html/static/css/vagrant.base.css +0 -205
  263. data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
  264. data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
  265. data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
  266. data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
  267. data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
  268. data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
  269. data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
  270. data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
  271. data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
  272. data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
  273. data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
  274. data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
  275. data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
  276. data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
  277. data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +0 -80
  278. data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +0 -4
  279. data/test/buildbot/master/templates/authfail.html +0 -9
  280. data/test/buildbot/master/templates/build.html +0 -205
  281. data/test/buildbot/master/templates/builder.html +0 -118
  282. data/test/buildbot/master/templates/builders.html +0 -33
  283. data/test/buildbot/master/templates/buildslave.html +0 -72
  284. data/test/buildbot/master/templates/buildslaves.html +0 -70
  285. data/test/buildbot/master/templates/change.html +0 -15
  286. data/test/buildbot/master/templates/layouts/base.html +0 -58
  287. data/test/buildbot/master/templates/macros/box.html +0 -37
  288. data/test/buildbot/master/templates/macros/build_line.html +0 -50
  289. data/test/buildbot/master/templates/macros/change.html +0 -81
  290. data/test/buildbot/master/templates/macros/forms.html +0 -300
  291. data/test/buildbot/master/templates/root.html +0 -42
  292. data/test/buildbot/master/templates/waterfall.html +0 -53
  293. data/test/buildbot/requirements.txt +0 -4
  294. data/test/buildbot/scripts/deploy.sh +0 -38
  295. data/test/buildbot/scripts/setup.sh +0 -107
  296. data/test/buildbot/slave/buildbot.tac +0 -43
  297. data/test/buildbot/slave/info/admin +0 -1
  298. data/test/buildbot/slave/info/host +0 -1
  299. data/test/buildbot/tests/__init__.py +0 -0
  300. data/test/buildbot/tests/master/__init__.py +0 -0
  301. data/test/buildbot/tests/master/test_slaves.py +0 -41
  302. data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
  303. data/test/config/acceptance_boxes.yml +0 -7
  304. data/test/support/isolated_environment.rb +0 -46
  305. data/test/support/tempdir.rb +0 -34
  306. data/test/unit/base.rb +0 -21
  307. data/test/unit/support/isolated_environment.rb +0 -47
  308. data/test/unit/support/shared/base_context.rb +0 -30
  309. data/test/unit/vagrant/action/builder_test.rb +0 -156
  310. data/test/unit/vagrant/action/environment_test.rb +0 -16
  311. data/test/unit/vagrant/action/runner_test.rb +0 -65
  312. data/test/unit/vagrant/action/warden_test.rb +0 -92
  313. data/test/unit/vagrant/box_collection_test.rb +0 -56
  314. data/test/unit/vagrant/box_test.rb +0 -34
  315. data/test/unit/vagrant/command/base_test.rb +0 -150
  316. data/test/unit/vagrant/config/base_test.rb +0 -48
  317. data/test/unit/vagrant/config/loader_test.rb +0 -79
  318. data/test/unit/vagrant/config/ssh_test.rb +0 -17
  319. data/test/unit/vagrant/config/top_test.rb +0 -69
  320. data/test/unit/vagrant/config/vm_test.rb +0 -71
  321. data/test/unit/vagrant/config_test.rb +0 -27
  322. data/test/unit/vagrant/data_store_test.rb +0 -79
  323. data/test/unit/vagrant/downloaders/base_test.rb +0 -18
  324. data/test/unit/vagrant/downloaders/file_test.rb +0 -75
  325. data/test/unit/vagrant/downloaders/http_test.rb +0 -19
  326. data/test/unit/vagrant/environment_test.rb +0 -220
  327. data/test/unit/vagrant/hosts_test.rb +0 -36
  328. data/test/unit/vagrant/registry_test.rb +0 -74
  329. data/test/unit/vagrant/util/ansi_escape_code_remover_test.rb +0 -16
  330. data/test/unit/vagrant/util/file_checksum_test.rb +0 -23
  331. data/test/unit/vagrant/util/hash_with_indifferent_access_test.rb +0 -38
  332. data/test/unit/vagrant/util/is_port_open_test.rb +0 -53
  333. data/test/unit/vagrant/util/line_endings_helper_test.rb +0 -16
  334. data/test/unit/vagrant/util/network_ip_test.rb +0 -17
  335. data/test/unit/vagrant/util/retryable_test.rb +0 -106
  336. data/test/unit/vagrant_test.rb +0 -27
  337. data/test/unit_legacy/locales/en.yml +0 -8
  338. data/test/unit_legacy/test_helper.rb +0 -32
  339. data/test/unit_legacy/vagrant/action/box/destroy_test.rb +0 -18
  340. data/test/unit_legacy/vagrant/action/box/download_test.rb +0 -125
  341. data/test/unit_legacy/vagrant/action/box/package_test.rb +0 -25
  342. data/test/unit_legacy/vagrant/action/box/unpackage_test.rb +0 -84
  343. data/test/unit_legacy/vagrant/action/box/verify_test.rb +0 -30
  344. data/test/unit_legacy/vagrant/action/env/set_test.rb +0 -24
  345. data/test/unit_legacy/vagrant/action/general/package_test.rb +0 -268
  346. data/test/unit_legacy/vagrant/action/general/validate_test.rb +0 -31
  347. data/test/unit_legacy/vagrant/action/vm/boot_test.rb +0 -66
  348. data/test/unit_legacy/vagrant/action/vm/check_accessible_test.rb +0 -61
  349. data/test/unit_legacy/vagrant/action/vm/check_box_test.rb +0 -61
  350. data/test/unit_legacy/vagrant/action/vm/check_guest_additions_test.rb +0 -9
  351. data/test/unit_legacy/vagrant/action/vm/clean_machine_folder_test.rb +0 -84
  352. data/test/unit_legacy/vagrant/action/vm/clear_forwarded_ports_test.rb +0 -52
  353. data/test/unit_legacy/vagrant/action/vm/clear_nfs_exports_test.rb +0 -22
  354. data/test/unit_legacy/vagrant/action/vm/clear_shared_folders_test.rb +0 -40
  355. data/test/unit_legacy/vagrant/action/vm/customize_test.rb +0 -37
  356. data/test/unit_legacy/vagrant/action/vm/destroy_test.rb +0 -25
  357. data/test/unit_legacy/vagrant/action/vm/destroy_unused_network_interfaces_test.rb +0 -49
  358. data/test/unit_legacy/vagrant/action/vm/discard_state_test.rb +0 -45
  359. data/test/unit_legacy/vagrant/action/vm/export_test.rb +0 -107
  360. data/test/unit_legacy/vagrant/action/vm/forward_ports_helpers_test.rb +0 -77
  361. data/test/unit_legacy/vagrant/action/vm/forward_ports_test.rb +0 -197
  362. data/test/unit_legacy/vagrant/action/vm/halt_test.rb +0 -79
  363. data/test/unit_legacy/vagrant/action/vm/host_name_test.rb +0 -36
  364. data/test/unit_legacy/vagrant/action/vm/import_test.rb +0 -66
  365. data/test/unit_legacy/vagrant/action/vm/match_mac_address_test.rb +0 -40
  366. data/test/unit_legacy/vagrant/action/vm/modify_test.rb +0 -38
  367. data/test/unit_legacy/vagrant/action/vm/network_test.rb +0 -286
  368. data/test/unit_legacy/vagrant/action/vm/nfs_helpers_test.rb +0 -26
  369. data/test/unit_legacy/vagrant/action/vm/nfs_test.rb +0 -260
  370. data/test/unit_legacy/vagrant/action/vm/package_test.rb +0 -25
  371. data/test/unit_legacy/vagrant/action/vm/package_vagrantfile_test.rb +0 -46
  372. data/test/unit_legacy/vagrant/action/vm/provision_test.rb +0 -65
  373. data/test/unit_legacy/vagrant/action/vm/provisioner_cleanup_test.rb +0 -56
  374. data/test/unit_legacy/vagrant/action/vm/resume_test.rb +0 -35
  375. data/test/unit_legacy/vagrant/action/vm/share_folders_test.rb +0 -144
  376. data/test/unit_legacy/vagrant/action/vm/suspend_test.rb +0 -35
  377. data/test/unit_legacy/vagrant/action_test.rb +0 -89
  378. data/test/unit_legacy/vagrant/box_collection_test.rb +0 -45
  379. data/test/unit_legacy/vagrant/box_test.rb +0 -74
  380. data/test/unit_legacy/vagrant/cli_test.rb +0 -35
  381. data/test/unit_legacy/vagrant/command/base_test.rb +0 -23
  382. data/test/unit_legacy/vagrant/command/group_base_test.rb +0 -15
  383. data/test/unit_legacy/vagrant/command/helpers_test.rb +0 -88
  384. data/test/unit_legacy/vagrant/command/init_test.rb +0 -10
  385. data/test/unit_legacy/vagrant/command/package_test.rb +0 -27
  386. data/test/unit_legacy/vagrant/config/base_test.rb +0 -52
  387. data/test/unit_legacy/vagrant/config/error_recorder_test.rb +0 -18
  388. data/test/unit_legacy/vagrant/config/ssh_test.rb +0 -12
  389. data/test/unit_legacy/vagrant/config/vagrant_test.rb +0 -35
  390. data/test/unit_legacy/vagrant/config/vm/provisioner_test.rb +0 -92
  391. data/test/unit_legacy/vagrant/config/vm_test.rb +0 -47
  392. data/test/unit_legacy/vagrant/config_test.rb +0 -148
  393. data/test/unit_legacy/vagrant/downloaders/http_test.rb +0 -93
  394. data/test/unit_legacy/vagrant/environment_test.rb +0 -539
  395. data/test/unit_legacy/vagrant/errors_test.rb +0 -42
  396. data/test/unit_legacy/vagrant/hosts/base_test.rb +0 -46
  397. data/test/unit_legacy/vagrant/hosts/bsd_test.rb +0 -53
  398. data/test/unit_legacy/vagrant/hosts/linux_test.rb +0 -54
  399. data/test/unit_legacy/vagrant/plugin_test.rb +0 -9
  400. data/test/unit_legacy/vagrant/provisioners/base_test.rb +0 -63
  401. data/test/unit_legacy/vagrant/provisioners/chef_client_test.rb +0 -190
  402. data/test/unit_legacy/vagrant/provisioners/chef_solo_test.rb +0 -115
  403. data/test/unit_legacy/vagrant/provisioners/chef_test.rb +0 -209
  404. data/test/unit_legacy/vagrant/provisioners/puppet_server_test.rb +0 -68
  405. data/test/unit_legacy/vagrant/provisioners/puppet_test.rb +0 -182
  406. data/test/unit_legacy/vagrant/provisioners/shell_test.rb +0 -79
  407. data/test/unit_legacy/vagrant/ssh/session_test.rb +0 -40
  408. data/test/unit_legacy/vagrant/ssh_test.rb +0 -304
  409. data/test/unit_legacy/vagrant/systems/base_test.rb +0 -18
  410. data/test/unit_legacy/vagrant/systems/linux_test.rb +0 -104
  411. data/test/unit_legacy/vagrant/util/busy_test.rb +0 -106
  412. data/test/unit_legacy/vagrant/util/counter_test.rb +0 -29
  413. data/test/unit_legacy/vagrant/util/platform_test.rb +0 -18
  414. data/test/unit_legacy/vagrant/util/stacked_proc_runner_test.rb +0 -43
  415. data/test/unit_legacy/vagrant/util/template_renderer_test.rb +0 -145
  416. data/test/unit_legacy/vagrant/vm_test.rb +0 -300
@@ -1,78 +0,0 @@
1
- module Vagrant
2
- module Provisioners
3
- class PuppetServerError < Vagrant::Errors::VagrantError
4
- error_namespace("vagrant.provisioners.puppet_server")
5
- end
6
-
7
- class PuppetServer < Base
8
- class Config < Vagrant::Config::Base
9
- attr_accessor :puppet_server
10
- attr_accessor :puppet_node
11
- attr_accessor :options
12
- attr_accessor :facter
13
-
14
- def facter; @facter ||= {}; end
15
- def puppet_server; @puppet_server || "puppet"; end
16
- def options; @options ||= []; end
17
- end
18
-
19
- def self.config_class
20
- Config
21
- end
22
-
23
- def provision!
24
- verify_binary("puppet")
25
- run_puppet_agent
26
- end
27
-
28
- def verify_binary(binary)
29
- env[:vm].channel.sudo("which #{binary}",
30
- :error_class => PuppetServerError,
31
- :error_key => :not_detected,
32
- :binary => binary)
33
- end
34
-
35
- def run_puppet_agent
36
- options = config.options
37
- options = [options] if !options.is_a?(Array)
38
-
39
- # Intelligently set the puppet node cert name based on certain
40
- # external parameters.
41
- cn = nil
42
- if config.puppet_node
43
- # If a node name is given, we use that directly for the certname
44
- cn = config.puppet_node
45
- elsif env[:vm].config.vm.host_name
46
- # If a host name is given, we explicitly set the certname to
47
- # nil so that the hostname becomes the cert name.
48
- cn = nil
49
- else
50
- # Otherwise, we default to the name of the box.
51
- cn = env[:vm].config.vm.box
52
- end
53
-
54
- # Add the certname option if there is one
55
- options += ["--certname", cn] if cn
56
- options = options.join(" ")
57
-
58
- # Build up the custom facts if we have any
59
- facter = ""
60
- if !config.facter.empty?
61
- facts = []
62
- config.facter.each do |key, value|
63
- facts << "FACTER_#{key}='#{value}'"
64
- end
65
-
66
- facter = "#{facts.join(" ")} "
67
- end
68
-
69
- command = "#{facter}puppet agent #{options} --server #{config.puppet_server} --detailed-exitcodes || [ $? -eq 2 ]"
70
-
71
- env[:ui].info I18n.t("vagrant.provisioners.puppet_server.running_puppetd")
72
- env[:vm].channel.sudo(command) do |type, data|
73
- env[:ui].info(data.chomp, :prefix => false)
74
- end
75
- end
76
- end
77
- end
78
- end
@@ -1,103 +0,0 @@
1
- require 'tempfile'
2
-
3
- module Vagrant
4
- module Provisioners
5
- class Shell < Base
6
- class Config < Vagrant::Config::Base
7
- attr_accessor :inline
8
- attr_accessor :path
9
- attr_accessor :upload_path
10
- attr_accessor :args
11
-
12
- def initialize
13
- @upload_path = "/tmp/vagrant-shell"
14
- end
15
-
16
- def validate(env, errors)
17
- # Validate that the parameters are properly set
18
- if path && inline
19
- errors.add(I18n.t("vagrant.provisioners.shell.path_and_inline_set"))
20
- elsif !path && !inline
21
- errors.add(I18n.t("vagrant.provisioners.shell.no_path_or_inline"))
22
- end
23
-
24
- # Validate the existence of a script to upload
25
- if path
26
- expanded_path = Pathname.new(path).expand_path(env.root_path)
27
- if !expanded_path.file?
28
- errors.add(I18n.t("vagrant.provisioners.shell.path_invalid",
29
- :path => expanded_path))
30
- end
31
- end
32
-
33
- # There needs to be a path to upload the script to
34
- if !upload_path
35
- errors.add(I18n.t("vagrant.provisioners.shell.upload_path_not_set"))
36
- end
37
-
38
- # If there are args and its not a string, that is a problem
39
- if args && !args.is_a?(String)
40
- errors.add(I18n.t("vagrant.provisioners.shell.args_not_string"))
41
- end
42
- end
43
- end
44
-
45
- def self.config_class
46
- Config
47
- end
48
-
49
- # This method yields the path to a script to upload and execute
50
- # on the remote server. This method will properly clean up the
51
- # script file if needed.
52
- def with_script_file
53
- if config.path
54
- # Just yield the path to that file...
55
- yield Pathname.new(config.path).expand_path(env[:root_path])
56
- return
57
- end
58
-
59
- # Otherwise we have an inline script, we need to Tempfile it,
60
- # and handle it specially...
61
- file = Tempfile.new('vagrant-shell')
62
-
63
- # Unless you set binmode, on a Windows host the shell script will
64
- # have CRLF line endings instead of LF line endings, causing havoc
65
- # when the guest executes it
66
- file.binmode
67
-
68
- begin
69
- file.write(config.inline)
70
- file.fsync
71
- file.close
72
- yield file.path
73
- ensure
74
- file.close
75
- file.unlink
76
- end
77
- end
78
-
79
- def provision!
80
- args = ""
81
- args = " #{config.args}" if config.args
82
- command = "chmod +x #{config.upload_path} && #{config.upload_path}#{args}"
83
-
84
- with_script_file do |path|
85
- # Upload the script to the VM
86
- env[:vm].channel.upload(path.to_s, config.upload_path)
87
-
88
- # Execute it with sudo
89
- env[:vm].channel.sudo(command) do |type, data|
90
- if [:stderr, :stdout].include?(type)
91
- # Output the data with the proper color based on the stream.
92
- color = type == :stdout ? :green : :red
93
-
94
- # Note: Be sure to chomp the data to avoid the newlines that the
95
- # Chef outputs.
96
- env[:ui].info(data.chomp, :color => color, :prefix => false)
97
- end
98
- end
99
- end
100
- end
101
- end
102
- end
103
- end
@@ -1,52 +0,0 @@
1
- module Vagrant
2
- # Register components in a single location that can be queried.
3
- #
4
- # This allows certain components (such as guest systems, configuration
5
- # pieces, etc.) to be registered and queried.
6
- class Registry
7
- def initialize
8
- @actions = {}
9
- @results_cache = {}
10
- end
11
-
12
- # Register a callable by key.
13
- #
14
- # The callable should be given in a block which will be lazily evaluated
15
- # when the action is needed.
16
- #
17
- # If an action by the given name already exists then it will be
18
- # overwritten.
19
- def register(key, value=nil, &block)
20
- block = lambda { value } if value
21
- @actions[key] = block
22
- end
23
-
24
- # Get an action by the given key.
25
- #
26
- # This will evaluate the block given to `register` and return the resulting
27
- # action stack.
28
- def get(key)
29
- return nil if !@actions.has_key?(key)
30
- return @results_cache[key] if @results_cache.has_key?(key)
31
- @results_cache[key] = @actions[key].call
32
- end
33
- alias :[] :get
34
-
35
- # Iterate over the keyspace.
36
- def each(&block)
37
- @actions.each do |key, _|
38
- yield key, get(key)
39
- end
40
- end
41
-
42
- # Converts this registry to a hash
43
- def to_hash
44
- result = {}
45
- self.each do |key, value|
46
- result[key] = value
47
- end
48
-
49
- result
50
- end
51
- end
52
- end
@@ -1,126 +0,0 @@
1
- require 'log4r'
2
-
3
- require 'vagrant/util/file_mode'
4
- require 'vagrant/util/platform'
5
- require 'vagrant/util/safe_exec'
6
-
7
- module Vagrant
8
- # Manages SSH connection information as well as allows opening an
9
- # SSH connection.
10
- class SSH
11
- include Util::SafeExec
12
-
13
- def initialize(vm)
14
- @vm = vm
15
- @logger = Log4r::Logger.new("vagrant::ssh")
16
- end
17
-
18
- # Returns a hash of information necessary for accessing this
19
- # virtual machine via SSH.
20
- #
21
- # @return [Hash]
22
- def info
23
- results = {
24
- :host => @vm.config.ssh.host,
25
- :port => @vm.config.ssh.port || @vm.driver.ssh_port(@vm.config.ssh.guest_port),
26
- :username => @vm.config.ssh.username,
27
- :forward_agent => @vm.config.ssh.forward_agent,
28
- :forward_x11 => @vm.config.ssh.forward_x11
29
- }
30
-
31
- # This can happen if no port is set and for some reason Vagrant
32
- # can't detect an SSH port.
33
- raise Errors::SSHPortNotDetected if !results[:port]
34
-
35
- # Determine the private key path, which is either set by the
36
- # configuration or uses just the built-in insecure key.
37
- pk_path = @vm.config.ssh.private_key_path || @vm.env.default_private_key_path
38
- results[:private_key_path] = File.expand_path(pk_path, @vm.env.root_path)
39
-
40
- # We need to check and fix the private key permissions
41
- # to make sure that SSH gets a key with 0600 perms.
42
- check_key_permissions(results[:private_key_path])
43
-
44
- # Return the results
45
- return results
46
- end
47
-
48
- # Connects to the environment's virtual machine, replacing the ruby
49
- # process with an SSH process.
50
- #
51
- # @param [Hash] opts Options hash
52
- # @options opts [Boolean] :plain_mode If True, doesn't authenticate with
53
- # the machine, only connects, allowing the user to connect.
54
- def exec(opts={})
55
- # Get the SSH information and cache it here
56
- ssh_info = info
57
-
58
- if Util::Platform.windows?
59
- raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
60
- :port => ssh_info[:port],
61
- :username => ssh_info[:username],
62
- :key_path => ssh_info[:private_key_path]
63
- end
64
-
65
- raise Errors::SSHUnavailable if !Kernel.system("which ssh > /dev/null 2>&1")
66
-
67
- # If plain mode is enabled then we don't do any authentication (we don't
68
- # set a user or an identity file)
69
- plain_mode = opts[:plain_mode]
70
-
71
- options = {}
72
- options[:host] = ssh_info[:host]
73
- options[:port] = ssh_info[:port]
74
- options[:username] = ssh_info[:username]
75
- options[:private_key_path] = ssh_info[:private_key_path]
76
-
77
- # Command line options
78
- command_options = ["-p", options[:port].to_s, "-o", "UserKnownHostsFile=/dev/null",
79
- "-o", "StrictHostKeyChecking=no", "-o", "LogLevel=ERROR"]
80
-
81
- # Solaris/OpenSolaris/Illumos uses SunSSH which doesn't support the IdentitiesOnly option
82
- command_options += ["-o", "IdentitiesOnly=yes"] unless Util::Platform.solaris?
83
-
84
- command_options += ["-i", options[:private_key_path]] if !plain_mode
85
- command_options += ["-o", "ForwardAgent=yes"] if ssh_info[:forward_agent]
86
-
87
- # If there are extra options, then we append those
88
- command_options.concat(opts[:extra_args]) if opts[:extra_args]
89
-
90
- if ssh_info[:forward_x11]
91
- # Both are required so that no warnings are shown regarding X11
92
- command_options += ["-o", "ForwardX11=yes"]
93
- command_options += ["-o", "ForwardX11Trusted=yes"]
94
- end
95
-
96
- host_string = options[:host]
97
- host_string = "#{options[:username]}@#{host_string}" if !plain_mode
98
- command_options << host_string
99
- @logger.info("Invoking SSH: #{command_options.inspect}")
100
- safe_exec("ssh", *command_options)
101
- end
102
-
103
- # Checks the file permissions for a private key, resetting them
104
- # if needed.
105
- def check_key_permissions(key_path)
106
- # Windows systems don't have this issue
107
- return if Util::Platform.windows?
108
-
109
- @logger.debug("Checking key permissions: #{key_path}")
110
- stat = File.stat(key_path)
111
-
112
- if stat.owned? && Util::FileMode.from_octal(stat.mode) != "600"
113
- @logger.info("Attempting to correct key permissions to 0600")
114
- File.chmod(0600, key_path)
115
-
116
- if Util::FileMode.from_octal(stat.mode) != "600"
117
- raise Errors::SSHKeyBadPermissions, :key_path => key_path
118
- end
119
- end
120
- rescue Errno::EPERM
121
- # This shouldn't happen since we verified we own the file, but
122
- # it is possible in theory, so we raise an error.
123
- raise Errors::SSHKeyBadPermissions, :key_path => key_path
124
- end
125
- end
126
- end
@@ -1,154 +0,0 @@
1
- module Vagrant
2
- # Test helpers provided by Vagrant to allow for plugin developers
3
- # to write automated tests for their code. This module simply provides
4
- # methods which can be included into any test framework (`test/unit`,
5
- # RSpec, Shoulda, etc.)
6
- module TestHelpers
7
- #------------------------------------------------------------
8
- # Environment creation helpers
9
- #------------------------------------------------------------
10
- # Creates a "vagrant_app" directory in the test tmp folder
11
- # which can be used for creating test Vagrant environments.
12
- # Returns the root directory of the app. This typically doesn't need
13
- # to be called directly unless you're setting up a custom application.
14
- # See the examples for common use cases.
15
- def vagrant_app(*path)
16
- root = tmp_path.join("vagrant_app")
17
- FileUtils.rm_rf(root)
18
- FileUtils.mkdir_p(root)
19
- root.join(*path)
20
- end
21
-
22
- # Creates a Vagrantfile with the given contents in the given
23
- # app directory. If no app directory is specified, then a default
24
- # Vagrant app is used.
25
- def vagrantfile(*args)
26
- path = args.shift.join("Vagrantfile") if Pathname === args.first
27
- path ||= vagrant_app("Vagrantfile")
28
-
29
- # Create this box so that it exists
30
- vagrant_box("base")
31
-
32
- str = args.shift || ""
33
- File.open(path.to_s, "w") do |f|
34
- f.puts "ENV['VAGRANT_HOME'] = '#{home_path}'"
35
- f.puts "Vagrant::Config.run do |config|"
36
- f.puts "config.vm.base_mac = 'foo' if !config.vm.base_mac"
37
- f.puts "config.vm.box = 'base'"
38
- f.puts str
39
- f.puts "end"
40
- end
41
-
42
- path.parent
43
- end
44
-
45
- # Creates and _loads_ a Vagrant environment at the given path.
46
- # If no path is given, then a default {#vagrantfile} is used.
47
- def vagrant_env(*args)
48
- path = args.shift if Pathname === args.first
49
- path ||= vagrantfile
50
- Vagrant::Environment.new(:cwd => path).load!
51
- end
52
-
53
- # Creates the folder to contain a vagrant box. This allows for
54
- # "fake" boxes to be made with the specified name.
55
- #
56
- # @param [String] name
57
- # @return [Pathname]
58
- def vagrant_box(name)
59
- result = boxes_path.join(name)
60
- FileUtils.mkdir_p(result)
61
- result
62
- end
63
-
64
- # Returns an instantiated downloader with a mocked tempfile
65
- # which can be passed into it.
66
- #
67
- # @param [Class] klass The downloader class
68
- # @return [Array] Returns an array of `downloader` `tempfile`
69
- def vagrant_mock_downloader(klass)
70
- tempfile = mock("tempfile")
71
- tempfile.stubs(:write)
72
-
73
- _, env = action_env
74
- [klass.new(env), tempfile]
75
- end
76
-
77
- # Returns a blank app (callable) and action environment with the
78
- # given vagrant environment. This allows for testing of middlewares.
79
- def action_env(v_env = nil)
80
- v_env ||= vagrant_env
81
- # duplicate the Vagrant::Environment ui and get the default vm object
82
- # for the new action environment from the first pair in the vms list
83
- opts = {:ui => v_env.ui.dup, :vm => v_env.vms.first.last}
84
- app = lambda { |env| }
85
- env = Vagrant::Action::Environment.new(opts)
86
- env["vagrant.test"] = true
87
- [app, env]
88
- end
89
-
90
- # Utility method for capturing output streams.
91
- # @example Evaluate the output
92
- # output = capture(:stdout){ env.cli("foo") }
93
- # assert_equal "bar", output
94
- # @example Silence the output
95
- # silence(:stdout){ env.cli("init") }
96
- # @param [:stdout, :stderr] stream The stream to capture
97
- # @yieldreturn String
98
- # @see https://github.com/wycats/thor/blob/master/spec/spec_helper.rb
99
- def capture(stream)
100
- begin
101
- stream = stream.to_s
102
- eval "$#{stream} = StringIO.new"
103
- yield
104
- result = eval("$#{stream}").string
105
- ensure
106
- eval("$#{stream} = #{stream.upcase}")
107
- end
108
-
109
- result
110
- end
111
- alias :silence :capture
112
-
113
- #------------------------------------------------------------
114
- # Path helpers
115
- #------------------------------------------------------------
116
- # Path to the tmp directory for the tests.
117
- #
118
- # @return [Pathname]
119
- def tmp_path
120
- result = Vagrant.source_root.join("test", "tmp")
121
- FileUtils.mkdir_p(result)
122
- result
123
- end
124
-
125
- # Path to the "home" directory for the tests
126
- #
127
- # @return [Pathname]
128
- def home_path
129
- result = tmp_path.join("home")
130
- FileUtils.mkdir_p(result)
131
- result
132
- end
133
-
134
- # Path to the boxes directory in the home directory
135
- #
136
- # @return [Pathname]
137
- def boxes_path
138
- result = home_path.join("boxes")
139
- FileUtils.mkdir_p(result)
140
- result
141
- end
142
-
143
- # Cleans all the test temp paths, which includes the boxes path,
144
- # home path, etc. This allows for cleaning between tests.
145
- def clean_paths
146
- FileUtils.rm_rf(tmp_path)
147
-
148
- # Call these methods only to rebuild the directories
149
- tmp_path
150
- home_path
151
- boxes_path
152
- end
153
- end
154
- end