vagrant 0.8.7 → 0.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. data/.gitignore +21 -0
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +38 -8
  4. data/Rakefile +13 -6
  5. data/bin/vagrant +6 -1
  6. data/config/default.rb +2 -2
  7. data/lib/vagrant/action/box/download.rb +14 -2
  8. data/lib/vagrant/action/vm/check_box.rb +8 -1
  9. data/lib/vagrant/action/vm/check_guest_additions.rb +6 -3
  10. data/lib/vagrant/action/vm/share_folders.rb +12 -1
  11. data/lib/vagrant/command/init.rb +1 -1
  12. data/lib/vagrant/downloaders/http.rb +29 -2
  13. data/lib/vagrant/hosts.rb +1 -0
  14. data/lib/vagrant/hosts/bsd.rb +1 -0
  15. data/lib/vagrant/hosts/freebsd.rb +51 -0
  16. data/lib/vagrant/provisioners/chef.rb +6 -5
  17. data/lib/vagrant/provisioners/chef_client.rb +1 -1
  18. data/lib/vagrant/provisioners/chef_solo.rb +13 -4
  19. data/lib/vagrant/ssh.rb +24 -49
  20. data/lib/vagrant/ssh/session.rb +1 -1
  21. data/lib/vagrant/systems/solaris.rb +57 -11
  22. data/lib/vagrant/test_helpers.rb +23 -0
  23. data/lib/vagrant/ui.rb +1 -1
  24. data/lib/vagrant/util.rb +0 -1
  25. data/lib/vagrant/util/file_checksum.rb +38 -0
  26. data/lib/vagrant/util/platform.rb +1 -1
  27. data/lib/vagrant/util/safe_exec.rb +2 -1
  28. data/lib/vagrant/version.rb +1 -1
  29. data/tasks/acceptance.rake +113 -0
  30. data/tasks/bundler.rake +3 -0
  31. data/tasks/test.rake +15 -0
  32. data/templates/commands/init/Vagrantfile.erb +3 -0
  33. data/templates/locales/en.yml +1 -1
  34. data/test/acceptance/base.rb +48 -0
  35. data/test/acceptance/box_test.rb +77 -0
  36. data/test/acceptance/destroy_test.rb +37 -0
  37. data/test/acceptance/halt_test.rb +72 -0
  38. data/test/acceptance/init_test.rb +33 -0
  39. data/test/acceptance/resume_test.rb +17 -0
  40. data/test/acceptance/ssh_test.rb +41 -0
  41. data/test/acceptance/support/config.rb +42 -0
  42. data/test/acceptance/support/isolated_environment.rb +226 -0
  43. data/test/acceptance/support/matchers/have_color.rb +9 -0
  44. data/test/acceptance/support/matchers/match_output.rb +14 -0
  45. data/test/acceptance/support/output.rb +87 -0
  46. data/test/acceptance/support/shared/base_context.rb +65 -0
  47. data/test/acceptance/support/shared/command_examples.rb +33 -0
  48. data/test/acceptance/support/tempdir.rb +34 -0
  49. data/test/acceptance/support/virtualbox.rb +36 -0
  50. data/test/acceptance/suspend_test.rb +56 -0
  51. data/test/acceptance/up_basic_test.rb +58 -0
  52. data/test/acceptance/up_with_box_url.rb +40 -0
  53. data/test/acceptance/vagrant_test.rb +47 -0
  54. data/test/acceptance/version_test.rb +20 -0
  55. data/test/buildbot/README.md +72 -0
  56. data/test/buildbot/buildbot_config/__init__.py +0 -0
  57. data/test/buildbot/buildbot_config/config/__init__.py +0 -0
  58. data/test/buildbot/buildbot_config/config/loader.py +24 -0
  59. data/test/buildbot/buildbot_config/config/master.py +24 -0
  60. data/test/buildbot/buildbot_config/config/slave.py +22 -0
  61. data/test/buildbot/buildbot_config/master/__init__.py +6 -0
  62. data/test/buildbot/buildbot_config/master/builders.py +78 -0
  63. data/test/buildbot/buildbot_config/master/buildsteps.py +100 -0
  64. data/test/buildbot/buildbot_config/master/change_sources.py +8 -0
  65. data/test/buildbot/buildbot_config/master/schedulers.py +32 -0
  66. data/test/buildbot/buildbot_config/master/slaves.py +60 -0
  67. data/test/buildbot/buildbot_config/master/status.py +52 -0
  68. data/test/buildbot/master/Makefile.sample +28 -0
  69. data/test/buildbot/master/buildbot.tac +36 -0
  70. data/test/buildbot/master/master.cfg +67 -0
  71. data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
  72. data/test/buildbot/master/public_html/default.css +545 -0
  73. data/test/buildbot/master/public_html/favicon.ico +0 -0
  74. data/test/buildbot/master/public_html/robots.txt +10 -0
  75. data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +356 -0
  76. data/test/buildbot/master/public_html/static/css/prettify.css +97 -0
  77. data/test/buildbot/master/public_html/static/css/syntax.css +60 -0
  78. data/test/buildbot/master/public_html/static/css/vagrant.base.css +205 -0
  79. data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
  80. data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
  81. data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
  82. data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
  83. data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
  84. data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
  85. data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
  86. data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
  87. data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
  88. data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
  89. data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
  90. data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
  91. data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
  92. data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
  93. data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +80 -0
  94. data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +4 -0
  95. data/test/buildbot/master/templates/authfail.html +9 -0
  96. data/test/buildbot/master/templates/build.html +205 -0
  97. data/test/buildbot/master/templates/builder.html +118 -0
  98. data/test/buildbot/master/templates/builders.html +33 -0
  99. data/test/buildbot/master/templates/buildslave.html +72 -0
  100. data/test/buildbot/master/templates/buildslaves.html +70 -0
  101. data/test/buildbot/master/templates/change.html +15 -0
  102. data/test/buildbot/master/templates/layouts/base.html +58 -0
  103. data/test/buildbot/master/templates/macros/box.html +37 -0
  104. data/test/buildbot/master/templates/macros/build_line.html +50 -0
  105. data/test/buildbot/master/templates/macros/change.html +81 -0
  106. data/test/buildbot/master/templates/macros/forms.html +300 -0
  107. data/test/buildbot/master/templates/root.html +42 -0
  108. data/test/buildbot/master/templates/waterfall.html +53 -0
  109. data/test/buildbot/requirements.txt +4 -0
  110. data/test/buildbot/scripts/deploy.sh +38 -0
  111. data/test/buildbot/scripts/setup.sh +107 -0
  112. data/test/buildbot/slave/buildbot.tac +43 -0
  113. data/test/buildbot/slave/info/admin +1 -0
  114. data/test/buildbot/slave/info/host +1 -0
  115. data/test/buildbot/tests/__init__.py +0 -0
  116. data/test/buildbot/tests/master/__init__.py +0 -0
  117. data/test/buildbot/tests/master/test_slaves.py +41 -0
  118. data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
  119. data/test/config/acceptance_boxes.yml +7 -0
  120. data/test/unit/test_helper.rb +4 -0
  121. data/test/unit/vagrant/action/box/download_test.rb +2 -2
  122. data/test/unit/vagrant/action/vm/check_box_test.rb +6 -1
  123. data/test/unit/vagrant/action/vm/share_folders_test.rb +1 -1
  124. data/test/unit/vagrant/command/init_test.rb +10 -0
  125. data/test/unit/vagrant/downloaders/http_test.rb +12 -1
  126. data/test/unit/vagrant/provisioners/chef_test.rb +7 -0
  127. data/test/unit/vagrant/ssh/session_test.rb +2 -2
  128. data/test/unit/vagrant/ssh_test.rb +5 -8
  129. data/vagrant.gemspec +6 -0
  130. metadata +195 -7
