diff --git a/tests/integration/targets/setup_mysql/handlers/main.yml b/tests/integration/targets/setup_mysql/handlers/main.yml index 090a5e7..8f751ee 100644 --- a/tests/integration/targets/setup_mysql/handlers/main.yml +++ b/tests/integration/targets/setup_mysql/handlers/main.yml @@ -4,3 +4,5 @@ src: installed_file.j2 dest: "{{ dbdeployer_installed_file }}" listen: create zookeeper installed file + tags: + - setup_mysql diff --git a/tests/integration/targets/setup_mysql/tasks/main.yml b/tests/integration/targets/setup_mysql/tasks/main.yml index c6a8348..47a5ee0 100644 --- a/tests/integration/targets/setup_mysql/tasks/main.yml +++ b/tests/integration/targets/setup_mysql/tasks/main.yml @@ -5,7 +5,17 @@ #################################################################### - import_tasks: setvars.yml + tags: + - setup_mysql - import_tasks: dir.yml + tags: + - setup_mysql - import_tasks: install.yml + tags: + - setup_mysql - import_tasks: config.yml + tags: + - setup_mysql - import_tasks: verify.yml + tags: + - setup_mysql diff --git a/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml b/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml index 229037c..39f3239 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/handlers/main.yml @@ -1,5 +1,9 @@ - name: delete temporary directory include_tasks: default-cleanup.yml + tags: + - setup_remote_tmp_dir - name: delete temporary directory (windows) include_tasks: windows-cleanup.yml + tags: + - setup_remote_tmp_dir diff --git a/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml b/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml index 93d786f..5d898ab 100644 --- a/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml +++ b/tests/integration/targets/setup_remote_tmp_dir/tasks/main.yml @@ -7,9 +7,13 @@ setup: gather_subset: distribution when: ansible_facts == {} + tags: + - setup_remote_tmp_dir - include_tasks: "{{ lookup('first_found', files)}}" vars: files: - "{{ ansible_os_family | lower }}.yml" - "default.yml" + tags: + - setup_remote_tmp_dir diff --git a/tests/integration/targets/test_mysql_user/tasks/main.yml b/tests/integration/targets/test_mysql_user/tasks/main.yml index db3304c..8a06ec0 100644 --- a/tests/integration/targets/test_mysql_user/tasks/main.yml +++ b/tests/integration/targets/test_mysql_user/tasks/main.yml @@ -281,6 +281,10 @@ - include: test_priv_subtract.yml enable_check_mode=no - include: test_priv_subtract.yml enable_check_mode=yes + - include: test_privs_issue_465.yml + tags: + - issue_465 + # Tests for the TLS requires dictionary - include: tls_requirements.yml diff --git a/tests/integration/targets/test_mysql_user/tasks/test_privs_issue_465.yml b/tests/integration/targets/test_mysql_user/tasks/test_privs_issue_465.yml index 0cfbb4b..b769c6d 100644 --- a/tests/integration/targets/test_mysql_user/tasks/test_privs_issue_465.yml +++ b/tests/integration/targets/test_mysql_user/tasks/test_privs_issue_465.yml @@ -26,28 +26,19 @@ block: # ============================================================ - - name: create admin user with ALL privs, without GRANT OPTIONS - mysql_user: - <<: *mysql_params - name: '{{ user_name_1 }}' - password: '{{ user_password_1 }}' - priv: '*.{{ db_name }}:ALL' - state: present - - - include: assert_user.yml user_name={{user_name_2}} priv='ALL' - - - name: create consumer user with all privileges using admin user + - name: create a user with parameters that will always cause an exception mysql_user: <<: *mysql_params name: '{{ user_name_2 }}' password: '{{ user_password_2 }}' - login_user: '{{ user_name_1 }}' - login_password: '{{ user_password_1 }}' - priv: '*.{{ db_name }}:ALL' + priv: '*.{{ db_name }}:SELECT' state: present + ignore_errors: yes register: result - name: assert output message for current privileges assert: that: - - result is changed + - result is failed + - result.msg.find('exception') != -1 + fail_msg: "Error granting privileges, invalid priv string: SELECT , query: GRANT SELECT ON *.`data` TO %s@%s , exception: (1064, \"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`data` TO 'db_user2'@'localhost'' at line 1\")."