mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Unit context improvements (#1639)
Move the unit context to a name matching the other contexts. Remove some unnecessary entries from it that are unused, and remove references to the old name relying on spec helper to load all contexts.
This commit is contained in:
@@ -22,21 +22,36 @@ shared_context 'unit' do
|
|||||||
test_env.vagrantfile vagrantfile
|
test_env.vagrantfile vagrantfile
|
||||||
test_env
|
test_env
|
||||||
end
|
end
|
||||||
let(:env) { { env: iso_env, machine: machine, ui: ui, root_path: '/rootpath' } }
|
|
||||||
let(:conf) { Vagrant::Config::V2::DummyConfig.new }
|
|
||||||
let(:ui) { Vagrant::UI::Silent.new }
|
|
||||||
let(:iso_env) { test_env.create_vagrant_env ui_class: Vagrant::UI::Basic }
|
let(:iso_env) { test_env.create_vagrant_env ui_class: Vagrant::UI::Basic }
|
||||||
let(:machine) { iso_env.machine(:test, :libvirt) }
|
let(:machine) { iso_env.machine(:test, :libvirt) }
|
||||||
|
let(:ui) { Vagrant::UI::Silent.new }
|
||||||
|
let(:env) { { env: iso_env, machine: machine, ui: ui, root_path: '/rootpath' } }
|
||||||
|
|
||||||
# Mock the communicator to prevent SSH commands for being executed.
|
# Mock the communicator to prevent SSH commands for being executed.
|
||||||
let(:communicator) { double('communicator') }
|
let(:communicator) { double('communicator') }
|
||||||
# Mock the guest operating system.
|
# Mock the guest operating system.
|
||||||
let(:guest) { double('guest') }
|
let(:guest) { double('guest') }
|
||||||
let(:app) { ->(env) {} }
|
let(:app) { ->(env) {} }
|
||||||
let(:plugin) { register_plugin }
|
|
||||||
|
|
||||||
before (:each) do
|
before (:each) do
|
||||||
allow(machine).to receive(:guest).and_return(guest)
|
allow(machine).to receive(:guest).and_return(guest)
|
||||||
allow(machine).to receive(:communicate).and_return(communicator)
|
allow(machine).to receive(:communicate).and_return(communicator)
|
||||||
allow(machine).to receive(:ui).and_return(ui)
|
allow(machine).to receive(:ui).and_return(ui)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
around do |example|
|
||||||
|
Dir.mktmpdir do |tmpdir|
|
||||||
|
original_home = ENV['HOME']
|
||||||
|
|
||||||
|
begin
|
||||||
|
virtual_home = File.expand_path(File.join(tmpdir, 'home'))
|
||||||
|
Dir.mkdir(virtual_home)
|
||||||
|
ENV['HOME'] = virtual_home
|
||||||
|
|
||||||
|
example.run
|
||||||
|
ensure
|
||||||
|
ENV['HOME'] = original_home
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/clean_machine_folder'
|
require 'vagrant-libvirt/action/clean_machine_folder'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant/action/runner'
|
require 'vagrant/action/runner'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'fog/libvirt/models/compute/volume'
|
require 'fog/libvirt/models/compute/volume'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'fog/libvirt/models/compute/volume'
|
require 'fog/libvirt/models/compute/volume'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/destroy_domain'
|
require 'vagrant-libvirt/action/destroy_domain'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/errors'
|
require 'vagrant-libvirt/errors'
|
||||||
require 'vagrant-libvirt/action/forward_ports'
|
require 'vagrant-libvirt/action/forward_ports'
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
require 'vagrant-libvirt/action/halt_domain'
|
require 'vagrant-libvirt/action/halt_domain'
|
||||||
|
|
||||||
describe VagrantPlugins::ProviderLibvirt::Action::HaltDomain do
|
describe VagrantPlugins::ProviderLibvirt::Action::HaltDomain do
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'json'
|
require 'json'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/destroy_domain'
|
require 'vagrant-libvirt/action/destroy_domain'
|
||||||
require 'vagrant-libvirt/util/byte_number'
|
require 'vagrant-libvirt/util/byte_number'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/clean_machine_folder'
|
require 'vagrant-libvirt/action/clean_machine_folder'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/prepare_nfs_settings'
|
require 'vagrant-libvirt/action/prepare_nfs_settings'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/remove_libvirt_image'
|
require 'vagrant-libvirt/action/remove_libvirt_image'
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/set_boot_order'
|
require 'vagrant-libvirt/action/set_boot_order'
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
require 'vagrant-libvirt/action/shutdown_domain'
|
require 'vagrant-libvirt/action/shutdown_domain'
|
||||||
|
|
||||||
describe VagrantPlugins::ProviderLibvirt::Action::StartShutdownTimer do
|
describe VagrantPlugins::ProviderLibvirt::Action::StartShutdownTimer do
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/errors'
|
require 'vagrant-libvirt/errors'
|
||||||
require 'vagrant-libvirt/action/start_domain'
|
require 'vagrant-libvirt/action/start_domain'
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'vagrant-libvirt/action/wait_till_up'
|
require 'vagrant-libvirt/action/wait_till_up'
|
||||||
require 'vagrant-libvirt/errors'
|
require 'vagrant-libvirt/errors'
|
||||||
|
|
||||||
require 'spec_helper'
|
|
||||||
require 'support/sharedcontext'
|
|
||||||
require 'support/libvirt_context'
|
|
||||||
|
|
||||||
describe VagrantPlugins::ProviderLibvirt::Action::WaitTillUp do
|
describe VagrantPlugins::ProviderLibvirt::Action::WaitTillUp do
|
||||||
subject { described_class.new(app, env) }
|
subject { described_class.new(app, env) }
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant/action/runner'
|
require 'vagrant/action/runner'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt'
|
require 'vagrant-libvirt'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/cap/synced_folder_9p'
|
require 'vagrant-libvirt/cap/synced_folder_9p'
|
||||||
require 'vagrant-libvirt/util/unindent'
|
require 'vagrant-libvirt/util/unindent'
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/cap/synced_folder_virtiofs'
|
require 'vagrant-libvirt/cap/synced_folder_virtiofs'
|
||||||
require 'vagrant-libvirt/util/unindent'
|
require 'vagrant-libvirt/util/unindent'
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
require 'support/binding_proc'
|
require 'support/binding_proc'
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/config'
|
require 'vagrant-libvirt/config'
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ require 'fog/libvirt/requests/compute/dhcp_leases'
|
|||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/binding_proc'
|
require 'support/binding_proc'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt/driver'
|
require 'vagrant-libvirt/driver'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'support/sharedcontext'
|
|
||||||
|
|
||||||
require 'vagrant-libvirt'
|
require 'vagrant-libvirt'
|
||||||
require 'vagrant-libvirt/plugin'
|
require 'vagrant-libvirt/plugin'
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require 'support/sharedcontext'
|
require 'spec_helper'
|
||||||
|
|
||||||
require 'vagrant-libvirt/config'
|
require 'vagrant-libvirt/config'
|
||||||
require 'vagrant-libvirt/util/erb_template'
|
require 'vagrant-libvirt/util/erb_template'
|
||||||
|
|||||||
Reference in New Issue
Block a user