Sha256: af4bd072c6c4d5569294ae83bacc4387d01ae89b888d89637accd09f1a43dcab

Contents?: true

Size: 1.22 KB

Versions: 9

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'use qemu agent to determine machine private address', acceptance: true do
  include_context 'libvirt_acceptance'

  before do
    environment.skeleton('qemu_agent')
  end

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

  it 'should succeed' do
    status('Test: machine is created successfully')
    result = environment.execute('vagrant', 'up')
    expect(result).to exit_with(0)

    # extract SSH IP address emitted as it should be the private network since
    # the mgmt network has not been attached
    hostname = result.stdout.each_line.find { |line| line.include?('SSH address:') }
    expect(hostname).to_not be_nil
    ip_address = hostname.strip.split.last.split(':').first
    # default private network for vagrant-libvirt unless explicitly configured
    expect(IPAddr.new('172.28.128.0/255.255.255.0')).to include(IPAddr.new(ip_address))

    # ssh'ing successfully means that the private network is accessible
    status('Test: machine private network is accessible')
    result = environment.execute('vagrant', 'ssh', '-c', 'echo "hello, world"')
    expect(result).to exit_with(0)
    expect(result.stdout).to match(/hello, world/)
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-libvirt-0.10.8 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.7 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.6 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.5 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.4 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.3 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.2 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.1 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb
vagrant-libvirt-0.10.0 spec/acceptance/use_qemu_agent_for_connectivity_spec.rb