vagrantup 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.
- checksums.yaml +4 -4
- data/.gitignore +21 -0
- data/CHANGELOG.md +25 -0
- data/README.md +38 -8
- data/Rakefile +13 -6
- data/bin/vagrant +6 -1
- data/config/default.rb +2 -2
- data/lib/vagrant/action/box/download.rb +14 -2
- data/lib/vagrant/action/vm/check_box.rb +8 -1
- data/lib/vagrant/action/vm/check_guest_additions.rb +6 -3
- data/lib/vagrant/action/vm/share_folders.rb +12 -1
- data/lib/vagrant/command/init.rb +1 -1
- data/lib/vagrant/downloaders/http.rb +29 -2
- data/lib/vagrant/hosts.rb +1 -0
- data/lib/vagrant/hosts/bsd.rb +1 -0
- data/lib/vagrant/hosts/freebsd.rb +51 -0
- data/lib/vagrant/provisioners/chef.rb +6 -5
- data/lib/vagrant/provisioners/chef_client.rb +1 -1
- data/lib/vagrant/provisioners/chef_solo.rb +13 -4
- data/lib/vagrant/ssh.rb +24 -49
- data/lib/vagrant/ssh/session.rb +1 -1
- data/lib/vagrant/systems/solaris.rb +57 -11
- data/lib/vagrant/test_helpers.rb +23 -0
- data/lib/vagrant/ui.rb +1 -1
- data/lib/vagrant/util.rb +0 -1
- data/lib/vagrant/util/file_checksum.rb +38 -0
- data/lib/vagrant/util/platform.rb +1 -1
- data/lib/vagrant/util/safe_exec.rb +2 -1
- data/lib/vagrant/version.rb +1 -1
- data/tasks/acceptance.rake +113 -0
- data/tasks/bundler.rake +3 -0
- data/tasks/test.rake +15 -0
- data/templates/commands/init/Vagrantfile.erb +3 -0
- data/templates/locales/en.yml +1 -1
- data/test/acceptance/base.rb +48 -0
- data/test/acceptance/box_test.rb +77 -0
- data/test/acceptance/destroy_test.rb +37 -0
- data/test/acceptance/halt_test.rb +72 -0
- data/test/acceptance/init_test.rb +33 -0
- data/test/acceptance/resume_test.rb +17 -0
- data/test/acceptance/ssh_test.rb +41 -0
- data/test/acceptance/support/config.rb +42 -0
- data/test/acceptance/support/isolated_environment.rb +226 -0
- data/test/acceptance/support/matchers/have_color.rb +9 -0
- data/test/acceptance/support/matchers/match_output.rb +14 -0
- data/test/acceptance/support/output.rb +87 -0
- data/test/acceptance/support/shared/base_context.rb +65 -0
- data/test/acceptance/support/shared/command_examples.rb +33 -0
- data/test/acceptance/support/tempdir.rb +34 -0
- data/test/acceptance/support/virtualbox.rb +36 -0
- data/test/acceptance/suspend_test.rb +56 -0
- data/test/acceptance/up_basic_test.rb +58 -0
- data/test/acceptance/up_with_box_url.rb +40 -0
- data/test/acceptance/vagrant_test.rb +47 -0
- data/test/acceptance/version_test.rb +20 -0
- data/test/buildbot/README.md +72 -0
- data/test/buildbot/buildbot_config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/__init__.py +0 -0
- data/test/buildbot/buildbot_config/config/loader.py +24 -0
- data/test/buildbot/buildbot_config/config/master.py +24 -0
- data/test/buildbot/buildbot_config/config/slave.py +22 -0
- data/test/buildbot/buildbot_config/master/__init__.py +6 -0
- data/test/buildbot/buildbot_config/master/builders.py +78 -0
- data/test/buildbot/buildbot_config/master/buildsteps.py +100 -0
- data/test/buildbot/buildbot_config/master/change_sources.py +8 -0
- data/test/buildbot/buildbot_config/master/schedulers.py +32 -0
- data/test/buildbot/buildbot_config/master/slaves.py +60 -0
- data/test/buildbot/buildbot_config/master/status.py +52 -0
- data/test/buildbot/master/Makefile.sample +28 -0
- data/test/buildbot/master/buildbot.tac +36 -0
- data/test/buildbot/master/master.cfg +67 -0
- data/test/buildbot/master/public_html/bg_gradient.jpg +0 -0
- data/test/buildbot/master/public_html/default.css +545 -0
- data/test/buildbot/master/public_html/favicon.ico +0 -0
- data/test/buildbot/master/public_html/robots.txt +10 -0
- data/test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css +356 -0
- data/test/buildbot/master/public_html/static/css/prettify.css +97 -0
- data/test/buildbot/master/public_html/static/css/syntax.css +60 -0
- data/test/buildbot/master/public_html/static/css/vagrant.base.css +205 -0
- data/test/buildbot/master/public_html/static/images/base_box_mac.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/getting-started/success.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/icons/error.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_chilling.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_holding.png +0 -0
- data/test/buildbot/master/public_html/static/images/vagrant_looking.png +0 -0
- data/test/buildbot/master/public_html/static/images/windows/alter_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/edit_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/save_result.jpg +0 -0
- data/test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg +0 -0
- data/test/buildbot/master/public_html/static/js/bootstrap-tabs.js +80 -0
- data/test/buildbot/master/public_html/static/js/jquery-1.7.min.js +4 -0
- data/test/buildbot/master/templates/authfail.html +9 -0
- data/test/buildbot/master/templates/build.html +205 -0
- data/test/buildbot/master/templates/builder.html +118 -0
- data/test/buildbot/master/templates/builders.html +33 -0
- data/test/buildbot/master/templates/buildslave.html +72 -0
- data/test/buildbot/master/templates/buildslaves.html +70 -0
- data/test/buildbot/master/templates/change.html +15 -0
- data/test/buildbot/master/templates/layouts/base.html +58 -0
- data/test/buildbot/master/templates/macros/box.html +37 -0
- data/test/buildbot/master/templates/macros/build_line.html +50 -0
- data/test/buildbot/master/templates/macros/change.html +81 -0
- data/test/buildbot/master/templates/macros/forms.html +300 -0
- data/test/buildbot/master/templates/root.html +42 -0
- data/test/buildbot/master/templates/waterfall.html +53 -0
- data/test/buildbot/requirements.txt +4 -0
- data/test/buildbot/scripts/deploy.sh +38 -0
- data/test/buildbot/scripts/setup.sh +107 -0
- data/test/buildbot/slave/buildbot.tac +43 -0
- data/test/buildbot/slave/info/admin +1 -0
- data/test/buildbot/slave/info/host +1 -0
- data/test/buildbot/tests/__init__.py +0 -0
- data/test/buildbot/tests/master/__init__.py +0 -0
- data/test/buildbot/tests/master/test_slaves.py +41 -0
- data/test/buildbot/vendor/choices-0.4.0.tar.gz +0 -0
- data/test/config/acceptance_boxes.yml +7 -0
- data/test/unit/test_helper.rb +4 -0
- data/test/unit/vagrant/action/box/download_test.rb +2 -2
- data/test/unit/vagrant/action/vm/check_box_test.rb +6 -1
- data/test/unit/vagrant/action/vm/share_folders_test.rb +1 -1
- data/test/unit/vagrant/command/init_test.rb +10 -0
- data/test/unit/vagrant/downloaders/http_test.rb +12 -1
- data/test/unit/vagrant/provisioners/chef_test.rb +7 -0
- data/test/unit/vagrant/ssh/session_test.rb +2 -2
- data/test/unit/vagrant/ssh_test.rb +5 -8
- data/vagrant.gemspec +6 -0
- metadata +177 -1
|
@@ -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)
|
|
Binary file
|
|
@@ -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
|
data/test/unit/test_helper.rb
CHANGED
|
@@ -39,9 +39,9 @@ class DownloadBoxActionTest < Test::Unit::TestCase
|
|
|
39
39
|
assert @instance.instantiate_downloader
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
should "
|
|
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::
|
|
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
|
-
|
|
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", "
|
|
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
|
|
14
|
-
@session.expects(:open_channel).times(
|
|
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
|
-
|
|
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(
|
|
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 "
|
|
207
|
-
@ssh.expects(:execute).yields(
|
|
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
|
data/vagrant.gemspec
CHANGED
|
@@ -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,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vagrantup
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mitchell Hashimoto
|
|
@@ -151,6 +151,20 @@ dependencies:
|
|
|
151
151
|
- - '>='
|
|
152
152
|
- !ruby/object:Gem::Version
|
|
153
153
|
version: 0.1.2
|
|
154
|
+
- !ruby/object:Gem::Dependency
|
|
155
|
+
name: log4r
|
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
|
157
|
+
requirements:
|
|
158
|
+
- - ~>
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: 1.1.9
|
|
161
|
+
type: :development
|
|
162
|
+
prerelease: false
|
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
164
|
+
requirements:
|
|
165
|
+
- - ~>
|
|
166
|
+
- !ruby/object:Gem::Version
|
|
167
|
+
version: 1.1.9
|
|
154
168
|
- !ruby/object:Gem::Dependency
|
|
155
169
|
name: minitest
|
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -179,6 +193,76 @@ dependencies:
|
|
|
179
193
|
- - '>='
|
|
180
194
|
- !ruby/object:Gem::Version
|
|
181
195
|
version: '0'
|
|
196
|
+
- !ruby/object:Gem::Dependency
|
|
197
|
+
name: childprocess
|
|
198
|
+
requirement: !ruby/object:Gem::Requirement
|
|
199
|
+
requirements:
|
|
200
|
+
- - ~>
|
|
201
|
+
- !ruby/object:Gem::Version
|
|
202
|
+
version: 0.2.3
|
|
203
|
+
type: :development
|
|
204
|
+
prerelease: false
|
|
205
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
206
|
+
requirements:
|
|
207
|
+
- - ~>
|
|
208
|
+
- !ruby/object:Gem::Version
|
|
209
|
+
version: 0.2.3
|
|
210
|
+
- !ruby/object:Gem::Dependency
|
|
211
|
+
name: sys-proctable
|
|
212
|
+
requirement: !ruby/object:Gem::Requirement
|
|
213
|
+
requirements:
|
|
214
|
+
- - ~>
|
|
215
|
+
- !ruby/object:Gem::Version
|
|
216
|
+
version: 0.9.0
|
|
217
|
+
type: :development
|
|
218
|
+
prerelease: false
|
|
219
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
220
|
+
requirements:
|
|
221
|
+
- - ~>
|
|
222
|
+
- !ruby/object:Gem::Version
|
|
223
|
+
version: 0.9.0
|
|
224
|
+
- !ruby/object:Gem::Dependency
|
|
225
|
+
name: rspec-core
|
|
226
|
+
requirement: !ruby/object:Gem::Requirement
|
|
227
|
+
requirements:
|
|
228
|
+
- - ~>
|
|
229
|
+
- !ruby/object:Gem::Version
|
|
230
|
+
version: 2.7.1
|
|
231
|
+
type: :development
|
|
232
|
+
prerelease: false
|
|
233
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
234
|
+
requirements:
|
|
235
|
+
- - ~>
|
|
236
|
+
- !ruby/object:Gem::Version
|
|
237
|
+
version: 2.7.1
|
|
238
|
+
- !ruby/object:Gem::Dependency
|
|
239
|
+
name: rspec-expectations
|
|
240
|
+
requirement: !ruby/object:Gem::Requirement
|
|
241
|
+
requirements:
|
|
242
|
+
- - ~>
|
|
243
|
+
- !ruby/object:Gem::Version
|
|
244
|
+
version: 2.7.0
|
|
245
|
+
type: :development
|
|
246
|
+
prerelease: false
|
|
247
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
248
|
+
requirements:
|
|
249
|
+
- - ~>
|
|
250
|
+
- !ruby/object:Gem::Version
|
|
251
|
+
version: 2.7.0
|
|
252
|
+
- !ruby/object:Gem::Dependency
|
|
253
|
+
name: rspec-mocks
|
|
254
|
+
requirement: !ruby/object:Gem::Requirement
|
|
255
|
+
requirements:
|
|
256
|
+
- - ~>
|
|
257
|
+
- !ruby/object:Gem::Version
|
|
258
|
+
version: 2.7.0
|
|
259
|
+
type: :development
|
|
260
|
+
prerelease: false
|
|
261
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
262
|
+
requirements:
|
|
263
|
+
- - ~>
|
|
264
|
+
- !ruby/object:Gem::Version
|
|
265
|
+
version: 2.7.0
|
|
182
266
|
description: Vagrant is a tool for building and distributing virtualized development
|
|
183
267
|
environments.
|
|
184
268
|
email:
|
|
@@ -299,6 +383,7 @@ files:
|
|
|
299
383
|
- lib/vagrant/hosts/base.rb
|
|
300
384
|
- lib/vagrant/hosts/bsd.rb
|
|
301
385
|
- lib/vagrant/hosts/fedora.rb
|
|
386
|
+
- lib/vagrant/hosts/freebsd.rb
|
|
302
387
|
- lib/vagrant/hosts/linux.rb
|
|
303
388
|
- lib/vagrant/plugin.rb
|
|
304
389
|
- lib/vagrant/provisioners.rb
|
|
@@ -329,6 +414,7 @@ files:
|
|
|
329
414
|
- lib/vagrant/util.rb
|
|
330
415
|
- lib/vagrant/util/busy.rb
|
|
331
416
|
- lib/vagrant/util/counter.rb
|
|
417
|
+
- lib/vagrant/util/file_checksum.rb
|
|
332
418
|
- lib/vagrant/util/hash_with_indifferent_access.rb
|
|
333
419
|
- lib/vagrant/util/platform.rb
|
|
334
420
|
- lib/vagrant/util/retryable.rb
|
|
@@ -337,6 +423,9 @@ files:
|
|
|
337
423
|
- lib/vagrant/util/template_renderer.rb
|
|
338
424
|
- lib/vagrant/version.rb
|
|
339
425
|
- lib/vagrant/vm.rb
|
|
426
|
+
- tasks/acceptance.rake
|
|
427
|
+
- tasks/bundler.rake
|
|
428
|
+
- tasks/test.rake
|
|
340
429
|
- templates/chef_server_client.erb
|
|
341
430
|
- templates/chef_solo_solo.erb
|
|
342
431
|
- templates/commands/init/Vagrantfile.erb
|
|
@@ -350,6 +439,92 @@ files:
|
|
|
350
439
|
- templates/nfs/exports_linux.erb
|
|
351
440
|
- templates/package_Vagrantfile.erb
|
|
352
441
|
- templates/ssh_config.erb
|
|
442
|
+
- test/acceptance/base.rb
|
|
443
|
+
- test/acceptance/box_test.rb
|
|
444
|
+
- test/acceptance/destroy_test.rb
|
|
445
|
+
- test/acceptance/halt_test.rb
|
|
446
|
+
- test/acceptance/init_test.rb
|
|
447
|
+
- test/acceptance/resume_test.rb
|
|
448
|
+
- test/acceptance/ssh_test.rb
|
|
449
|
+
- test/acceptance/support/config.rb
|
|
450
|
+
- test/acceptance/support/isolated_environment.rb
|
|
451
|
+
- test/acceptance/support/matchers/have_color.rb
|
|
452
|
+
- test/acceptance/support/matchers/match_output.rb
|
|
453
|
+
- test/acceptance/support/output.rb
|
|
454
|
+
- test/acceptance/support/shared/base_context.rb
|
|
455
|
+
- test/acceptance/support/shared/command_examples.rb
|
|
456
|
+
- test/acceptance/support/tempdir.rb
|
|
457
|
+
- test/acceptance/support/virtualbox.rb
|
|
458
|
+
- test/acceptance/suspend_test.rb
|
|
459
|
+
- test/acceptance/up_basic_test.rb
|
|
460
|
+
- test/acceptance/up_with_box_url.rb
|
|
461
|
+
- test/acceptance/vagrant_test.rb
|
|
462
|
+
- test/acceptance/version_test.rb
|
|
463
|
+
- test/buildbot/README.md
|
|
464
|
+
- test/buildbot/buildbot_config/__init__.py
|
|
465
|
+
- test/buildbot/buildbot_config/config/__init__.py
|
|
466
|
+
- test/buildbot/buildbot_config/config/loader.py
|
|
467
|
+
- test/buildbot/buildbot_config/config/master.py
|
|
468
|
+
- test/buildbot/buildbot_config/config/slave.py
|
|
469
|
+
- test/buildbot/buildbot_config/master/__init__.py
|
|
470
|
+
- test/buildbot/buildbot_config/master/builders.py
|
|
471
|
+
- test/buildbot/buildbot_config/master/buildsteps.py
|
|
472
|
+
- test/buildbot/buildbot_config/master/change_sources.py
|
|
473
|
+
- test/buildbot/buildbot_config/master/schedulers.py
|
|
474
|
+
- test/buildbot/buildbot_config/master/slaves.py
|
|
475
|
+
- test/buildbot/buildbot_config/master/status.py
|
|
476
|
+
- test/buildbot/master/Makefile.sample
|
|
477
|
+
- test/buildbot/master/buildbot.tac
|
|
478
|
+
- test/buildbot/master/master.cfg
|
|
479
|
+
- test/buildbot/master/public_html/bg_gradient.jpg
|
|
480
|
+
- test/buildbot/master/public_html/default.css
|
|
481
|
+
- test/buildbot/master/public_html/favicon.ico
|
|
482
|
+
- test/buildbot/master/public_html/robots.txt
|
|
483
|
+
- test/buildbot/master/public_html/static/css/bootstrap-1.4.0.min.css
|
|
484
|
+
- test/buildbot/master/public_html/static/css/prettify.css
|
|
485
|
+
- test/buildbot/master/public_html/static/css/syntax.css
|
|
486
|
+
- test/buildbot/master/public_html/static/css/vagrant.base.css
|
|
487
|
+
- test/buildbot/master/public_html/static/images/base_box_mac.jpg
|
|
488
|
+
- test/buildbot/master/public_html/static/images/getting-started/success.jpg
|
|
489
|
+
- test/buildbot/master/public_html/static/images/icons/error.png
|
|
490
|
+
- test/buildbot/master/public_html/static/images/vagrant_chilling.png
|
|
491
|
+
- test/buildbot/master/public_html/static/images/vagrant_holding.png
|
|
492
|
+
- test/buildbot/master/public_html/static/images/vagrant_looking.png
|
|
493
|
+
- test/buildbot/master/public_html/static/images/windows/alter_path.jpg
|
|
494
|
+
- test/buildbot/master/public_html/static/images/windows/edit_path.jpg
|
|
495
|
+
- test/buildbot/master/public_html/static/images/windows/environment_variables_button.jpg
|
|
496
|
+
- test/buildbot/master/public_html/static/images/windows/port_and_ppk_path.jpg
|
|
497
|
+
- test/buildbot/master/public_html/static/images/windows/ppk_selection.jpg
|
|
498
|
+
- test/buildbot/master/public_html/static/images/windows/putty_first_screen.jpg
|
|
499
|
+
- test/buildbot/master/public_html/static/images/windows/save_result.jpg
|
|
500
|
+
- test/buildbot/master/public_html/static/images/windows/vbox_manage_default_location.jpg
|
|
501
|
+
- test/buildbot/master/public_html/static/js/bootstrap-tabs.js
|
|
502
|
+
- test/buildbot/master/public_html/static/js/jquery-1.7.min.js
|
|
503
|
+
- test/buildbot/master/templates/authfail.html
|
|
504
|
+
- test/buildbot/master/templates/build.html
|
|
505
|
+
- test/buildbot/master/templates/builder.html
|
|
506
|
+
- test/buildbot/master/templates/builders.html
|
|
507
|
+
- test/buildbot/master/templates/buildslave.html
|
|
508
|
+
- test/buildbot/master/templates/buildslaves.html
|
|
509
|
+
- test/buildbot/master/templates/change.html
|
|
510
|
+
- test/buildbot/master/templates/layouts/base.html
|
|
511
|
+
- test/buildbot/master/templates/macros/box.html
|
|
512
|
+
- test/buildbot/master/templates/macros/build_line.html
|
|
513
|
+
- test/buildbot/master/templates/macros/change.html
|
|
514
|
+
- test/buildbot/master/templates/macros/forms.html
|
|
515
|
+
- test/buildbot/master/templates/root.html
|
|
516
|
+
- test/buildbot/master/templates/waterfall.html
|
|
517
|
+
- test/buildbot/requirements.txt
|
|
518
|
+
- test/buildbot/scripts/deploy.sh
|
|
519
|
+
- test/buildbot/scripts/setup.sh
|
|
520
|
+
- test/buildbot/slave/buildbot.tac
|
|
521
|
+
- test/buildbot/slave/info/admin
|
|
522
|
+
- test/buildbot/slave/info/host
|
|
523
|
+
- test/buildbot/tests/__init__.py
|
|
524
|
+
- test/buildbot/tests/master/__init__.py
|
|
525
|
+
- test/buildbot/tests/master/test_slaves.py
|
|
526
|
+
- test/buildbot/vendor/choices-0.4.0.tar.gz
|
|
527
|
+
- test/config/acceptance_boxes.yml
|
|
353
528
|
- test/unit/locales/en.yml
|
|
354
529
|
- test/unit/test_helper.rb
|
|
355
530
|
- test/unit/vagrant/action/box/destroy_test.rb
|
|
@@ -400,6 +575,7 @@ files:
|
|
|
400
575
|
- test/unit/vagrant/command/base_test.rb
|
|
401
576
|
- test/unit/vagrant/command/group_base_test.rb
|
|
402
577
|
- test/unit/vagrant/command/helpers_test.rb
|
|
578
|
+
- test/unit/vagrant/command/init_test.rb
|
|
403
579
|
- test/unit/vagrant/command/package_test.rb
|
|
404
580
|
- test/unit/vagrant/config/base_test.rb
|
|
405
581
|
- test/unit/vagrant/config/error_recorder_test.rb
|