diff options
author | Jaymala Sinha <jsinha@chef.io> | 2017-07-10 16:09:27 -0400 |
---|---|---|
committer | Jaymala Sinha <jsinha@chef.io> | 2017-07-11 10:00:56 -0400 |
commit | 73407bd5c123feb17414e8b483009a90324f6405 (patch) | |
tree | 5003b0750c9bffc16fb6f8d0d3d05e589b2c7b2e | |
parent | dd111fe4aef4e7986a5fa6d0eb50646fd419723e (diff) | |
download | ohai-73407bd5c123feb17414e8b483009a90324f6405.tar.gz |
Address review comments
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
-rw-r--r-- | lib/ohai/plugins/solaris2/network.rb | 2 | ||||
-rw-r--r-- | spec/unit/plugins/solaris2/network_spec.rb | 9 |
2 files changed, 4 insertions, 7 deletions
diff --git a/lib/ohai/plugins/solaris2/network.rb b/lib/ohai/plugins/solaris2/network.rb index e1be22e6..93231bac 100644 --- a/lib/ohai/plugins/solaris2/network.rb +++ b/lib/ohai/plugins/solaris2/network.rb @@ -103,7 +103,7 @@ Ohai.plugin(:Network) do cint = nil so.stdout.lines do |line| - # if line =~ /^([0-9a-zA-Z\.\:\-]+)\S/ + # regex: http://rubular.com/r/Iag7JLVTVe if line =~ /^([0-9a-zA-Z\.\:\-]+): \S+ mtu (\d+) index (\d+)/ cint = $1 iface[cint] = Mash.new unless iface[cint] diff --git a/spec/unit/plugins/solaris2/network_spec.rb b/spec/unit/plugins/solaris2/network_spec.rb index 5112294e..43570741 100644 --- a/spec/unit/plugins/solaris2/network_spec.rb +++ b/spec/unit/plugins/solaris2/network_spec.rb @@ -69,9 +69,7 @@ lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1 eri0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 \ index 2 inet 172.17.128.208 netmask ffffff00 broadcast 172.17.128.255 -ip6.tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> \ -mtu 1460 - index 3 +ip6.tun0: flags=10008d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST,IPv4> mtu 1460 index 3 inet6 tunnel src fe80::1 tunnel dst fe80::2 tunnel security settings --> use 'ipsecconf -ln -i ip.tun1' tunnel hop limit 60 tunnel encapsulation limit 4 @@ -80,8 +78,7 @@ qfe1: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 3 usesrc vni0 inet6 fe80::203:baff:fe17:4be0/10 ether 0:3:ba:17:4b:e0 -vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 0 - index 5 +vni0: flags=2002210041<UP,RUNNING,NOXMIT,NONUD,IPv6,VIRTUAL> mtu 1460 index 5 srcof qfe1 inet6 fe80::203:baff:fe17:4444/128 ENDIFCONFIG @@ -147,7 +144,7 @@ ROUTE_GET end it "detects the interfaces" do - expect(@plugin["network"]["interfaces"].keys.sort).to eq(["e1000g0:3", "e1000g2:1", "eri0", "ip.tun0", "ip.tun0:1", "lo0", "lo0:3", "net0", "net1:1", "qfe1"]) + expect(@plugin["network"]["interfaces"].keys.sort).to eq(["e1000g0:3", "e1000g2:1", "eri0", "ip.tun0", "ip.tun0:1", "ip6.tun0", "lo0", "lo0:3", "net0", "net1:1", "qfe1", "vni0"]) end it "detects the ip addresses of the interfaces" do |