summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2017-06-10 20:16:42 -0700
committerTim Smith <tsmith@chef.io>2017-06-10 20:16:42 -0700
commitbbdf084bb8aea261abbc18e497e1060d61fdc187 (patch)
tree5247479ff74e2d4944c654e645ebe617bab741b8
parent7822cae9d3d4d3f14267c051b5c8c67bd9de1156 (diff)
downloadohai-add_clearos_rhel_platform_family.tar.gz
Add a spec for clearos platform detectionadd_clearos_rhel_platform_family
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 1cd544ca..00f1425c 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -429,6 +429,14 @@ OS_RELEASE
expect(@plugin[:platform_version].to_i).to eq(13)
end
+ it "should read the platform as clearos and version as 7.3" do
+ expect(File).to receive(:read).with("/etc/redhat-release").and_return("ClearOS release 7.3.0 (Final)")
+ @plugin.run
+ expect(@plugin[:platform]).to eq("clearos")
+ expect(@plugin[:platform_family]).to eq("rhel")
+ expect(@plugin[:platform_version].to_f).to eq(7.3)
+ end
+
# https://github.com/chef/ohai/issues/560
# Issue is seen on EL7, so that's what we're testing.
context "on versions that have /etc/os-release" do