From 4f85e37520fb4e86ef346c30522195873239a4f9 Mon Sep 17 00:00:00 2001 From: Laurent Indermuehle Date: Mon, 20 Jun 2022 16:59:31 +0200 Subject: [PATCH] Add test for distinct dump with and without compression --- .../tasks/issue_256_mysqldump_errors.yml | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/tests/integration/targets/test_mysql_db/tasks/issue_256_mysqldump_errors.yml b/tests/integration/targets/test_mysql_db/tasks/issue_256_mysqldump_errors.yml index 8a0936f..66b4c61 100644 --- a/tests/integration/targets/test_mysql_db/tasks/issue_256_mysqldump_errors.yml +++ b/tests/integration/targets/test_mysql_db/tasks/issue_256_mysqldump_errors.yml @@ -41,11 +41,25 @@ target: /tmp/full-dump.sql.gz register: full_dump_gz - - name: Check dumps errors | Check full dumps are changed + - name: Check dumps errors | Distinct dump without compression + community.mysql.mysql_db: + state: dump + name: db2 + target: /tmp/dump-db2.sql + register: dump_db2 + + - name: Check dumps errors | Distinct dump with gunzip + community.mysql.mysql_db: + state: dump + name: db2 + target: /tmp/dump-db2.sql.gz + register: dump_db2_gz + + - name: Check dumps errors | Check distinct dumps are changed ansible.builtin.assert: that: - - full_dump is changed - - full_dump_gz is changed + - dump_db2 is changed + - dump_db2_gz is changed # Now db2.v1 targets an inexistant table so mysqldump will fail - name: Check dumps errors | Drop t1 @@ -74,3 +88,25 @@ that: - full_dump_without_t1 is failed - full_dump_without_t1_gz is failed + + - name: Check dumps errors | Distinct dump after drop t1 without compression + community.mysql.mysql_db: + state: dump + name: db2 + target: /tmp/dump-db2-without_t1.sql + register: dump_db2_without_t1 + ignore_errors: true + + - name: Check dumps errors | Distinct dump after drop t1 with gzip + community.mysql.mysql_db: + state: dump + name: db2 + target: /tmp/dump-db2-without_t1.sql.gz + register: dump_db2_without_t1_gz + ignore_errors: true + + - name: Check dumps errors | Check full dump + ansible.builtin.assert: + that: + - dump_db2_without_t1 is failed + - dump_db2_without_t1_gz is failed