Last active
August 29, 2015 14:24
-
-
Save Sauraus/5360e2871603b5e7b168 to your computer and use it in GitHub Desktop.
directory content serverspec test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/yum.repos.d/base.repo | |
/etc/yum.repos.d/updates.repo | |
/etc/yum.repos.d/extras.repo | |
veryfing centos yum channel repositories | |
File "/etc/yum.repos.d/base.repo" | |
should exist | |
should be owned by "root" | |
should be grouped into "root" | |
File "/etc/yum.repos.d/updates.repo" | |
should exist | |
should be owned by "root" | |
should be grouped into "root" | |
File "/etc/yum.repos.d/extras.repo" | |
should exist | |
should be owned by "root" | |
should be grouped into "root" | |
File "/etc/yum.repos.d/" | |
should contain "base.repo", "updates.repo", and "extras.repo" (FAILED - 1) | |
Failures: | |
1) yum-centos::default veryfing centos yum channel repositories File "/etc/yum.repos.d/" should contain "base.repo", "updates.repo", and "extras.repo" | |
Failure/Error: it { should contain repos } | |
expected File "/etc/yum.repos.d/" to contain "base.repo", "updates.repo", and "extras.repo" | |
# /tmp/verifier/suites/serverspec/default_spec.rb:38:in `block (4 levels) in <top (required)>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts ::Dir['/etc/yum.repos.d/*'] | |
repos = %w(base updates extras) | |
repos.each do |repo| | |
describe file("/etc/yum.repos.d/#{repo}.repo") do | |
it { should exist } | |
it { should be_owned_by 'root' } | |
it { should be_grouped_into 'root' } | |
end | |
end | |
repos.map! {|repo| "#{repo}.repo"} | |
describe file("/etc/yum.repos.d/") do | |
it { should contain repos } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment