~ubuntu-branches/ubuntu/quantal/puppet/quantal

« back to all changes in this revision

Viewing changes to acceptance/tests/ticket_6928_puppet_master_parse_fails.rb

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-14 01:56:30 UTC
  • mfrom: (1.1.29) (3.1.43 sid)
  • Revision ID: package-import@ubuntu.com-20120714015630-ntj41rkvkq4zph4y
Tags: 2.7.18-1ubuntu1
* Resynchronise with Debian. (LP: #1023931) Remaining changes:
  - debian/puppetmaster-passenger.postinst: Make sure we error if puppet
    config print doesn't work
  - debian/puppetmaster-passenger.postinst: Ensure upgrades from
    <= 2.7.11-1 fixup passenger apache configuration.
* Dropped upstreamed patches:
  - debian/patches/CVE-2012-1906_CVE-2012-1986_to_CVE-2012-1989.patch
  - debian/patches/puppet-12844
  - debian/patches/2.7.17-Puppet-July-2012-CVE-fixes.patch
* Drop Build-Depends on ruby-rspec (in universe):
  - debian/control: remove ruby-rspec from Build-Depends
  - debian/patches/no-rspec.patch: make Rakefile work anyway if rspec
    isn't installed so we can use it in debian/rules.

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