File: should_set_path.rb

package info (click to toggle)
puppet-agent 8.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,404 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (21 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
test_name "the path statement should work to locate commands"
tag 'audit:high',
    'audit:refactor',   # Use block style `test_name`
    'audit:acceptance'

agents.each do |agent|
  file = agent.tmpfile('touched-should-set-path')

  step "clean up the system for the test"
  on agent, "rm -f #{file}"

  step "invoke the exec resource with a path set"
  on(agent, puppet_resource('exec', 'test',
                   "command='#{agent.touch(file, false)}'", "path='#{agent.path}'"))

  step "verify that the files were created"
  on agent, "test -f #{file}"

  step "clean up the system after testing"
  on agent, "rm -f #{file}"
end