| 1 |
################################################################################ |
| 2 |
# Test case to test telemetry tracing service functionality using test component. |
| 3 |
# |
| 4 |
# This test script: |
| 5 |
# - Installs the query_attributes and test_server_telemetry components. |
| 6 |
# The test_server_telemetry component implements custom telemetry tracing callback |
| 7 |
# with following tracing strategy: |
| 8 |
# - only trace statements with trace:on query attribute |
| 9 |
# - do not trace requests from user 'internal' |
| 10 |
# - force tracing requests from user 'app' |
| 11 |
# - Executes mysql_test_client statements and verifies that correct tracing action happened |
| 12 |
# - Statements ending with errors should also reach the telemetry engine (logs) no |
| 13 |
# matter if they will be traced or not |
| 14 |
# - To synchronize output of different sessons, it's using sleep instead of wait |
| 15 |
# because wait loop SQL would be traced in non-deterministic way |
| 16 |
################################################################################ |
| 17 |
|
| 18 |
--source include/have_server_telemetry_traces.inc |
| 19 |
--source include/not_parallel.inc |
| 20 |
--source include/no_ps_protocol.inc |
| 21 |
--source include/not_windows.inc |
| 22 |
# ASAN failures in legacy code reported in yet unsolved Bug#34713142 |
| 23 |
--source include/not_asan.inc |
| 24 |
|
| 25 |
--echo ######### |
| 26 |
--echo # SETUP # |
| 27 |
--echo ######### |
| 28 |
|
| 29 |
# Install required components. |
| 30 |
INSTALL COMPONENT 'file://component_query_attributes'; |
| 31 |
INSTALL COMPONENT 'file://component_test_server_telemetry_traces'; |
| 32 |
|
| 33 |
--echo ############## |
| 34 |
--echo # Operations # |
| 35 |
--echo ############## |
| 36 |
|
| 37 |
--echo # send different COM_... commands, expect them being processed by telemetry |
| 38 |
--exec $MYSQL_CLIENT_TEST test_server_telemetry_traces > /dev/null 2>&1 |
| 39 |
--sleep 0.5 |
| 40 |
|
| 41 |
--echo ########### |
| 42 |
--echo # CLEANUP # |
| 43 |
--echo ########### |
| 44 |
|
| 45 |
UNINSTALL COMPONENT 'file://component_test_server_telemetry_traces'; |
| 46 |
UNINSTALL COMPONENT 'file://component_query_attributes'; |
| 47 |
|
| 48 |
let $MYSQLD_DATADIR= `select @@datadir`; |
| 49 |
--echo Component logs: |
| 50 |
cat_file $MYSQLD_DATADIR/test_server_telemetry_traces_component.log; |
| 51 |
remove_file $MYSQLD_DATADIR/test_server_telemetry_traces_component.log; |