Sha256: c80c8268a4acbb59bb073c80947053d403fa840f08f34f7e562e2ffbfd468959

Contents?: true

Size: 1.18 KB

Versions: 14

Compression:

Stored size: 1.18 KB

Contents

shared_examples "provider/disk/primary" do |provider, options|
  if !options[:box]
    raise ArgumentError,
      "box option must be specified for provider: #{provider}"
  end

  include_context "acceptance"

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

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

  it "configures the primary disk", :skip_windows_guest do
    status("Test: primary disk should be attached")
    result = execute("vagrant", "ssh", "-c", "test -b /dev/sda")
    expect(result.exit_code).to eql(0)

    status("Test: primary disk should grow to target size")
    environment.skeleton("disk_primary_bigger")
    assert_execute("vagrant", "reload")
    result = execute("vagrant", "ssh", "-c", "sudo blockdev --getsize64 /dev/sda")
    expect(result.stdout).to match(/69793218560$/)

    status("Test: primary disk is not removed")
    environment.skeleton("disk_empty")
    assert_execute("vagrant", "reload")
    result = execute("vagrant", "ssh", "-c", "test -b /dev/sda")
    expect(result.exit_code).to eql(0)
  end
end

Version data entries

14 entries across 5 versions & 1 rubygems

Version Path
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-03d88fe24677/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.19.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-03d88fe24677/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.18.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/3.0.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.16.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-b6b56c8b8135/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.14.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/acceptance/disk/primary_spec.rb
vagrant-unbundled-2.2.10.0 vendor/bundle/ruby/2.7.0/bundler/gems/vagrant-spec-93c587f3c98a/acceptance/disk/primary_spec.rb