Clean up sanity check code

This commit is contained in:
Fabio Rehm 2013-04-21 18:49:26 -03:00
parent 7ce99c4e99
commit b0490c8639

View file

@ -11,11 +11,11 @@ describe 'Sanity check' do
it 'creates a container' do it 'creates a container' do
containers = `sudo lxc-ls`.chomp.split(/\s+/).uniq containers = `sudo lxc-ls`.chomp.split(/\s+/).uniq
expect(containers).to include File.read('/vagrant/spec/.vagrant/machines/default/lxc/id').strip.chomp expect(containers).to include vagrant_container_name
end end
it 'starts the newly created container' do it 'starts the newly created container' do
status = `sudo lxc-info -n #{File.read('/vagrant/spec/.vagrant/machines/default/lxc/id').strip.chomp}` status = `sudo lxc-info -n #{vagrant_container_name}`
expect(status).to include 'RUNNING' expect(status).to include 'RUNNING'
end end
@ -48,7 +48,7 @@ describe 'Sanity check' do
end end
it 'shuts down container' do it 'shuts down container' do
status = `sudo lxc-info -n #{File.read('/vagrant/spec/.vagrant/machines/default/lxc/id').strip.chomp}` status = `sudo lxc-info -n #{vagrant_container_name}`
expect(status).to include 'STOPPED' expect(status).to include 'STOPPED'
end end
@ -62,7 +62,7 @@ describe 'Sanity check' do
before(:all) do before(:all) do
destroy_container destroy_container
vagrant_up vagrant_up
@container_name = File.read('/vagrant/spec/.vagrant/machines/default/lxc/id').strip.chomp @container_name = vagrant_container_name
vagrant_destroy vagrant_destroy
end end