Skip to content

Commit

Permalink
Merge pull request #512 from aschmidt75/integrate_selinux_file_label
Browse files Browse the repository at this point in the history
Integrate selinux file label
  • Loading branch information
mizzy committed Mar 24, 2015
2 parents 943d8e7 + f44e472 commit 047e0fa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/serverspec/type/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,5 +113,9 @@ def mtime
def size
@runner.get_file_size(@name).stdout.strip.to_i
end

def selinux_label
@runner.get_file_selinuxlabel(@name).stdout.strip
end
end
end
7 changes: 7 additions & 0 deletions spec/type/linux/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@
describe file('/tmp') do
it { should be_immutable }
end

describe file('/tmp') do
let(:exit_status) { 0 }
let(:stdout) { 'unconfined_u:unconfined_r:unconfined_t:s0' }
its(:selinux_label) { should eq 'unconfined_u:unconfined_r:unconfined_t:s0' }
end

0 comments on commit 047e0fa

Please sign in to comment.