~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to acceptance/tests/ticket_6928_puppet_master_parse_fails.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
test_name "#6928: Puppet --parseonly should return deprication message"
 
2
 
 
3
# Create good and bad formatted manifests
 
4
step "Master: create valid, invalid formatted manifests"
 
5
create_remote_file(master, '/tmp/good.pp', %w{notify{good:}} )
 
6
create_remote_file(master, '/tmp/bad.pp', 'notify{bad:')
 
7
 
 
8
step "Master: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning"
 
9
on master, puppet_master( %w{--parseonly /tmp/bad.pp} ), :acceptable_exit_codes => [ 1 ]
 
10
  assert_match(/--parseonly has been removed. Please use \'puppet parser validate <manifest>\'/, stdout, "Deprecation warning not issued for --parseonly on #{master}" )
 
11
 
 
12
step "Agents: create valid, invalid formatted manifests"
 
13
agents.each do |host|
 
14
  create_remote_file(host, '/tmp/good.pp', %w{notify{good:}} )
 
15
  create_remote_file(host, '/tmp/bad.pp', 'notify{bad:')
 
16
end
 
17
 
 
18
step "Agents: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning"
 
19
agents.each do |host|
 
20
  on(host, "puppet --parseonly /tmp/bad.pp}", :acceptable_exit_codes => [ 1 ]) do
 
21
    assert_match(/--parseonly has been removed. Please use \'puppet parser validate <manifest>\'/, stdout, "Deprecation warning not issued for --parseonly on #{host}" )
 
22
  end
 
23
end
 
24
 
 
25
step "Test Face for ‘parser validate’ with good manifest -- should pass"
 
26
agents.each do |host|
 
27
  on(host, "puppet parser validate /tmp/good.pp", :acceptable_exit_codes => [ 0 ])
 
28
end
 
29
 
 
30
step "Test Faces for ‘parser validate’ with bad manifest -- should fail"
 
31
agents.each do |host|
 
32
  on(host, "puppet parser validate /tmp/bad.pp", :acceptable_exit_codes => [ 1 ]) do
 
33
    assert_match(/err: Could not parse for environment production/, stdout, "Bad manifest detection failed on #{host}" )
 
34
  end
 
35
end