mirror of
https://github.com/ansible-collections/community.mysql.git
synced 2025-08-25 07:21:45 -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:
|
||||
# PyMySQL driver throws a warning, so the following is correct
|
||||
- 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
|
||||
- assert:
|
||||
|
@ -352,7 +352,7 @@
|
|||
# if the state was changed or not.
|
||||
# We assume that it was for DDL queryes by default in the code
|
||||
- result is changed
|
||||
when: connector.name.0 is search('mysqlclient')
|
||||
when: connector_name is search('mysqlclient')
|
||||
|
||||
- name: Drop db {{ test_db }}
|
||||
mysql_query:
|
||||
|
|
|
@ -9,8 +9,6 @@
|
|||
block:
|
||||
|
||||
# ============================================================
|
||||
- shell: pip show pymysql | awk '/Version/ {print $2}'
|
||||
register: pymysql_version
|
||||
|
||||
- name: get server certificate
|
||||
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
|
||||
# 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
|
||||
when:
|
||||
- >
|
||||
|
|
|
@ -51,12 +51,12 @@
|
|||
- assert:
|
||||
that:
|
||||
- result is failed
|
||||
when: connector.name.0 is search('pymysql')
|
||||
when: connector_name is search('pymysql')
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- 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
|
||||
mysql_variables:
|
||||
|
|
|
@ -160,10 +160,10 @@
|
|||
ignore_errors: true
|
||||
|
||||
- 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'
|
||||
when: connector.name.0 is search('pymysql')
|
||||
when: connector_name is search('pymysql')
|
||||
|
||||
# ============================================================
|
||||
# Verify mysql_variable fails when setting an incorrect value (incorrect type)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue