Skip to content

Commit

Permalink
Add further test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysmeister committed Oct 4, 2024
1 parent 9c2aee2 commit dafdeb7
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/integration/targets/mongodb_shell/tasks/677.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,41 @@
that:
- mongo_output.failed
- "'MongoParseError: retryWrites must be either' in mongo_output.msg"

- name: Test with a 2 string conn options
community.mongodb.mongodb_shell:
<<: *mongo_parameters
eval: 'db.scriptResults.insertOne({ "name": "dba_init", "status": "ran", "execution": new Date() })'
connection_options:
- "retryWrites=false"
- "replicaSet=issue_677"
register: mongo_output

- name: Test with 2 dict conn options
community.mongodb.mongodb_shell:
<<: *mongo_parameters
eval: 'db.scriptResults.insertOne({ "name": "dba_init", "status": "ran", "execution": new Date() })'
connection_options:
- retryWrites: "false"
- replicaSet: "issue_677"
register: mongo_output

- name: Test with a 3 string conn options
community.mongodb.mongodb_shell:
<<: *mongo_parameters
eval: 'db.scriptResults.insertOne({ "name": "dba_init", "status": "ran", "execution": new Date() })'
connection_options:
- "retryWrites=false"
- "replicaSet=issue_677"
- "connectTimeoutMS=10000"
register: mongo_output

- name: Test with 3 dict conn options
community.mongodb.mongodb_shell:
<<: *mongo_parameters
eval: 'db.scriptResults.insertOne({ "name": "dba_init", "status": "ran", "execution": new Date() })'
connection_options:
- retryWrites: "false"
- replicaSet: "issue_677"
- connectTimeoutMS: 10000
register: mongo_output

0 comments on commit dafdeb7

Please sign in to comment.