2
In order to utilize the plethora of useful command line utilities
4
I want to execute commands from within chef
6
Scenario: Execute a command
8
And it includes the recipe 'execute_commands'
9
When I run the chef-client
10
Then the run should exit '0'
11
And a file named 'mastodon_rocks' should exist
13
Scenario: Execute a command with umask value 777
14
Given a validated node
15
And it includes the recipe 'execute_commands::umask'
16
When I run the chef-client
17
Then the run should exit '0'
18
And '/mastodon_rocks_umask' should exist and raise error when copying
20
Scenario: Execute a command with client logging to file
21
Given a validated node
22
And it includes the recipe 'execute_commands'
23
When I run the chef-client with logging to the file 'silly-monkey.log'
24
Then the run should exit '0'
25
And a file named 'mastodon_rocks' should exist
27
Scenario: Execute a command with more than 4k of output
28
Given a validated node
29
And it includes the recipe 'execute_commands::4k'
30
When I run the chef-client
31
Then the run should exit '0'
32
And a file named 'execute-4k.txt' should exist
34
Scenario: Execute a command at the debug log level
35
Given a validated node
36
And it includes the recipe 'execute_commands::debug'
37
When I run the chef-client at log level 'debug'
38
Then the run should exit '0'
39
And 'stdout' should have 'DEBUG: Executing ruby -e .puts "whats up"; STDERR.puts "doc!".'
40
And 'stdout' should have 'DEBUG: ---- Begin output of ruby -e .puts "whats up"; STDERR.puts "doc!". ----'
41
And 'stdout' should have 'DEBUG: STDOUT: whats up'
42
And 'stdout' should have 'DEBUG: STDERR: doc!'
43
And 'stdout' should have 'DEBUG: ---- End output of ruby -e .puts "whats up"; STDERR.puts "doc!". ----'
44
And 'stdout' should have 'DEBUG: Ran ruby -e .puts "whats up"; STDERR.puts "doc!". returned 0'