summaryrefslogtreecommitdiff
path: root/spec/unit/plugins
diff options
context:
space:
mode:
authorIsa Farnik <isa@chef.co>2015-10-26 13:05:57 +0000
committerIsa Farnik <isa@chef.co>2015-10-26 13:15:59 +0000
commit9af358e9b87b7833fc989234e0e0e7dbf08cfd79 (patch)
tree6bbede407ce305ed5d542b7c53528a9895ea831f /spec/unit/plugins
parent081589066eefa00a60192f8cac8801e3b2b31bfe (diff)
downloadohai-if/aix-bittiness.tar.gz
provide aix kernel bitinessif/aix-bittiness
specs test for bits not for machine
Diffstat (limited to 'spec/unit/plugins')
-rw-r--r--spec/unit/plugins/aix/kernel_spec.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/plugins/aix/kernel_spec.rb b/spec/unit/plugins/aix/kernel_spec.rb
index 2428a25a..85756962 100644
--- a/spec/unit/plugins/aix/kernel_spec.rb
+++ b/spec/unit/plugins/aix/kernel_spec.rb
@@ -26,6 +26,7 @@ describe Ohai::System, "AIX kernel plugin" do
allow(@plugin).to receive(:shell_out).with("uname -v").and_return(mock_shell_out(0, "6", nil))
allow(@plugin).to receive(:shell_out).with("uname -p").and_return(mock_shell_out(0, "powerpc", nil))
allow(@plugin).to receive(:shell_out).with("genkex -d").and_return(mock_shell_out(0, " Text address Size Data address Size File\nf1000000c0338000 77000 f1000000c0390000 1ec8c /usr/lib/drivers/cluster\n 6390000 20000 63a0000 ba8 /usr/lib/drivers/if_en", nil))
+ allow(@plugin).to receive(:shell_out).with("getconf KERNEL_BITMODE").and_return(mock_shell_out(0, "64", nil))
@plugin.run
end
@@ -45,6 +46,10 @@ describe Ohai::System, "AIX kernel plugin" do
expect(@plugin[:kernel][:machine]).to eq("powerpc")
end
+ it "getconf KERNEL_BITMODE detects the kernel's bittiness" do
+ expect(@plugin[:kernel][:bits]).to eq("64")
+ end
+
it "detects the modules" do
expect(@plugin[:kernel][:modules]["/usr/lib/drivers/cluster"]["text"]).to eq({ "address" => "f1000000c0338000", "size" => "77000" })
expect(@plugin[:kernel][:modules]["/usr/lib/drivers/cluster"]["data"]).to eq({ "address" => "f1000000c0390000", "size" => "1ec8c" })