summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/resource/user/should_not_destoy_unexisting.rb
blob: 133d51395d80288106c8e766657a9d5a3ee2999d (plain)
1
2
3
4
5
6
7
8
9
10
11
test_name "ensure that puppet does not report removing a user that does not exist"

name = "pl#{rand(999999).to_i}"

step "verify that user #{name} does not exist"
on agents, "getent passwd #{name}", :acceptable_exit_codes => [2]

step "ensure absent doesn't try and do anything"
on(agents, puppet_resource('user', name, 'ensure=absent')) do
    fail_test "tried to remove the user, apparently" if stdout.include? 'removed'
end