summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/resource/group/should_destroy.rb
blob: 1551abe7575359107d8fafce978ad792f78108f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
test_name "should destroy a group"

name = "test-group-#{Time.new.to_i}"

step "ensure the group exists on the target system"
on agents, "getent group #{name} || groupadd #{name}"

step "use puppet to remove the group"
on(agents, puppet_resource('group', name, 'ensure=absent'))

step "verify that the group has been removed"
# REVISIT: I /think/ that exit code 2 is standard across Linux, but I have no
# idea what non-Linux platforms are going to return. --daniel 2010-12-24
on agents, "getent group #{name}", :acceptable_exit_codes => [2]