1
test_name "#6928: Puppet --parseonly should return deprication message"
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:')
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}" )
12
step "Agents: create valid, invalid formatted manifests"
14
create_remote_file(host, '/tmp/good.pp', %w{notify{good:}} )
15
create_remote_file(host, '/tmp/bad.pp', 'notify{bad:')
18
step "Agents: use --parseonly on an invalid manifest, should return 1 and issue deprecation warning"
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}" )
25
step "Test Face for ‘parser validate’ with good manifest -- should pass"
27
on(host, "puppet parser validate /tmp/good.pp", :acceptable_exit_codes => [ 0 ])
30
step "Test Faces for ‘parser validate’ with bad manifest -- should fail"
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}" )