~ubuntu-branches/ubuntu/karmic/chef/karmic

« back to all changes in this revision

Viewing changes to features/provider/execute/run_commands.feature

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Timberman
  • Date: 2009-08-12 12:18:48 UTC
  • Revision ID: james.westby@ubuntu.com-20090812121848-yl38hpd7nfsl51xz
Tags: upstream-0.7.8
ImportĀ upstreamĀ versionĀ 0.7.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Feature: Run Commands 
 
2
  In order to utilize the plethora of useful command line utilities 
 
3
  As a Developer
 
4
  I want to execute commands from within chef 
 
5
 
 
6
  Scenario: Execute a command
 
7
    Given a validated node
 
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
 
12
      
 
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
 
19
 
 
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
 
26
 
 
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
 
33
 
 
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'