Skip to content

Commit ac82828

Browse files
committed
(MODULES-2478) Test behaviour of root_home fact on AIX
1 parent 98373f1 commit ac82828

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

spec/fixtures/lsuser/root

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#name:home
2+
root:/root

spec/unit/facter/root_home_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,17 @@
4949
end
5050
end
5151

52+
context "aix" do
53+
before do
54+
Facter.fact(:kernel).stubs(:value).returns("AIX")
55+
Facter.fact(:osfamily).stubs(:value).returns("AIX")
56+
end
57+
let(:expected_root_home) { "/root" }
58+
sample_lsuser = File.read(fixtures('lsuser','root'))
59+
60+
it "should return /root" do
61+
Facter::Util::Resolution.stubs(:exec).with("lsuser -C -a home root").returns(sample_lsuser)
62+
expect(Facter.fact(:root_home).value).to eq(expected_root_home)
63+
end
64+
end
5265
end

0 commit comments

Comments
 (0)