vaguerent/test/unit/plugins/guests/alpine/cap/nfs_client_test.rb
Tim Schumacher a7f09f010c alpine: Convert nfs_client capability to seperate commands
The workaround for the broken repository should be safe to be removed,
since the last affected Alpine version (<=3.3) EOL'd in November of 2017.

The remaining important commands can be split out into seperate calls
of sudo(), which removes the need for manual exit-code checking
(since it aborts by itself when a command fails) and makes the code
easier to handle in general.
2019-07-26 08:31:12 +02:00

28 lines
969 B
Ruby

require_relative "../../../../base"
describe 'VagrantPlugins::GuestAlpine::Cap::NFSClient' do
let(:described_class) do
VagrantPlugins::GuestAlpine::Plugin.components.guest_capabilities[:alpine].get(:nfs_client_install)
end
let(:machine) { double('machine') }
let(:communicator) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
allow(machine).to receive(:communicate).and_return(communicator)
end
after do
communicator.verify_expectations!
end
it 'should install nfs client' do
described_class.nfs_client_install(machine)
expect(communicator.received_commands[0]).to match(/apk update/)
expect(communicator.received_commands[1]).to match(/apk add --upgrade nfs-utils/)
expect(communicator.received_commands[2]).to match(/rc-update add rpc.statd/)
expect(communicator.received_commands[3]).to match(/rc-service rpc.statd start/)
end
end