summaryrefslogtreecommitdiffstats
path: root/acceptance/tests/resource/user/should_query.rb
diff options
context:
space:
mode:
Diffstat (limited to 'acceptance/tests/resource/user/should_query.rb')
-rwxr-xr-xacceptance/tests/resource/user/should_query.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/acceptance/tests/resource/user/should_query.rb b/acceptance/tests/resource/user/should_query.rb
new file mode 100755
index 000000000..6e2df534d
--- /dev/null
+++ b/acceptance/tests/resource/user/should_query.rb
@@ -0,0 +1,15 @@
+test_name "test that we can query and find a user that exists."
+
+name = "test-user-#{Time.new.to_i}"
+
+step "ensure that our test user exists"
+on(agents, puppet_resource('user', name, 'ensure=present'))
+
+step "query for the resource and verify it was found"
+on(agents, puppet_resource('user', name)) do
+ fail_test "didn't find the user #{name}" unless stdout.include? 'present'
+end
+
+step "clean up the user and group we added"
+on(agents, puppet_resource('user', name, 'ensure=absent'))
+on(agents, puppet_resource('group', name, 'ensure=absent'))