Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlydba committed Oct 6, 2024
1 parent 4c39190 commit dad8061
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/integration/targets/win_restore/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@
that:
- result.data.SqlInstance != None
- result.data.Database == restore_database

- name: Test error when restoring to an existing database
lowlydba.sqlserver.restore:
sql_instance: "{{ sqlserver_instance }}"
sql_username: "{{ sqlserver_username }}"
sql_password: "{{ sqlserver_password }}"
database: "{{ restore_database }}"
path: "{{ backup_result.data.BackupPath }}"
replace_db_name_in_file: true
block_size: "16kb"
destination_file_suffix: "_new"
destination_file_prefix: "db_"
register: error_result
failed_when: error_result.failed
ignore_errors: true
- assert:
that:
- error_result.failed == true
- "'already exists' in error_result.msg"
- error_result.msg is not None

0 comments on commit dad8061

Please sign in to comment.