diff options
author | Eike Waldt <waldt@b1-systems.de> | 2018-02-26 18:03:18 +0100 |
---|---|---|
committer | Eike Waldt <waldt@b1-systems.de> | 2018-02-26 18:10:22 +0100 |
commit | 7e27641a9b6ea8126eb14154b9ba7fdd073018ba (patch) | |
tree | 37c4f454cdbafc41a3b5eeba37c1df3bf4b60cdd | |
parent | 88f4b8526d65f0e837c7bea78ba1869fa4a25ee4 (diff) | |
download | ohai-7e27641a9b6ea8126eb14154b9ba7fdd073018ba.tar.gz |
os-release example for SLES 15
-rw-r--r-- | spec/unit/plugins/linux/platform_spec.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb index efe2884e..6b6b4aee 100644 --- a/spec/unit/plugins/linux/platform_spec.rb +++ b/spec/unit/plugins/linux/platform_spec.rb @@ -686,6 +686,17 @@ CISCO_RELEASE describe "on suse" do + describe "with os-release results" do + let(:have_suse_release) { false } + it "should read the platform as sles on SLES 15" do + expect(File).to receive(:read).with("/etc/os-release"). and_return("VERSION=\"15\"\nVERSION_ID=\"15\"\nPRETTY_NAME=\"SUSE Linux Enterprise Server 15\"\nID=\"sles\"\nID_LIKE=\"suse\"\nANSI_COLOR=\"0;32\"\nCPE_NAME=\"cpe:/o:suse:sles:15\"\n") + @plugin.run + expect(@plugin[:platform_family]).to eq("suse") + expect(@plugin[:platform]).to eq("sles") + expect(@plugin[:platform_version]).to eq("15") + end + end + let(:have_suse_release) { true } describe "with lsb_release results" do |