diff options
author | Tim Smith <tsmith84@gmail.com> | 2016-04-22 11:15:39 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2016-04-22 11:26:27 -0700 |
commit | 68f1fea8aa8f4385389d64df1b309d88b8b41cba (patch) | |
tree | 0309d4dfc9b4f19d5bcbe7abac58143e6dd6b9a3 | |
parent | a9173ac663418f10c8a5a46551aa052edea87c11 (diff) | |
download | ohai-68f1fea8aa8f4385389d64df1b309d88b8b41cba.tar.gz |
Add spec for bhyvebhyve
Thanks to twitter I was able to get dmidecode output from a bhyve guest
-rw-r--r-- | spec/unit/plugins/linux/virtualization_spec.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/plugins/linux/virtualization_spec.rb b/spec/unit/plugins/linux/virtualization_spec.rb index cb148acd..e9e6b15f 100644 --- a/spec/unit/plugins/linux/virtualization_spec.rb +++ b/spec/unit/plugins/linux/virtualization_spec.rb @@ -324,6 +324,25 @@ RHEV expect(plugin[:virtualization][:systems][:kvm]).to eq("guest") end + it "sets bhyve guest if dmidecode detects bhyve" do + bhyve_dmidecode = <<-OUTPUT +System Information + Manufacturer: + Product Name: BHYVE + Version: 1.0 + Serial Number: None + UUID: 023B323A-E139-4B36-8BC5-CEBB2469DAAA + Wake-up Type: Power Switch + SKU Number: None + Family: +OUTPUT + allow(plugin).to receive(:shell_out).with("dmidecode").and_return(mock_shell_out(0, bhyve_dmidecode, "")) + plugin.run + expect(plugin[:virtualization][:system]).to eq("bhyve") + expect(plugin[:virtualization][:role]).to eq("guest") + expect(plugin[:virtualization][:systems][:bhyve]).to eq("guest") + end + it "should run dmidecode and not set virtualization if nothing is detected" do allow(plugin).to receive(:shell_out).with("dmidecode").and_return(mock_shell_out(0, "", "")) plugin.run |