summaryrefslogtreecommitdiff
path: root/spec/unit/plugins
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2021-03-09 10:58:24 -0800
committerTim Smith <tsmith84@gmail.com>2021-03-09 11:40:20 -0800
commitdd9557b308df809c7be6d196de0e492857b3087c (patch)
treed53bedfeec991a3cba9780e50f37a42a03e84713 /spec/unit/plugins
parentfd8c1b65dbb087ddb4df3c8e10b88eae239219d0 (diff)
downloadohai-dd9557b308df809c7be6d196de0e492857b3087c.tar.gz
Update the XCP-ng Linux Detectionxcp
- All supported releases have an /etc/os-release file so nuke the legacy detection - The platform ID in the os-release file is XCP-ng in 7 and xenserver in 8 (this is a bug IMO) so update the XCP match - Downcase platform IDs. It seems like everyone makes these lowercase, but XCP-ng. There may be others and ohai platforms need to be lowercase Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/plugins')
-rw-r--r--spec/unit/plugins/linux/platform_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/platform_spec.rb b/spec/unit/plugins/linux/platform_spec.rb
index 64976b8e..dd447272 100644
--- a/spec/unit/plugins/linux/platform_spec.rb
+++ b/spec/unit/plugins/linux/platform_spec.rb
@@ -127,6 +127,11 @@ describe Ohai::System, "Linux plugin platform" do
expect(plugin.platform_id_remap("cumulus-linux")).to eq("cumulus")
end
+ # See https://github.com/chef/os_release/blob/master/xcp-ng_7_4#L3 for an example of why we do this
+ it "returns a downcased ID value" do
+ expect(plugin.platform_id_remap("XCP-ng")).to eq("xcp-ng")
+ end
+
it "does not transformation for any other platform" do
expect(plugin.platform_id_remap("ubuntu")).to eq("ubuntu")
end