summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan McLellan <btm@chef.io>2015-12-28 15:11:22 -0800
committerBryan McLellan <btm@chef.io>2015-12-28 15:11:22 -0800
commitf14ebfbc5fd72160320860d1c15c6aba59f9967b (patch)
tree41af99036f40a6d5173b4d42c625b8ac80c7fc80
parent58605b2a8f7044e1a3d9a3cd3b82eaf0e0dad716 (diff)
downloadohai-f14ebfbc5fd72160320860d1c15c6aba59f9967b.tar.gz
fix some tests, ish
-rw-r--r--lib/ohai/plugins/linux/network.rb1
-rw-r--r--spec/unit/plugins/linux/network_spec.rb12
2 files changed, 12 insertions, 1 deletions
diff --git a/lib/ohai/plugins/linux/network.rb b/lib/ohai/plugins/linux/network.rb
index 5fb016f2..6bf0ea47 100644
--- a/lib/ohai/plugins/linux/network.rb
+++ b/lib/ohai/plugins/linux/network.rb
@@ -447,6 +447,7 @@ Ohai.plugin(:Network) do
Ohai::Log.debug("Overwriting macaddress #{macaddress} with #{m} from interface #{favored_route[:dev]}") if macaddress
macaddress m
elsif family[:name] == "inet6"
+ # FIXME: we're going to have to guess here when we don't have source
ip6address favored_route[:src]
if macaddress
Ohai::Log.debug("Not setting macaddress from ipv6 interface #{favored_route[:dev]} because macaddress is already set")
diff --git a/spec/unit/plugins/linux/network_spec.rb b/spec/unit/plugins/linux/network_spec.rb
index 99e9d7cd..e08de3bf 100644
--- a/spec/unit/plugins/linux/network_spec.rb
+++ b/spec/unit/plugins/linux/network_spec.rb
@@ -663,7 +663,14 @@ Destination Gateway Genmask Flags Metric Ref Use Iface
expect(plugin['network']['interfaces']['eth0.11']['routes']).to include Mash.new( :destination => "default", :via => "1111:2222:3333:4444::1", :metric => "1024", :family => "inet6")
end
- describe "when there isn't a source field in route entries" do
+ describe "when there isn't a source field in route entries and no ipv6 default routes" do
+ let(:linux_ip_route_inet6) {
+'fe80::/64 dev eth0 proto kernel metric 256
+fe80::/64 dev eth0.11 proto kernel metric 256
+1111:2222:3333:4444::/64 dev eth0.11 metric 1024 expires 86023sec
+'
+ }
+
before(:each) do
plugin.run
end
@@ -959,6 +966,9 @@ fe80::/64 dev eth0.11 proto kernel metric 256
inet6 2001:44b8:4160:8f00:a00:27ff:fe13:eacd/64 scope global dynamic
valid_lft 6128sec preferred_lft 2526sec
'}
+ # We don't have the corresponding ipv6 data for these tests
+ let(:linux_ip_route_inet6) { '' }
+ let(:linux_ip_inet6_neighbor_show) { '' }
before(:each) do
allow(plugin).to receive(:is_openvz?).and_return true