diff options
author | Jere Julian <jere@arista.com> | 2016-08-10 16:04:07 -0400 |
---|---|---|
committer | Jere Julian <jere@arista.com> | 2016-08-10 16:04:07 -0400 |
commit | 4862f60607b8e49dc88052ae3a15db3c4b4d0850 (patch) | |
tree | f797c769e5ece3da16634c5f83c6ce847f3f50d5 /spec | |
parent | f9992941f3a39937362d1c98cb4dc63bd9d5b680 (diff) | |
download | ohai-4862f60607b8e49dc88052ae3a15db3c4b4d0850.tar.gz |
Add platform detection for Arista EOS
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/plugins/linux/platform_spec.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index 3501610e..409021a9 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -46,6 +46,7 @@ describe Ohai::System, "Linux plugin platform" do allow(File).to receive(:exist?).with("/etc/gentoo-release").and_return(have_gentoo_release) allow(File).to receive(:exist?).with("/etc/exherbo-release").and_return(have_exherbo_release) allow(File).to receive(:exist?).with("/etc/alpine-release").and_return(have_alpine_release) + allow(File).to receive(:exist?).with("/etc/Eos-release").and_return(have_eos_release) allow(File).to receive(:exist?).with("/etc/SuSE-release").and_return(have_suse_release) allow(File).to receive(:exist?).with("/etc/arch-release").and_return(have_arch_release) allow(File).to receive(:exist?).with("/etc/system-release").and_return(have_system_release) @@ -246,6 +247,23 @@ describe Ohai::System, "Linux plugin platform" do end end + describe "on arista eos" do + + let(:have_eos_release) { true } + + before(:each) do + @plugin.lsb = nil + end + + it "should set platform to arista_eos" do + expect(File).to receive(:read).with("/etc/Eos-release").and_return("Arista Networks EOS 4.16.7M") + @plugin.run + expect(@plugin[:platform]).to eq("arista_eos") + expect(@plugin[:platform_family]).to eq("fedora") + expect(@plugin[:platform_version]).to eq("4.16.7M") + end + end + describe "on exherbo" do let(:have_exherbo_release) { true } |