diff --git a/tests/integration/targets/test_mysql_variables/tasks/mysql_variables.yml b/tests/integration/targets/test_mysql_variables/tasks/mysql_variables.yml index 2473327..b2b0cd3 100644 --- a/tests/integration/targets/test_mysql_variables/tasks/mysql_variables.yml +++ b/tests/integration/targets/test_mysql_variables/tasks/mysql_variables.yml @@ -141,7 +141,7 @@ - name: set mysql variable value to an expression mysql_variables: <<: *mysql_params - variable: max_tmp_tables + variable: max_connect_errors value: "1024*4" register: result ignore_errors: true @@ -151,15 +151,22 @@ # ============================================================ # Verify mysql_variable fails when setting an incorrect value (out of range) # + - shell: pip show pymysql | awk '/Version/ {print $2}' + register: pymysql_version + - name: set mysql variable value to a number out of range mysql_variables: <<: *mysql_params - variable: max_tmp_tables + variable: max_connect_errors value: -1 register: result ignore_errors: true + - include: assert_var.yml changed=true output={{ result }} var_name=max_connect_errors var_value=1 + when: pymysql_version.stdout == "" + - include: assert_fail_msg.yml output={{ result }} msg='Truncated incorrect' + when: pymysql_version.stdout != "" # ============================================================ # Verify mysql_variable fails when setting an incorrect value (incorrect type) @@ -167,12 +174,16 @@ - name: set mysql variable value to a non-valid value number mysql_variables: <<: *mysql_params - variable: max_tmp_tables + variable: max_connect_errors value: TEST register: result ignore_errors: true + - include: assert_var.yml changed=true output={{ result }} var_name=max_connect_errors var_value=1 + when: pymysql_version.stdout == "" + - include: assert_fail_msg.yml output={{ result }} msg='Incorrect argument type to variable' + when: pymysql_version.stdout != "" # ============================================================ # Verify mysql_variable fails when setting an unknown variable