Skip to content

Commit

Permalink
Add a test for installing a plugin (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
hhorak authored Apr 11, 2024
1 parent 05f6915 commit ebabae1
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ run_doc_test
run_s2i_test
run_ssl_test
run_upgrade_test
run_plugin_test
"


Expand Down Expand Up @@ -691,5 +692,30 @@ function run_upgrade_test() {
echo " Upgrade tests succeeded!"
echo
}

run_plugin_test() {
echo " Testing plugin installation"
local test_name="plugin_install"

create_container \
"${test_name}" \
--env MYSQL_ROOT_PASSWORD=rootpass \
--env MYSQL_USER=user \
--env MYSQL_PASSWORD=foo \
--env MYSQL_DATABASE=db

test_connection "${test_name}" root rootpass
ip=$(ct_get_cip "${test_name}")

mysql_cmd "$ip" "root" "rootpass" -e "INSTALL PLUGIN SQL_ERROR_LOG SONAME 'sql_errlog' \G"
ct_check_testcase_result $?

# should fail, deliberately not checking return status
mysql_cmd "$ip" "root" "rootpass" -e "select * from mysql.IdonotExist;"

docker exec $(ct_get_cid "${test_name}") bash -c 'grep IdonotExist /var/lib/mysql/data/sql_errors.log'
ct_check_testcase_result $?
}

ct_init
TEST_SET=${@:-$TEST_LIST} ct_run_tests_from_testset

0 comments on commit ebabae1

Please sign in to comment.