Skip to content

Commit 9a77eb7

Browse files
committed
Test user creation on a replicaset
1 parent 048acb0 commit 9a77eb7

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/acceptance/replset_spec.rb

+14
Original file line numberDiff line numberDiff line change
@@ -347,5 +347,19 @@ class { 'mongodb::globals':
347347
expect(r.stdout).to match %r{created_by_puppet}
348348
end
349349
end
350+
351+
it 'create a user' do
352+
pp = <<-EOS
353+
mongodb_user {'testuser':
354+
ensure => present,
355+
password_hash => mongodb_password('testuser', 'passw0rd'),
356+
database => 'testdb',
357+
roles => ['readWrite', 'dbAdmin'],
358+
}
359+
EOS
360+
361+
apply_manifest_on(hosts, pp, catch_failures: true)
362+
apply_manifest_on(hosts, pp, catch_changes: true)
363+
end
350364
end
351365
end

0 commit comments

Comments
 (0)