File: accept_array_commands.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 (23 lines) | stat: -rw-r--r-- 565 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
22
23
test_name "Be able to execute array commands" do
  tag 'audit:high',
      'audit:acceptance'

  agents.each do |agent|
    if agent.platform =~ /windows/
      cmd = ['C:\Windows\System32\cmd.exe', '/c', 'echo', '*']
    else
      cmd = ['/bin/echo', '*']
    end

    exec_manifest = <<~MANIFEST
      exec { "test exec":
        command => #{cmd},
        logoutput => true,
      }
    MANIFEST

    apply_manifest_on(agent, exec_manifest) do |output|
      assert_match('Notice: /Stage[main]/Main/Exec[test exec]/returns: *', output.stdout)
    end
  end
end