vaguerent/test/unit/plugins/guests/suse/cap/nfs_client_test.rb
Dan Čermák a3588c28a8
Update nfs & service daemon names for suse based hosts
- nfs.service got recently removed in openSUSE Tumbleweed and calling service
  restart nfs errors out on Tumbleweed. nfs.service has been an alias to
  nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
  => no reason not to use systemctl
2019-09-18 23:28:18 +02:00

32 lines
878 B
Ruby

require_relative "../../../../base"
describe "VagrantPlugins::GuestSUSE::Cap::NFSClient" do
let(:caps) do
VagrantPlugins::GuestSUSE::Plugin
.components
.guest_capabilities[:suse]
end
let(:machine) { double("machine") }
let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) }
before do
allow(machine).to receive(:communicate).and_return(comm)
end
after do
comm.verify_expectations!
end
describe ".nfs_client_install" do
let(:cap) { caps.get(:nfs_client_install) }
it "installs nfs client utilities" do
cap.nfs_client_install(machine)
expect(comm.received_commands[0]).to match(/zypper -n install nfs-client/)
expect(comm.received_commands[0]).to match(/systemctl restart rpcbind/)
expect(comm.received_commands[0]).to match(/systemctl restart nfs-client.target/)
end
end
end