mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-27 16:31:47 -07:00
Refactor to use connectors' info declared in setup_mysql
This commit is contained in:
parent
aa7818f922
commit
ef6a6c7573
5 changed files with 6 additions and 12 deletions
|
@ -343,7 +343,7 @@
|
||||||
that:
|
that:
|
||||||
# PyMySQL driver throws a warning, so the following is correct
|
# PyMySQL driver throws a warning, so the following is correct
|
||||||
- result is not changed
|
- result is not changed
|
||||||
when: connector.name.0 is search('pymysql')
|
when: connector_name is search('pymysql')
|
||||||
|
|
||||||
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
# Issue https://github.com/ansible-collections/community.mysql/issues/268
|
||||||
- assert:
|
- assert:
|
||||||
|
@ -352,7 +352,7 @@
|
||||||
# if the state was changed or not.
|
# if the state was changed or not.
|
||||||
# We assume that it was for DDL queryes by default in the code
|
# We assume that it was for DDL queryes by default in the code
|
||||||
- result is changed
|
- result is changed
|
||||||
when: connector.name.0 is search('mysqlclient')
|
when: connector_name is search('mysqlclient')
|
||||||
|
|
||||||
- name: Drop db {{ test_db }}
|
- name: Drop db {{ test_db }}
|
||||||
mysql_query:
|
mysql_query:
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
block:
|
block:
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
- shell: pip show pymysql | awk '/Version/ {print $2}'
|
|
||||||
register: pymysql_version
|
|
||||||
|
|
||||||
- name: get server certificate
|
- name: get server certificate
|
||||||
copy:
|
copy:
|
||||||
|
|
|
@ -356,10 +356,6 @@
|
||||||
# plugins that are loaded by default are sha2*, but these aren't compatible with pymysql < 0.9, so skip these tests
|
# plugins that are loaded by default are sha2*, but these aren't compatible with pymysql < 0.9, so skip these tests
|
||||||
# for those versions.
|
# for those versions.
|
||||||
#
|
#
|
||||||
- name: Get pymysql version
|
|
||||||
shell: pip show pymysql | awk '/Version/ {print $2}'
|
|
||||||
register: pymysql_version
|
|
||||||
|
|
||||||
- name: Test plugin auth switching which doesn't work on pymysql < 0.9
|
- name: Test plugin auth switching which doesn't work on pymysql < 0.9
|
||||||
when:
|
when:
|
||||||
- >
|
- >
|
||||||
|
|
|
@ -51,12 +51,12 @@
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is failed
|
- result is failed
|
||||||
when: connector.name.0 is search('pymysql')
|
when: connector_name is search('pymysql')
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- result is succeeded
|
- result is succeeded
|
||||||
when: connector.name.0 is not search('pymysql')
|
when: connector_name is not search('pymysql')
|
||||||
|
|
||||||
- name: attempt connection with newly created user ignoring hostname
|
- name: attempt connection with newly created user ignoring hostname
|
||||||
mysql_variables:
|
mysql_variables:
|
||||||
|
|
|
@ -160,10 +160,10 @@
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- include: assert_var.yml changed=true output={{ oor_result }} var_name=max_connect_errors var_value=1
|
- include: assert_var.yml changed=true output={{ oor_result }} var_name=max_connect_errors var_value=1
|
||||||
when: connector.name.0 is not search('pymysql')
|
when: connector_name is not search('pymysql')
|
||||||
|
|
||||||
- include: assert_fail_msg.yml output={{ oor_result }} msg='Truncated incorrect'
|
- include: assert_fail_msg.yml output={{ oor_result }} msg='Truncated incorrect'
|
||||||
when: connector.name.0 is search('pymysql')
|
when: connector_name is search('pymysql')
|
||||||
|
|
||||||
# ============================================================
|
# ============================================================
|
||||||
# Verify mysql_variable fails when setting an incorrect value (incorrect type)
|
# Verify mysql_variable fails when setting an incorrect value (incorrect type)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue