summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/ticket_6418_file_recursion_and_audit.rb
blob: b21e57ddbce08316c6433754294f7c8a32ec5c09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# 2011-02-23
#
# AffectedVersion: 2.6.0-2.6.5
# FixedVersion:

test_name "#6418: file recursion and audit"

manifest = %q{
    file { "/tmp/6418": ensure => directory }
    file { "/tmp/6418/dir": ensure => directory}
    file { "/tmp/6418/dir/dir": ensure => directory}
    file { "/tmp/6418/dir/dir/dir": ensure => directory}
    file { "/tmp/6418-copy": ensure => present, source => "/tmp/6418/" }

    File["/tmp/6418"] -> File["/tmp/6418/dir"] -> File["/tmp/6418/dir/dir"] -> File["/tmp/6418/dir/dir/dir"] -> File["/tmp/6418-copy"]
}

step "Query agent for statefile"
agent=agents.first
on agent, puppet_agent('--configprint statefile')
statefile=stdout.chomp

step "Remove the statefile on all Agents"
on agents, "rm -f #{statefile}"

step "Apply the manifest"
apply_manifest_on agents, manifest


step "Verify corecct file recursion and audit state"
agents.each do |agent|
  on(agent, "grep ensure.*directory #{statefile}", :acceptable_exit_codes => [ 1 ])
end