diff options
author | Tim Smith <tsmith@chef.io> | 2017-07-19 10:35:59 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2017-07-19 10:35:59 -0700 |
commit | 070441f81bb1da0c45fb0b25b0f7a62c9c19c374 (patch) | |
tree | 20a94b61e76a5d37ebda074bd465955da101ed77 | |
parent | 1cccf0b0e0ec12a2276ce586ca58ba4b9e6472c4 (diff) | |
download | ohai-f5.tar.gz |
Add a test for bigip platform detectionf5
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/unit/plugins/linux/platform_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index 807c2b09..efe2884e 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -37,6 +37,7 @@ describe Ohai::System, "Linux plugin platform" do let(:have_os_release) { false } let(:have_usr_lib_os_release) { false } let(:have_cisco_release) { false } + let(:have_f5_release) { false } let(:have_cumulus_dir) { false } before(:each) do @@ -58,6 +59,7 @@ describe Ohai::System, "Linux plugin platform" do allow(File).to receive(:exist?).with("/etc/parallels-release").and_return(have_parallels_release) allow(File).to receive(:exist?).with("/usr/bin/raspi-config").and_return(have_raspi_config) allow(File).to receive(:exist?).with("/etc/os-release").and_return(have_os_release) + allow(File).to receive(:exist?).with("/etc/f5-release").and_return(have_f5_release) allow(File).to receive(:exist?).with("/usr/lib/os-release").and_return(have_usr_lib_os_release) allow(File).to receive(:exist?).with("/etc/shared/os-release").and_return(have_cisco_release) allow(Dir).to receive(:exist?).with("/etc/cumulus").and_return(have_cumulus_dir) @@ -309,6 +311,23 @@ OS_RELEASE end end + describe "on f5 big-ip" do + + let(:have_f5_release) { true } + + before(:each) do + @plugin.lsb = nil + end + + it "should set platform to bigip" do + expect(File).to receive(:read).with("/etc/f5-release").and_return("BIG-IP release 13.0.0 (Final)") + @plugin.run + expect(@plugin[:platform]).to eq("bigip") + expect(@plugin[:platform_family]).to eq("rhel") + expect(@plugin[:platform_version]).to eq("13.0.0") + end + end + describe "on exherbo" do let(:have_exherbo_release) { true } |