Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Percona-QA/percona-qa
Browse files Browse the repository at this point in the history
  • Loading branch information
Roel Van de Paar committed May 21, 2018
2 parents fca336a + c5fc80c commit 53ee2ff
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 43 deletions.
4 changes: 3 additions & 1 deletion known_bugs.strings
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ fsp0fsp.cc line 2023 ## https://bugs.mysql.c
#ZN16QEP_shared_owner4keysEv ## Fixed ## https://bugs.mysql.com/bug.php?id=75938
#Z14fill_variablesP3THDP10TABLE_LISTP4Item ## Fixed ## https://bugs.mysql.com/bug.php?id=75940
Z14ha_show_statusP3THDP10handlerton12ha_stat_type ## https://jira.percona.com/browse/PS-4491 (also see dups below)
ZN7rocksdb16ColumnFamilyData19InstallSuperVersionEPNS_19SuperVersionContextEPNS_17InstrumentedMutexERKNS_16MutableCFOptionsE ## Likely duplicate of PS-4491 above
ZN7rocksdb16ColumnFamilyData19InstallSuperVersionEPNS_19SuperVersionContextEPNS_17InstrumentedMutexERKNS_16MutableCFOptionsE ## Likely duplicate of PS-4491 above alsos logged as PS-4478
manifest_filenames->empty ## Likely duplicate of PS-4491 above
#job_context->logs_to_free.empty ## Likely dup or consequence of PS-4491 above (on shutdown). Check report and add new testcase if other bug
#Z18create_ref_for_keyP4JOINP8JOIN_TABP7Key_usey ## Fixed ## https://bugs.mysql.com/bug.php?id=75944 (Marked dup of 74559) (# after MS 5.7.7 merged)
Expand Down Expand Up @@ -713,6 +713,8 @@ transactional_table .. .changed .. thd->transaction.stmt.modified_non_trans_tabl
unknown error code 47 ## https://bugs.mysql.com/bug.php?id=74343, both build
#void Protocol::end_statement ## This assertion is a generic assertion indicative of many causes. It should not be filtered. (Was: https://bugs.mysql.com/bug.php?id=74411, RQG)
next_insert_id >= auto_inc_interval_for_cur_row.minimum ## https://bugs.launchpad.net/percona-server/+bug/1582577
whitelist .= nullptr ## https://jira.percona.com/browse/PS-4474
unp_reader .= nullptr ## https://jira.percona.com/browse/PS-4477

#=========== First frame from error log based ===========
Z18fix_partition_funcP3THDP5TABLEb ## https://bugs.mysql.com/bug.php?id=78238 ([5 Sep 2:14])
Expand Down
24 changes: 17 additions & 7 deletions pmm-tests/pmm-framework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ usage () {
echo " --key-name Pass your aws access key file name"
echo " --ova-image Pass PMM server ova image name"
echo " --ova-memory Pass memory(memorysize in MB) for OVA virtual box"
echo " --upgrade When this option is specified, PMM framework will be updated to specified version"
echo " --upgrade When this option is specified, PMM framework will be updated to specified version"
echo " --query-source Set query source (perfschema or slowlog)"
echo " --compare-query-count This will help us to compare the query count between PMM client instance and PMM QAN/Metrics page"
}

# Check if we have a functional getopt(1)
if ! getopt --test
then
go_out="$(getopt --options=u: --longoptions=addclient:,replcount:,pmm-server:,ami-image:,key-name:,ova-image:,ova-memory:,pmm-server-version:,pmm-port:,pmm-server-memory:,pmm-docker-memory:,pmm-server-username:,pmm-server-password:,setup,with-replica,with-shrading,download,ps-version:,ms-version:,md-version:,pxc-version:,mysqld-startup-options:,mo-version:,mongo-with-rocksdb,add-docker-client,list,wipe-clients,wipe-docker-clients,wipe-server,upgrade,wipe,dev,with-proxysql,sysbench-data-load,sysbench-oltp-run,storage-engine:,compare-query-count,help \
go_out="$(getopt --options=u: --longoptions=addclient:,replcount:,pmm-server:,ami-image:,key-name:,ova-image:,ova-memory:,pmm-server-version:,pmm-port:,pmm-server-memory:,pmm-docker-memory:,pmm-server-username:,pmm-server-password:,query-source:,setup,with-replica,with-shrading,download,ps-version:,ms-version:,md-version:,pxc-version:,mysqld-startup-options:,mo-version:,mongo-with-rocksdb,add-docker-client,list,wipe-clients,wipe-docker-clients,wipe-server,upgrade,wipe,dev,with-proxysql,sysbench-data-load,sysbench-oltp-run,storage-engine:,compare-query-count,help \
--name="$(basename "$0")" -- "$@")"
test $? -eq 0 || exit 1
eval set -- $go_out
Expand Down Expand Up @@ -135,7 +136,7 @@ do
ami_image="$2"
shift 2
;;
--key-name )
--key-name )
key_name="$2"
shift 2
;;
Expand Down Expand Up @@ -167,6 +168,10 @@ do
mysqld_startup_options="$2"
shift 2
;;
--query-source )
query_source="$2"
shift 2
;;
--mo-version )
mo_version="$2"
shift 2
Expand Down Expand Up @@ -320,6 +325,7 @@ elif [[ "$pmm_server" == "custom" ]];then
exit 1
fi
fi

