Sha256: 0cbcddbfe006253dfa46d3e094c63f1e9fb164896db5fa5c5a4ee3b71774fb46

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

# This tests that an instance can be halted correctly
shared_examples 'provider/halt' do |provider, options|
  unless options[:box]
    raise ArgumentError,
          "box option must be specified for provider: #{provider}"
  end

  include_context 'acceptance'

  before do
    environment.skeleton('generic')
    assert_execute('vagrant', 'box', 'add', 'basic', options[:box])
    assert_execute('vagrant', 'up', "--provider=#{provider}")
  end

  after do
    assert_execute('vagrant', 'destroy', '--force')
  end

  it 'should halt the machine and bring it back up' do
    status("Test: machine can be halted")
    halt_result = execute("vagrant", "halt")
    expect(halt_result).to exit_with(0)

    status("Test: machine can be brought up after halt")
    up_result = execute("vagrant", "up")
    expect(up_result).to exit_with(0)

    status("Test: machine is running after up")
    echo_result = execute("vagrant", "ssh", "-c", "echo foo")
    expect(echo_result).to exit_with(0)
    expect(echo_result.stdout).to match(/foo\n$/)
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
vagrant-google-2.7.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.6.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.5.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.4.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.4.0.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.3.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.3.0.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.2.1 test/acceptance/provider/halt_spec.rb
vagrant-google-2.2.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.2.0.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.1.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.0.0 test/acceptance/provider/halt_spec.rb
vagrant-google-2.0.0.rc1 test/acceptance/provider/halt_spec.rb
vagrant-google-2.0.0.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-1.0.0 test/acceptance/provider/halt_spec.rb
vagrant-google-1.0.0.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-0.2.5 test/acceptance/provider/halt_spec.rb
vagrant-google-0.2.5.rc0 test/acceptance/provider/halt_spec.rb
vagrant-google-0.2.4 test/acceptance/provider/halt_spec.rb
vagrant-google-0.2.3 test/acceptance/provider/halt_spec.rb