diff --git a/spec/Vagrantfile b/spec/Vagrantfile index 6cd3997..2364852 100644 --- a/spec/Vagrantfile +++ b/spec/Vagrantfile @@ -4,9 +4,14 @@ Vagrant.require_plugin 'vagrant-lxc' Vagrant.require_plugin 'vagrant-cachier' +ENV['BOX_NAME'] ||= 'quantal64' + Vagrant.configure("2") do |config| - config.vm.box = ENV.fetch('BOX_NAME', 'quantal64') - config.vm.hostname = 'lxc-test-box' + config.vm.box = ENV['BOX_NAME'] + # FIXME: Find out why this does not work for debian boxes + unless %w( squeeze64 wheezy64 sid64 ).include? config.vm.box + config.vm.hostname = 'lxc-test-box' + end config.cache.enable :apt @@ -15,5 +20,5 @@ Vagrant.configure("2") do |config| config.vm.network :forwarded_port, guest: 80, host: 8080 config.vm.provision :shell, - inline: 'sudo apt-get install nginx -y && sudo service nginx start' + inline: 'sudo apt-get install apache2 -y' end diff --git a/spec/acceptance/sanity_check_spec.rb b/spec/acceptance/sanity_check_spec.rb index 4f2fd71..b67987e 100644 --- a/spec/acceptance/sanity_check_spec.rb +++ b/spec/acceptance/sanity_check_spec.rb @@ -20,7 +20,10 @@ describe 'Sanity check' do end it "is able to be SSH'ed" do - expect(vagrant_ssh('hostname')).to eq 'lxc-test-box' + expected = 'lxc-test-box' + # HACK: + expected = ENV['BOX_NAME'].gsub(/64$/, '') if %w( squeeze64 wheezy64 sid64 ).include? ENV['BOX_NAME'] + expect(vagrant_ssh('hostname')).to eq expected end it 'mounts shared folders with the right permissions' do @@ -36,7 +39,7 @@ describe 'Sanity check' do it 'forwards configured ports' do output = `curl -s localhost:8080`.strip.chomp - expect(output).to include 'Welcome to nginx!' + expect(output).to include 'It works!' end end