sanity_check(){
if [[ "$pmm_server" == "docker" ]];then
if ! sudo docker ps | grep 'pmm-server' > /dev/null ; then
Expand Down Expand Up @@ -348,14 +354,18 @@ sanity_check(){
fi
}

if [[ -z "${ps_version}" ]]; then ps_version="5.7"; fi
if [[ -z "{$ps_version}" ]]; then ps_version="5.7"; fi
if [[ -z "${pxc_version}" ]]; then pxc_version="5.7"; fi
if [[ -z "${ms_version}" ]]; then ms_version="8.0"; fi
if [[ -z "${md_version}" ]]; then md_version="10.2"; fi
if [[ -z "${mo_version}" ]]; then mo_version="3.4"; fi
if [[ -z "${REPLCOUNT}" ]]; then REPLCOUNT="1"; fi
if [[ -z "${ova_memory}" ]]; then ova_memory="2048";fi

if [[ -z "$query_source" ]];then
query_source=perfschema
fi

setup(){
if [ $IS_BATS_RUN -eq 0 ];then
read -p "Would you like to enable SSL encryption to protect PMM from unauthorized access[y/n] ? " check_param
Expand Down Expand Up @@ -733,7 +743,7 @@ add_clients(){
PORT_CHECK=201
NODE_NAME="MS_NODE"
get_basedir mysql "mysql-${ms_version}*" "MySQL Server binary tar ball" ${ms_version}
MYSQL_CONFIG="--init-file ${SCRIPT_PWD}/QRT_Plugin.sql --innodb_monitor_enable=all --performance_schema=ON --default-authentication-plugin=mysql_native_password"
MYSQL_CONFIG="--init-file ${SCRIPT_PWD}/QRT_Plugin.sql --innodb_monitor_enable=all --performance_schema=ON"
elif [[ "${CLIENT_NAME}" == "md" ]]; then
PORT_CHECK=301
NODE_NAME="MD_NODE"
Expand Down Expand Up @@ -855,7 +865,7 @@ add_clients(){
if ${BASEDIR}/bin/mysqladmin -uroot -S/tmp/${NODE_NAME}_${j}.sock ping > /dev/null 2>&1; then
echo "WARNING! Another mysqld process using /tmp/${NODE_NAME}_${j}.sock"
if ! sudo pmm-admin list | grep "/tmp/${NODE_NAME}_${j}.sock" > /dev/null ; then
sudo pmm-admin add mysql ${NODE_NAME}-${j} --socket=/tmp/${NODE_NAME}_${j}.sock --user=root --query-source=perfschema
sudo pmm-admin add mysql ${NODE_NAME}-${j} --socket=/tmp/${NODE_NAME}_${j}.sock --user=root --query-source=$query_source
fi
continue
fi
Expand Down Expand Up @@ -926,7 +936,7 @@ add_clients(){
exit 1
fi
fi
sudo pmm-admin add mysql ${NODE_NAME}-${j} --socket=/tmp/${NODE_NAME}_${j}.sock --user=root --query-source=perfschema
sudo pmm-admin add mysql ${NODE_NAME}-${j} --socket=/tmp/${NODE_NAME}_${j}.sock --user=root --query-source=$query_source
done
pxc_proxysql_setup(){
if [[ "${CLIENT_NAME}" == "pxc" ]]; then
Expand Down
99 changes: 64 additions & 35 deletions pmm-tests/pmm-slow-log-rotation-tests.bats
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#Checking MySQL Slow log rotation functionality
setup() {

SLOW_LOG=$(sudo pmm-admin list| grep -m1 "slowlog")
}

@test "check that help has slow-log-rotation option [PMM-2432]" {
run sudo pmm-admin add mysql --help
Expand All @@ -15,54 +19,79 @@
}

@test "run pmm-admin add mysql with default values [PMM-2432]" {
skip
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} mysql_default
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} mysql_default
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
fi
}

@test "check pmm-admin list has instance enabled slow log rotation [PMM-2432]" {
skip
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_default.*slow_log_rotation=true.*retain_slow_logs=1/'
echo "$output" |grep mysql_default |grep "retain_slow_logs=1"
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_default.*slow_log_rotation=true.*retain_slow_logs=1/'
run sudo pmm-admin rm mysql mysql_default
fi
}

@test "run pmm-admin add mysql with disabled slow log rotation option [PMM-2432]" {
skip
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} --slow-log-rotation=false mysql_disabled_slow_log
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} --slow-log-rotation=false mysql_disabled_slow_log
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
fi
}

@test "check pmm-admin list has instance with disabled slow log rotation [PMM-2432]" {
skip
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_disabled_slow_log.*slow_log_rotation=false/'
run sudo pmm-admin rm mysql mysql_disabled_slow_log
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_disabled_slow_log.*slow_log_rotation=false/'
run sudo pmm-admin rm mysql mysql_disabled_slow_log
fi
}

@test "run pmm-admin add mysql with retain-slow-logs option [PMM-2432]" {
skip
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} --retain-slow-logs=5 mysql_slow_log_5
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
MYSQL_SOCK=$(sudo pmm-admin list | grep -m1 "mysql:metrics" | sed 's|.*(||;s|)||')
run sudo pmm-admin add mysql --socket=${MYSQL_SOCK} --retain-slow-logs=5 mysql_slow_log_5
echo "$output"
[ "$status" -eq 0 ]
echo "${lines[2]}" | grep "OK, now monitoring"
fi
}

@test "check added instance has slow_log_rotation=true and retain_slow_logs flags [PMM-2432]" {
skip
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_slow_log_5.*slow_log_rotation=true.*retain_slow_logs=5/'
if [[ -z $SLOW_LOG ]]
then
skip "Instance should be added with slowlog query source"
else
run sudo pmm-admin list
echo "$output"
[ "$status" -eq 0 ]
echo "$output" | awk '/mysql_slow_log_5.*slow_log_rotation=true.*retain_slow_logs=5/'
run sudo pmm-admin rm mysql mysq_slow_log_5
fi
}

0 comments on commit 53ee2ff

Please sign in to comment.