~ubuntu-branches/ubuntu/precise/puppet/precise-proposed

« 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): Micah Anderson
  • Date: 2012-02-23 18:24:48 UTC
  • mfrom: (1.1.28) (3.1.36 sid)
  • Revision ID: package-import@ubuntu.com-20120223182448-belun93murza4w99
Tags: 2.7.11-1
* New upstream release
* Urgency set to high due to regressions in previous release
  and security vulnerabilities
* Execs when run with a user specified, but no group, get the root
  group. Similarly unexpected privileges are given to providers and
  types (egid remains as root), this is fixed with a patch from
  upstream (CVE-2012-1053)
* Fix Klogin write through symlink (CVE-2012-1054)

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