diff options
Diffstat (limited to 'test/integration/targets/mysql_user')
5 files changed, 14 insertions, 22 deletions
diff --git a/test/integration/targets/mysql_user/defaults/main.yml b/test/integration/targets/mysql_user/defaults/main.yml index ff7503f8f0..1775a99cf6 100644 --- a/test/integration/targets/mysql_user/defaults/main.yml +++ b/test/integration/targets/mysql_user/defaults/main.yml @@ -7,10 +7,9 @@ user_name_2: 'db_user2' user_password_1: '12345' user_password_2: '98765' -db_names: +db_names: - clientdb - employeedb - providerdb tmp_dir: '/tmp' - diff --git a/test/integration/targets/mysql_user/tasks/assert_no_user.yml b/test/integration/targets/mysql_user/tasks/assert_no_user.yml index 4d4a411fe2..0031a6887b 100644 --- a/test/integration/targets/mysql_user/tasks/assert_no_user.yml +++ b/test/integration/targets/mysql_user/tasks/assert_no_user.yml @@ -1,4 +1,4 @@ -# test code to assert no mysql user +# test code to assert no mysql user # (c) 2014, Wayne Rosario <wrosario@ansible.com> # This file is part of Ansible @@ -17,9 +17,9 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # ============================================================ -- name: run command to query for mysql user +- name: run command to query for mysql user command: mysql "-e SELECT User FROM mysql.user where user='{{ user_name }}';" register: result -- name: assert mysql user is not present +- name: assert mysql user is not present assert: { that: "'{{ user_name }}' not in result.stdout" } diff --git a/test/integration/targets/mysql_user/tasks/assert_user.yml b/test/integration/targets/mysql_user/tasks/assert_user.yml index 7b35a1f350..9ac7cbff13 100644 --- a/test/integration/targets/mysql_user/tasks/assert_user.yml +++ b/test/integration/targets/mysql_user/tasks/assert_user.yml @@ -1,4 +1,4 @@ -# test code to assert mysql user +# test code to assert mysql user # (c) 2014, Wayne Rosario <wrosario@ansible.com> # This file is part of Ansible @@ -17,11 +17,11 @@ # along with Ansible. If not, see <http://www.gnu.org/licenses/>. # ============================================================ -- name: run command to query for mysql user +- name: run command to query for mysql user command: mysql "-e SELECT User FROM mysql.user where user='{{ user_name }}';" register: result -- name: assert mysql user is present +- name: assert mysql user is present assert: { that: "'{{ user_name }}' in result.stdout" } - name: run command to show privileges for user (expect privileges in stdout) @@ -29,6 +29,6 @@ register: result when: priv is defined -- name: assert user has giving privileges +- name: assert user has giving privileges assert: { that: "'GRANT {{priv}} ON *.*' in result.stdout" } when: priv is defined diff --git a/test/integration/targets/mysql_user/tasks/create_user.yml b/test/integration/targets/mysql_user/tasks/create_user.yml index e7b0d7a33b..9c4daf3e53 100644 --- a/test/integration/targets/mysql_user/tasks/create_user.yml +++ b/test/integration/targets/mysql_user/tasks/create_user.yml @@ -1,4 +1,4 @@ -# test code to create mysql user +# test code to create mysql user # (c) 2014, Wayne Rosario <wrosario@ansible.com> # This file is part of Ansible diff --git a/test/integration/targets/mysql_user/tasks/main.yml b/test/integration/targets/mysql_user/tasks/main.yml index db6a74dc5c..7c6d8ed418 100644 --- a/test/integration/targets/mysql_user/tasks/main.yml +++ b/test/integration/targets/mysql_user/tasks/main.yml @@ -93,14 +93,14 @@ # Assert user has access to multiple databases # - name: give users access to multiple databases - mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:ALL append_privs=yes password={{ user_password_1 }} + mysql_user: name={{ item[0] }} priv={{ item[1] }}.*:ALL append_privs=yes password={{ user_password_1 }} with_nested: - - [ '{{ user_name_1 }}' , '{{ user_name_2 }}'] + - [ '{{ user_name_1 }}', '{{ user_name_2 }}'] - "{{db_names}}" - name: show grants access for user1 on multiple database command: mysql "-e SHOW GRANTS FOR '{{ user_name_1 }}'@'localhost';" - register: result + register: result - name: assert grant access for user1 on multiple database assert: { that: "'{{ item }}' in result.stdout" } @@ -108,7 +108,7 @@ - name: show grants access for user2 on multiple database command: mysql "-e SHOW GRANTS FOR '{{ user_name_2 }}'@'localhost';" - register: result + register: result - name: assert grant access for user2 on multiple database assert: { that: "'{{ item }}' in result.stdout" } @@ -150,7 +150,7 @@ # Update user password for a user. # Assert the user password is updated and old password can no longer be used. # -- include: user_password_update_test.yml +- include: user_password_update_test.yml # ============================================================ # Assert create user with SELECT privileges, attempt to create database and update privileges to create database @@ -171,10 +171,3 @@ # Assert creating user with SELECT privileges, attempt to create database and append privileges to create database # - include: test_privs.yml current_privilege='INSERT,DELETE' current_append_privs=yes - - - - - - - |