Sha256: 1f1ab67920414c1442b75ced6e9cbe3fa54d05196d64aafef14e79a69ead4487

Contents?: true

Size: 1.91 KB

Versions: 59

Compression:

Stored size: 1.91 KB

Contents

require File.expand_path("../../base", __FILE__)

describe "vagrant provisioning basics" do
  include_context "acceptance"

  it "doesn't provision with `--no-provision` set" do
    require_box("default")

    assert_execute("vagrant", "box", "add", "base", box_path("default"))

    environment.workdir.join("Vagrantfile").open("w+") do |f|
      f.write(<<-vf)
Vagrant::Config.run do |config|
  config.vm.box = "base"
  config.vm.provision :shell, :inline => "echo success > /vagrant/results"
end
vf
    end

    # Bring the VM up without enabling provisioning
    assert_execute("vagrant", "up", "--no-provision")

    # Verify the file that the script creates does NOT exist
    result_file = environment.workdir.join("results")
    result_file.exist?.should_not be
  end

  it "can provision with multiple provisioners" do
    # Skeleton for multiple provisioners
    environment.skeleton!("provisioner_multi")

    # Setup the basic environment
    require_box("default")
    assert_execute("vagrant", "box", "add", "base", box_path("default"))

    # Bring up the VM
    assert_execute("vagrant", "up")

    # Verify the file the shell provisioner made is there, but not the
    # Chef one.
    environment.workdir.join("shell").exist?.should be
    environment.workdir.join("chef_solo").exist?.should be
  end

  it "only uses the provisioners specified with `--provision-with`" do
    # Skeleton for multiple provisioners
    environment.skeleton!("provisioner_multi")

    # Setup the basic environment
    require_box("default")
    assert_execute("vagrant", "box", "add", "base", box_path("default"))

    # Bring up the VM, only using the shell provisioner
    assert_execute("vagrant", "up", "--provision-with", "shell")

    # Verify the file the shell provisioner made is there, but not the
    # Chef one.
    environment.workdir.join("shell").exist?.should be
    environment.workdir.join("chef_solo").exist?.should_not be
  end
end

Version data entries

59 entries across 59 versions & 11 rubygems

Version Path
tamtam-vagrant-reload-1.1.3 vendor/cache/vagrant-0ac2a8738841/test/acceptance/provisioning/basic_test.rb
tamtam-vagrant-reload-1.1.2 vendor/cache/vagrant-0ac2a8738841/test/acceptance/provisioning/basic_test.rb
tamtam-vagrant-reload-1.1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/provisioning/basic_test.rb
tamtam-vagrant-reload-1.1 vendor/cache/vagrant-0ac2a8738841/test/acceptance/provisioning/basic_test.rb
bmhatfield-vagrant-1.0.10 test/acceptance/provisioning/basic_test.rb
bmhatfield-vagrant-1.0.9 test/acceptance/provisioning/basic_test.rb
tnargav-1.3.6 test/acceptance/provisioning/basic_test.rb
tnargav-1.3.3 test/acceptance/provisioning/basic_test.rb
bmhatfield-vagrant-1.0.8 test/acceptance/provisioning/basic_test.rb
vagrant-shell-0.2.9 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/provisioning/basic_test.rb
tnargav-1.2.3 test/acceptance/provisioning/basic_test.rb
vagrant-shell-0.2.8 demo/templates/vendor/bundle/ruby/1.9.1/gems/tnargav-1.2.2/test/acceptance/provisioning/basic_test.rb
bmhatfield-vagrant-1.0.7 test/acceptance/provisioning/basic_test.rb
vagrant-shell-0.2.6 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/provisioning/basic_test.rb
vagrant-shell-0.2.5 vendor/bundle/gems/tnargav-1.2.2/test/acceptance/provisioning/basic_test.rb
tnargav-1.2.2 test/acceptance/provisioning/basic_test.rb
vagrantup-1.1.3 test/acceptance/provisioning/basic_test.rb
vagrantup-1.1.2 test/acceptance/provisioning/basic_test.rb
vagrantup-1.1.1 test/acceptance/provisioning/basic_test.rb
vagrantup-1.1.0 test/acceptance/provisioning/basic_test.rb