summaryrefslogtreecommitdiff
path: root/spec/unit/facter
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-09-01 08:31:31 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-09-01 08:31:31 +0100
commit9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007 (patch)
tree552a7c02b4615a7e2f772e70628628330e7ccda4 /spec/unit/facter
parentb10978703a5e4f07f240c509a3cf881210fbd5c5 (diff)
parent6c2a003f2139a482f92f245ce1d49830be13c5f1 (diff)
downloadpuppet-stdlib-9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007.tar.gz
puppet-stdlib-9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007.tar.bz2
Merge pull request #515 from jfautley/ticket/MODULES-2478-support_root_home_fact_on_AIX
(MODULES-2478) Make root_home fact work on AIX using native lsuser command
Diffstat (limited to 'spec/unit/facter')
-rwxr-xr-xspec/unit/facter/root_home_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/facter/root_home_spec.rb b/spec/unit/facter/root_home_spec.rb
index 98fe141..ac5160a 100755
--- a/spec/unit/facter/root_home_spec.rb
+++ b/spec/unit/facter/root_home_spec.rb
@@ -49,4 +49,17 @@ describe 'root_home', :type => :fact do
end
end
+ context "aix" do
+ before do
+ Facter.fact(:kernel).stubs(:value).returns("AIX")
+ Facter.fact(:osfamily).stubs(:value).returns("AIX")
+ end
+ let(:expected_root_home) { "/root" }
+ sample_lsuser = File.read(fixtures('lsuser','root'))
+
+ it "should return /root" do
+ Facter::Util::Resolution.stubs(:exec).with("lsuser -C -a home root").returns(sample_lsuser)
+ expect(Facter.fact(:root_home).value).to eq(expected_root_home)
+ end
+ end
end