Sha256: 1673daa02ef34df0bd7e9766c210e485ac8be651757576fd4ef967067c3189e9
Contents?: true
Size: 1.33 KB
Versions: 15
Compression:
Stored size: 1.33 KB
Contents
require_relative "../../../../base" describe "VagrantPlugins::GuestFreeBSD::Cap::ConfigureNetworks" do let(:described_class) do VagrantPlugins::GuestFreeBSD::Plugin .components .guest_capabilities[:freebsd] .get(:configure_networks) end let(:machine) { double("machine") } let(:comm) { VagrantTests::DummyCommunicator::Communicator.new(machine) } before do allow(machine).to receive(:communicate).and_return(comm) comm.stub_command("ifconfig -a | grep -o ^[0-9a-z]* | grep -v '^lo'", stdout: "em1\nem2") end after do comm.verify_expectations! end describe ".configure_networks" do let(:network_1) do { interface: 0, type: "dhcp", } end let(:network_2) do { interface: 1, type: "static", ip: "33.33.33.10", netmask: "255.255.0.0", gateway: "33.33.0.1", } end it "creates and starts the networks" do described_class.configure_networks(machine, [network_1, network_2]) expect(comm.received_commands[1]).to match(/dhclient 'em1'/) expect(comm.received_commands[1]).to match(/\/etc\/rc.d\/netif restart 'em1'/) expect(comm.received_commands[1]).to_not match(/dhclient 'em2'/) expect(comm.received_commands[1]).to match(/\/etc\/rc.d\/netif restart 'em2'/) end end end
Version data entries
15 entries across 15 versions & 3 rubygems