From 199a58fdd902cdb7e9f7d9707d5b1f36358682aa Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 1 Oct 2015 08:47:25 -0400 Subject: [PATCH] test: test IPv6 --- .../virtualbox_driver_version_4_x_examples.rb | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/test/unit/plugins/providers/virtualbox/support/shared/virtualbox_driver_version_4_x_examples.rb b/test/unit/plugins/providers/virtualbox/support/shared/virtualbox_driver_version_4_x_examples.rb index a56a45311..85dee3cb1 100644 --- a/test/unit/plugins/providers/virtualbox/support/shared/virtualbox_driver_version_4_x_examples.rb +++ b/test/unit/plugins/providers/virtualbox/support/shared/virtualbox_driver_version_4_x_examples.rb @@ -202,6 +202,35 @@ shared_examples "a version 4.x virtualbox driver" do |options| ]) end end + + context "with an IPv6 host-only interface" do + let(:output) { + <<-OUTPUT.gsub(/^ */, '') + Name: vboxnet1 + GUID: 786f6276-656e-4174-8000-0a0027000001 + DHCP: Disabled + IPAddress: 192.168.57.1 + NetworkMask: 255.255.255.0 + IPV6Address: fde4:8dba:82e1:: + IPV6NetworkMaskPrefixLength: 64 + HardwareAddress: 0a:00:27:00:00:01 + MediumType: Ethernet + Status: Up + VBoxNetworkName: HostInterfaceNetworking-vboxnet1 + OUTPUT + } + + it "returns a list with one entry describing that interface" do + expect(subject.read_host_only_interfaces).to eq([{ + name: 'vboxnet1', + ip: '192.168.57.1', + netmask: '255.255.255.0', + ipv6: 'fde4:8dba:82e1::', + ipv6_prefix: '64', + status: 'Up', + }]) + end + end end describe "remove_dhcp_server" do