@@ -0,0 +1,4 @@
1
+ buildbot==0.8.5
2
+ buildbot-slave==0.8.5
3
+ pytest==2.1.0
4
+ vendor/choices-0.4.0.tar.gz
@@ -0,0 +1,38 @@
1
+ #!/bin/sh
2
+ #
3
+ # This shell script deploys the buildmaster by downloading an
4
+ # up-to-date tar.gz from GitHub and setting up the proper environment.
5
+
6
+ #----------------------------------------------------------------------
7
+ # Update the source
8
+ #----------------------------------------------------------------------
9
+ # Download the Vagrant source, extract it
10
+ cd /tmp
11
+ rm -rf vagrant
12
+ rm -rf mitchellh-vagrant-*
13
+ wget https://github.com/mitchellh/vagrant/tarball/master -O vagrant.tar.gz
14
+ tar xvzf vagrant.tar.gz
15
+ mv mitchellh-vagrant-* vagrant
16
+
17
+ # Move the code into place
18
+ cp -R vagrant/test/buildbot/* /srv/buildmaster/
19
+
20
+ # Setup the virtualenv
21
+ cd /srv/buildmaster
22
+ virtualenv --no-site-packages env
23
+
24
+ # Activate the environment
25
+ . env/bin/activate
26
+
27
+ # Install dependencies
28
+ pip install -r requirements.txt
29
+
30
+ #----------------------------------------------------------------------
31
+ # Update the buildmaster
32
+ #----------------------------------------------------------------------
33
+ # Setup environmental variables that are required
34
+ export BUILDBOT_CONFIG=/etc/buildmaster/master.cfg
35
+ export PYTHONPATH=/srv/buildmaster
36
+
37
+ # Restart the buildmaster
38
+ buildbot restart master/
@@ -0,0 +1,107 @@
1
+ #!/bin/sh
2
+ #
3
+ # This shell script installs and prepares all the software necessary
4
+ # to run the build master. This script is expected to be run as root.
5
+ # This script is made to be run only on Ubuntu 10.04 LTS at the moment.
6
+
7
+ # Update the source list
8
+ apt-get update
9
+
10
+ # Install the basic sysadmin stuff
11
+ apt-get install -y htop
12
+
13
+ # Fix the mountall bug in the AMI
14
+ sed -i -e 's/nobootwait,//' /etc/fstab
15
+
16
+ #----------------------------------------------------------------------
17
+ # Python Setup
18
+ #----------------------------------------------------------------------
19
+ # Install Python and pip
20
+ apt-get install -y python python-dev python-setuptools
21
+ easy_install pip
22
+
23
+ # Install virtualenv
24
+ pip install virtualenv
25
+
26
+ #----------------------------------------------------------------------
27
+ # Deploy Setup
28
+ #----------------------------------------------------------------------
29
+ # Install Git, which is used for all the deploys of the build master
30
+ apt-get install -y git-core
31
+
32
+ # Create the user/group for the buildmaster
33
+ groupadd buildmaster
34
+ useradd -d /home/buildmaster -g buildmaster -s /bin/bash buildmaster
35
+ mkdir /home/buildmaster
36
+ chown -R buildmaster:buildmaster /home/buildmaster
37
+
38
+ # Make the folder which will contain the buildmaster code
39
+ mkdir -p /srv/buildmaster
40
+ chown buildmaster:buildmaster /srv/buildmaster
41
+
42
+ # Make the folder which will contain the configuration for the
43
+ # buildmaster
44
+ mkdir -p /etc/buildmaster
45
+ chown buildmaster:buildmaster /etc/buildmaster
46
+
47
+ #----------------------------------------------------------------------
48
+ # Nginx Setup
49
+ #----------------------------------------------------------------------
50
+ # Install Nginx
51
+ apt-get install -y nginx
52
+
53
+ # Setup the basic directories
54
+ mkdir -p /etc/nginx/conf.d
55
+ mkdir -p /etc/nginx/sites-available
56
+ mkdir -p /etc/nginx/sites-enabled
57
+
58
+ # Setup the configuration
59
+ cat <<EOF > /etc/nginx/nginx.conf
60
+ user www-data;
61
+ worker_processes 1;
62
+
63
+ # Raise the limit on open file descriptors
64
+ worker_rlimit_nofile 30000;
65
+
66
+ error_log /var/log/nginx/error.log;
67
+ pid /var/run/nginx.pid;
68
+
69
+ events {
70
+ worker_connections 1024;
71
+ use epoll;
72
+ }
73
+
74
+ http {
75
+ include /etc/nginx/mime.types;
76
+ default_type application/octet-stream;
77
+
78
+ access_log /var/log/nginx/access.log;
79
+
80
+ sendfile on;
81
+ tcp_nopush on;
82
+ tcp_nodelay on;
83
+
84
+ keepalive_timeout 65;
85
+
86
+ include /etc/nginx/conf.d/*.conf;
87
+ include /etc/nginx/sites-enabled/*;
88
+ }
89
+ EOF
90
+
91
+ # Setup the buildbot site
92
+ cat <<EOF > /etc/nginx/sites-available/buildmaster.conf
93
+ server {
94
+ listen 80;
95
+
96
+ location / {
97
+ proxy_pass http://localhost:8000;
98
+ }
99
+ }
100
+ EOF
101
+
102
+ # Activate the buildbot site, remove the default
103
+ rm /etc/nginx/sites-enabled/default
104
+ ln -f -s /etc/nginx/sites-available/buildmaster.conf /etc/nginx/sites-enabled/buildmaster.conf
105
+
106
+ # Restart nginx
107
+ /etc/init.d/nginx restart
@@ -0,0 +1,43 @@
1
+ import os
2
+
3
+ from twisted.application import service
4
+ from buildslave.bot import BuildSlave
5
+
6
+ from buildbot_config.config.slave import options
7
+
8
+ basedir = r'.'
9
+ rotateLength = 10000000
10
+ maxRotatedFiles = 10
11
+
12
+ # if this is a relocatable tac file, get the directory containing the TAC
13
+ if basedir == '.':
14
+ import os.path
15
+ basedir = os.path.abspath(os.path.dirname(__file__))
16
+
17
+ # note: this line is matched against to check that this is a buildslave
18
+ # directory; do not edit it.
19
+ application = service.Application('buildslave')
20
+
21
+ try:
22
+ from twisted.python.logfile import LogFile
23
+ from twisted.python.log import ILogObserver, FileLogObserver
24
+ logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
25
+ maxRotatedFiles=maxRotatedFiles)
26
+ application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
27
+ except ImportError:
28
+ # probably not yet twisted 8.2.0 and beyond, can't set log yet
29
+ pass
30
+
31
+ buildmaster_host = options.master_host
32
+ port = options.master_port
33
+ slavename = options.name
34
+ passwd = options.password
35
+ keepalive = 600
36
+ usepty = 0
37
+ umask = None
38
+ maxdelay = 300
39
+
40
+ s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
41
+ keepalive, usepty, umask=umask, maxdelay=maxdelay)
42
+ s.setServiceParent(application)
43
+
@@ -0,0 +1 @@
1
+ Buildslave Admin <foo@bar.com>
@@ -0,0 +1 @@
1
+ Please put a description of this build host here
File without changes
File without changes
@@ -0,0 +1,41 @@
1
+ from buildbot.buildslave import BuildSlave
2
+
3
+ from buildbot_config.master.slaves import (
4
+ BuildSlavesFromSlaveConfigs,
5
+ SlaveConfig,
6
+ SlaveListFromConfig)
7
+
8
+ class TestSlaveListFromConfig(object):
9
+ Klass = SlaveListFromConfig
10
+
11
+ def test_parse_single(self):
12
+ """
13
+ Tests that the config parser can parse a single
14
+ slave.
15
+ """
16
+ instance = self.Klass("foo:bar")
17
+ assert 1 == len(instance)
18
+ assert SlaveConfig("foo", "bar") == instance[0]
19
+
20
+ def test_parse_multiple(self):
21
+ """
22
+ Tests that the config parser can parse multiple
23
+ slaves.
24
+ """
25
+ instance = self.Klass("foo:bar,bar:baz")
26
+ expected = [SlaveConfig("foo", "bar"), SlaveConfig("bar", "baz")]
27
+
28
+ assert 2 == len(instance)
29
+ assert expected == instance
30
+
31
+ class TestBuildSlavesFromSlaveConfig(object):
32
+ Klass = BuildSlavesFromSlaveConfigs
33
+
34
+ def test_returns_build_slaves(self):
35
+ """
36
+ Tests that build slaves are properly returned for each
37
+ slave configuration.
38
+ """
39
+ instance = self.Klass([SlaveConfig("foo", "bar")])
40
+ assert 1 == len(instance)
41
+ assert isinstance(instance[0], BuildSlave)
@@ -0,0 +1,7 @@
1
+ # This is the list of required boxes for acceptance tests, and
2
+ # their locations. The locations are used to download the boxes
3
+ # on the fly, if necessary. Additionally, a SHA1 checksum is
4
+ # given to determine if the box needs to be updated.
5
+ - name: default
6
+ url: http://files.vagrantup.com/test/boxes/default.box
7
+ checksum: 1b0a7eb6e152c5b43f45485654ff4965a7f9f604
@@ -13,6 +13,10 @@ begin
13
13
  rescue LoadError
14
14
  end
15
15
 
16
+ # Do not buffer output for tests
17
+ $stdout.sync = true
18
+ $stderr.sync = true
19
+
16
20
  # Set the home directory to some temporary directory
17
21
  ENV["HOME"] = Vagrant.source_root.join("test", "tmp", "home").to_s
18
22
 
@@ -39,9 +39,9 @@ class DownloadBoxActionTest < Test::Unit::TestCase
39
39
  assert @instance.instantiate_downloader
40
40
  end
41
41
 
42
- should "error environment if URI is invalid for any downloaders" do
42
+ should "complain that the file doesn't exist if the URI is invalid for any downloaders" do
43
43
  @env["box"].uri = "foobar"
44
- assert_raises(Vagrant::Errors::BoxDownloadUnknownType) {
44
+ assert_raises(Vagrant::Errors::DownloaderFileDoesntExist) {
45
45
  @instance.instantiate_downloader
46
46
  }
47
47
  end
@@ -40,12 +40,17 @@ class CheckBoxVMActionTest < Test::Unit::TestCase
40
40
  config.vm.box_url = "http://google.com"
41
41
  vf
42
42
 
43
+ # Save this for later because the expecations below clobber it
44
+ vms = env.env.vms
45
+
43
46
  instance = @klass.new(app, env)
44
47
  seq = sequence("seq")
45
48
  env.env.boxes.expects(:find).returns(nil)
46
49
  Vagrant::Box.expects(:add).with(env.env, env["config"].vm.box, env["config"].vm.box_url).in_sequence(seq)
47
50
  env.env.boxes.expects(:reload!).in_sequence(seq)
48
- env.env.expects(:reload_config!).in_sequence(seq)
51
+ vms.each do |name, vm|
52
+ vm.env.expects(:reload_config!).in_sequence(seq)
53
+ end
49
54
  app.expects(:call).with(env).once.in_sequence(seq)
50
55
 
51
56
  assert_nothing_raised {
@@ -120,7 +120,7 @@ class ShareFoldersVMActionTest < Test::Unit::TestCase
120
120
  setup do
121
121
  @folders = stub_shared_folders(<<-sf)
122
122
  config.vm.share_folder("foo", "fooguest", "foohost", :owner => "yo", :group => "fo")
123
- config.vm.share_folder("bar", "barguest", "barhost", :owner => "foo", :group => "bar")
123
+ config.vm.share_folder("bar", "fooguest/foo", "barhost", :owner => "foo", :group => "bar")
124
124
  config.vm.share_folder("foo_no_mount", nil, "foohost2")
125
125
  sf
126
126
  @ssh = mock("ssh")
@@ -0,0 +1,10 @@
1
+ require "test_helper"
2
+
3
+ class CommandInitCommandTest < Test::Unit::TestCase
4
+ should "create a Vagrantfile in the environment's cwd" do
5
+ path = vagrant_app
6
+ env = Vagrant::Environment.new(:cwd => path)
7
+ silence(:stdout) { env.cli("init") }
8
+ assert File.exist?(path.join("Vagrantfile"))
9
+ end
10
+ end
@@ -6,6 +6,7 @@ class HttpDownloaderTest < Test::Unit::TestCase
6
6
  @downloader.stubs(:report_progress)
7
7
  @downloader.stubs(:complete_progress)
8
8
  @uri = "http://google.com/"
9
+ @headers = nil
9
10
  end
10
11
 
11
12
  context "downloading" do
@@ -32,6 +33,16 @@ class HttpDownloaderTest < Test::Unit::TestCase
32
33
  @downloader.download!(@uri, @tempfile)
33
34
  end
34
35
 
36
+ should "create a proper net/http object without a proxy if no_proxy defined" do
37
+ @uri = "http://somewhere.direct.com/some_file"
38
+ @parsed_uri = URI.parse(@uri)
39
+ ENV["http_proxy"] = "http://user:foo@google.com"
40
+ ENV["no_proxy"] = "direct.com"
41
+ Net::HTTP.expects(:new).with(@parsed_uri.host, @parsed_uri.port, nil, nil, nil, nil).once.returns(@http)
42
+ @http.expects(:start)
43
+ @downloader.download!(@uri, @tempfile)
44
+ end
45
+
35
46
  should "enable SSL if scheme is https" do
36
47
  @uri = "https://google.com/"
37
48
  @http.expects(:use_ssl=).with(true).once
@@ -48,7 +59,7 @@ class HttpDownloaderTest < Test::Unit::TestCase
48
59
  segment.stubs(:length).returns(7)
49
60
 
50
61
  @http.stubs(:start).yields(h)
51
- h.expects(:request_get).with(@parsed_uri.request_uri).once.yields(response)
62
+ h.expects(:request_get).with(@parsed_uri.request_uri, @headers).once.yields(response)
52
63
  response.expects(:read_body).once.yields(segment)
53
64
  @tempfile.expects(:write).with(segment).once
54
65
 
@@ -186,6 +186,13 @@ class ChefProvisionerTest < Test::Unit::TestCase
186
186
  end
187
187
  end
188
188
 
189
+ should "not add the directory if the 'v-root' shared folder doesn't exist" do
190
+ @env.config.vm.shared_folders.delete("v-root")
191
+ assert_json do |data|
192
+ assert !data["vagrant"].has_key?("directory")
193
+ end
194
+ end
195
+
189
196
  should "add the config to the JSON" do
190
197
  assert_json do |data|
191
198
  assert_equal @env.config.ssh.username, data["vagrant"]["config"]["ssh"]["username"]
@@ -10,8 +10,8 @@ class SshSessionTest < Test::Unit::TestCase
10
10
  end
11
11
 
12
12
  context "exec!" do
13
- should "retry 5 times" do
14
- @session.expects(:open_channel).times(5).raises(IOError)
13
+ should "retry max_tries times" do
14
+ @session.expects(:open_channel).times(@env.config.ssh.max_tries).raises(IOError)
15
15
  assert_raises(IOError) {
16
16
  @instance.exec!("foo")
17
17
  }
@@ -9,6 +9,7 @@ class SshTest < Test::Unit::TestCase
9
9
  @env.vm.stubs(:vm).returns(@vm)
10
10
 
11
11
  @ssh = Vagrant::SSH.new(@env)
12
+ @session = mock("session")
12
13
  end
13
14
 
14
15
  setup do
@@ -177,11 +178,7 @@ class SshTest < Test::Unit::TestCase
177
178
  mock_ssh
178
179
  @ssh.stubs(:check_key_permissions)
179
180
  @ssh.stubs(:port).returns(2222)
180
- end
181
-
182
- should "return true if SSH connection works" do
183
- Net::SSH.expects(:start).yields("success")
184
- assert @ssh.up?
181
+ @session.stubs(:exec!).returns("hello\n")
185
182
  end
186
183
 
187
184
  should "return false if SSH connection times out" do
@@ -197,14 +194,14 @@ class SshTest < Test::Unit::TestCase
197
194
  end
198
195
 
199
196
  should "return false if the connection is refused" do
200
- Net::SSH.expects(:start).times(5).raises(Errno::ECONNREFUSED)
197
+ Net::SSH.expects(:start).times(@env.config.ssh.max_tries).raises(Errno::ECONNREFUSED)
201
198
  assert_nothing_raised {
202
199
  assert !@ssh.up?
203
200
  }
204
201
  end
205
202
 
206
- should "specifity the timeout as an option to execute" do
207
- @ssh.expects(:execute).yields(true).with() do |opts|
203
+ should "specify the timeout as an option to execute" do
204
+ @ssh.expects(:execute).yields(@session).with() do |opts|
208
205
  assert_equal @env.config.ssh.timeout, opts[:timeout]
209
206
  true
210
207
  end
@@ -25,8 +25,14 @@ Gem::Specification.new do |s|
25
25
 
26
26
  s.add_development_dependency "rake"
27
27
  s.add_development_dependency "contest", ">= 0.1.2"
28
+ s.add_development_dependency "log4r", "~> 1.1.9"
28
29
  s.add_development_dependency "minitest", "~> 2.5.1"
29
30
  s.add_development_dependency "mocha"
31
+ s.add_development_dependency "childprocess", "~> 0.2.3"
32
+ s.add_development_dependency "sys-proctable", "~> 0.9.0"
33
+ s.add_development_dependency "rspec-core", "~> 2.7.1"
34
+ s.add_development_dependency "rspec-expectations", "~> 2.7.0"
35
+ s.add_development_dependency "rspec-mocks", "~> 2.7.0"
30
36
 
31
37
  s.files = `git ls-files`.split("\n")
32
38
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 49
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 7
10
- version: 0.8.7
9
+ - 8
10
+ version: 0.8.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mitchell Hashimoto
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-13 00:00:00 Z
19
+ date: 2011-12-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  version_requirements: &id001 !ruby/object:Gem::Requirement
@@ -178,6 +178,22 @@ dependencies:
178
178
  requirement: *id010
179
179
  - !ruby/object:Gem::Dependency
180
180
  version_requirements: &id011 !ruby/object:Gem::Requirement
181
+ none: false
182
+ requirements:
183
+ - - ~>
184
+ - !ruby/object:Gem::Version
185
+ hash: 1
186
+ segments:
187
+ - 1
188
+ - 1
189
+ - 9
190
+ version: 1.1.9
191
+ name: log4r
192
+ type: :development
193
+ prerelease: false
194
+ requirement: *id011
195
+ - !ruby/object:Gem::Dependency
196
+ version_requirements: &id012 !ruby/object:Gem::Requirement
181
197
  none: false
182
198
  requirements:
183
199
  - - ~>
@@ -191,9 +207,9 @@ dependencies:
191
207
  name: minitest
192
208
  type: :development
193
209
  prerelease: false
194
- requirement: *id011
210
+ requirement: *id012
195
211
  - !ruby/object:Gem::Dependency
196
- version_requirements: &id012 !ruby/object:Gem::Requirement
212
+ version_requirements: &id013 !ruby/object:Gem::Requirement
197
213
  none: false
198
214
  requirements:
199
215
  - - ">="
@@ -205,7 +221,87 @@ dependencies:
205
221
  name: mocha
206
222
  type: :development
207
223
  prerelease: false
208
- requirement: *id012
224
+ requirement: *id013
225
+ - !ruby/object:Gem::Dependency
226
+ version_requirements: &id014 !ruby/object:Gem::Requirement
227
+ none: false
228
+ requirements:
229
+ - - ~>
230
+ - !ruby/object:Gem::Version
231
+ hash: 17
232
+ segments:
233
+ - 0
234
+ - 2
235
+ - 3
236
+ version: 0.2.3
237
+ name: childprocess
238
+ type: :development
239
+ prerelease: false
240
+ requirement: *id014
241
+ - !ruby/object:Gem::Dependency
242
+ version_requirements: &id015 !ruby/object:Gem::Requirement
243
+ none: false
244
+ requirements:
245
+ - - ~>
246
+ - !ruby/object:Gem::Version
247
+ hash: 59
248
+ segments:
249
+ - 0
250
+ - 9
251
+ - 0
252
+ version: 0.9.0
253
+ name: sys-proctable
254
+ type: :development
255
+ prerelease: false
256
+ requirement: *id015
257
+ - !ruby/object:Gem::Dependency
258
+ version_requirements: &id016 !ruby/object:Gem::Requirement
259
+ none: false
260
+ requirements:
261
+ - - ~>
262
+ - !ruby/object:Gem::Version
263
+ hash: 17
264
+ segments:
265
+ - 2
266
+ - 7
267
+ - 1
268
+ version: 2.7.1
269
+ name: rspec-core
270
+ type: :development
271
+ prerelease: false
272
+ requirement: *id016
273
+ - !ruby/object:Gem::Dependency
274
+ version_requirements: &id017 !ruby/object:Gem::Requirement
275
+ none: false
276
+ requirements:
277
+ - - ~>
278
+ - !ruby/object:Gem::Version
279
+ hash: 19
280
+ segments:
281
+ - 2
282
+ - 7
283
+ - 0
284
+ version: 2.7.0
285
+ name: rspec-expectations
286
+ type: :development
287
+ prerelease: false
288
+ requirement: *id017
289
+ - !ruby/object:Gem::Dependency
290
+ version_requirements: &id018 !ruby/object:Gem::Requirement
291
+ none: false
292
+ requirements:
293
+ - - ~>
294
+ - !ruby/object:Gem::Version
295
+ hash: 19
296
+ segments:
297
+ - 2
298
+ - 7
299
+ - 0
300
+ version: 2.7.0
301
+ name: rspec-mocks
302
+ type: :development
303
+ prerelease: false
304
+ requirement: *id018
209
305
  description: Vagrant is a tool for building and distributing virtualized development environments.
210
306
  email:
211
307
  - mitchell.hashimoto@gmail.com
@@ -327,6 +423,7 @@ files:
327
423
  - lib/vagrant/hosts/base.rb
328
424
  - lib/vagrant/hosts/bsd.rb
329
425
  - lib/vagrant/hosts/fedora.rb
426
+ - lib/vagrant/hosts/freebsd.rb
330
427
  - lib/vagrant/hosts/linux.rb
331
428
  - lib/vagrant/plugin.rb
332
429
  - lib/vagrant/provisioners.rb
@@ -357,6 +454,7 @@ files:
357
454
  - lib/vagrant/util.rb
358
455
  - lib/vagrant/util/busy.rb
359
456
  - lib/vagrant/util/counter.rb
457
+ - lib/vagrant/util/file_checksum.rb
360
458
  - lib/vagrant/util/hash_with_indifferent_access.rb
361
459
  - lib/vagrant/util/platform.rb
362
460
  - lib/vagrant/util/retryable.rb
@@ -365,6 +463,9 @@ files:
365
463
  - lib/vagrant/util/template_renderer.rb
366
464
  - lib/vagrant/version.rb
367
465
  - lib/vagrant/vm.rb
466
+ - tasks/acceptance.rake
467
+ - tasks/bundler.rake
468
+ - tasks/test.rake
368
469
  - templates/chef_server_client.erb
369
470
  - templates/chef_solo_solo.erb
370
471
  - templates/commands/init/Vagrantfile.erb
@@ -378,6 +479,92 @@ files:
378
479
  - templates/nfs/exports_linux.erb
379
480
  - templates/package_Vagrantfile.erb
380
481
  - templates/ssh_config.erb
482
+ - test/acceptance/base.rb
483
+ - test/acceptance/box_test.rb
484
+ - test/acceptance/destroy_test.rb
485
+ - test/acceptance/halt_test.rb
486
+ - test/acceptance/init_test.rb
487
+ - test/acceptance/resume_test.rb
488
+ - test/acceptance/ssh_test.rb
489
+ - test/acceptance/support/config.rb
490
+ - test/acceptance/support/isolated_environment.rb
491
+ - test/acceptance/support/matchers/have_color.rb
492
+ - test/acceptance/support/matchers/match_output.rb
493
+ - test/acceptance/support/output.rb
494
+ - test/acceptance/support/shared/base_context.rb
495
+ - test/acceptance/support/shared/command_examples.rb
496
+ - test/acceptance/support/tempdir.rb
497
+ - test/acceptance/support/virtualbox.rb
498
+ - test/acceptance/suspend_test.rb
499
+ - test/acceptance/up_basic_test.rb
500
+ - test/acceptance/up_with_box_url.rb
501
+ - test/acceptance/vagrant_test.rb
502
+ - test/acceptance/version_test.rb
503
+ - test/buildbot/README.md
504
+ - test/buildbot/buildbot_config/__init__.py
505
+ - test/buildbot/buildbot_config/config/__init__.py
506
+ - test/buildbot/buildbot_config/config/loader.py
507
+ - test/buildbot/buildbot_config/config/master.py
508
+ - test/buildbot/buildbot_config/config/slave.py
509
+ - test/buildbot/buildbot_config/master/__init__.py
510
+ - test/buildbot/buildbot_config/master/builders.py
511
+ - test/buildbot/buildbot_config/master/buildsteps.py
512
+ - test/buildbot/buildbot_config/master/change_sources.py
513
+ - test/buildbot/buildbot_config/master/schedulers.py
514
+ - test/buildbot/buildbot_config/master/slaves.py
515
+ - test/buildbot/buildbot_config/master/status.py
516
+ - test/buildbot/master/Makefile.sample
517
+ - test/buildbot/master/buildbot.tac
518
+ - test/buildbot/master/master.cfg
519
+ - test/buildbot/master/public_html/bg_gradient.jpg
520
+ - test/buildbot/master/public_html/default.css
521
+ - test/buildbot/master/public_html/favicon.ico
522
+ - test/buildbot/master/public_html/robots.txt
523
+ - test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css
524
+ - test/buildbot/master/public_html/static/css/prettify.css
525
+ - test/buildbot/master/public_html/static/css/syntax.css
526
+ - test/buildbot/master/public_html/static/css/vagrant.base.css
527
+ - test/buildbot/master/public_html/static/images/base_box_mac.jpg
528
+ - test/buildbot/master/public_html/static/images/getting-started/success.jpg
529
+ - test/buildbot/master/public_html/static/images/icons/error.png
530
+ - test/buildbot/master/public_html/static/images/vagrant_chilling.png
531
+ - test/buildbot/master/public_html/static/images/vagrant_holding.png
532
+ - test/buildbot/master/public_html/static/images/vagrant_looking.png
533
+ - test/buildbot/master/public_html/static/images/windows/alter_path.jpg
534
+ - test/buildbot/master/public_html/static/images/windows/edit_path.jpg
535
+ - test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg
536
+ - test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg
537
+ - test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg
538
+ - test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg
539
+ - test/buildbot/master/public_html/static/images/windows/save_result.jpg
540
+ - test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg
541
+ - test/buildbot/master/public_html/static/js/bootstrap-tabs.js
542
+ - test/buildbot/master/public_html/static/js/jquery-1.7.min.js
543
+ - test/buildbot/master/templates/authfail.html
544
+ - test/buildbot/master/templates/build.html
545
+ - test/buildbot/master/templates/builder.html
546
+ - test/buildbot/master/templates/builders.html
547
+ - test/buildbot/master/templates/buildslave.html
548
+ - test/buildbot/master/templates/buildslaves.html
549
+ - test/buildbot/master/templates/change.html
550
+ - test/buildbot/master/templates/layouts/base.html
551
+ - test/buildbot/master/templates/macros/box.html
552
+ - test/buildbot/master/templates/macros/build_line.html
553
+ - test/buildbot/master/templates/macros/change.html
554
+ - test/buildbot/master/templates/macros/forms.html
555
+ - test/buildbot/master/templates/root.html
556
+ - test/buildbot/master/templates/waterfall.html
557
+ - test/buildbot/requirements.txt
558
+ - test/buildbot/scripts/deploy.sh
559
+ - test/buildbot/scripts/setup.sh
560
+ - test/buildbot/slave/buildbot.tac
561
+ - test/buildbot/slave/info/admin
562
+ - test/buildbot/slave/info/host
563
+ - test/buildbot/tests/__init__.py
564
+ - test/buildbot/tests/master/__init__.py
565
+ - test/buildbot/tests/master/test_slaves.py
566
+ - test/buildbot/vendor/choices-0.4.0.tar.gz
567
+ - test/config/acceptance_boxes.yml
381
568
  - test/unit/locales/en.yml
382
569
  - test/unit/test_helper.rb
383
570
  - test/unit/vagrant/action/box/destroy_test.rb
@@ -428,6 +615,7 @@ files:
428
615
  - test/unit/vagrant/command/base_test.rb
429
616
  - test/unit/vagrant/command/group_base_test.rb
430
617
  - test/unit/vagrant/command/helpers_test.rb
618
+ - test/unit/vagrant/command/init_test.rb
431
619
  - test/unit/vagrant/command/package_test.rb
432
620
  - test/unit/vagrant/config/base_test.rb
433
621
  - test/unit/vagrant/config/error_recorder_test.rb