summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/resource/group/should_create.rb
blob: efb80a4bc7760fcecce5d72070b3fb3cf180156f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
test_name "should create group"

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

def cleanup(name)
    step "remove group #{name} if it exists"
    on agents, "if getent group #{name}; then groupdel #{name}; fi"
end

cleanup(name)

step "create the group #{name} with the resource agent"
on(agents, puppet_resource('group', name, 'ensure=present'))

step "verify the group #{name} was created"
on(agents, "getent group #{name}") do
    fail_test "group information is not sensible" unless stdout =~ /^#{name}:.*:[0-9]+:/
end

cleanup(name)