blob: 28dd70482adfe7c0a98a0847255c91e6df22152f (
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
34
35
36
37
38
39
40
41
42
43
44
45
|
@provider @provider_execute
Feature: Run Commands
In order to utilize the plethora of useful command line utilities
As a Developer
I want to execute commands from within chef
Scenario: Execute a command
Given a validated node
And it includes the recipe 'execute_commands'
When I run the chef-client
Then the run should exit '0'
And a file named 'mastodon_rocks' should exist
Scenario: Execute a command with umask value 777
Given a validated node
And it includes the recipe 'execute_commands::umask'
When I run the chef-client
Then the run should exit '0'
And '/mastodon_rocks_umask' should exist and raise error when copying
Scenario: Execute a command with client logging to file
Given a validated node
And it includes the recipe 'execute_commands'
When I run the chef-client with logging to the file 'silly-monkey.log'
Then the run should exit '0'
And a file named 'mastodon_rocks' should exist
Scenario: Execute a command with more than 4k of output
Given a validated node
And it includes the recipe 'execute_commands::4k'
When I run the chef-client
Then the run should exit '0'
And a file named 'execute-4k.txt' should exist
Scenario: Execute a command at the debug log level
Given a validated node
And it includes the recipe 'execute_commands::debug'
When I run the chef-client at log level 'debug'
Then the run should exit '0'
And 'stdout' should have 'DEBUG: Executing ruby -e .puts "whats up"; STDERR.puts "doc!".'
And 'stdout' should have 'DEBUG: ---- Begin output of ruby -e .puts "whats up"; STDERR.puts "doc!". ----'
And 'stdout' should have 'DEBUG: STDOUT: whats up'
And 'stdout' should have 'DEBUG: STDERR: doc!'
And 'stdout' should have 'DEBUG: ---- End output of ruby -e .puts "whats up"; STDERR.puts "doc!". ----'
And 'stdout' should have 'DEBUG: Ran ruby -e .puts "whats up"; STDERR.puts "doc!". returned 0'
|