Debian Codegraph @

mysql-test/suite/x/t/connection_unixsocket_lock.test

raw
1 ## UNIX Socket connections
2
3 ## Preamble
4 --source include/not_windows.inc
5 --source ../include/have_performance_schema_threads.inc
6 --source include/xplugin_preamble.inc
7 --source include/xplugin_create_user.inc
8
9 ## Test starts here
10 --write_file $MYSQL_TMP_DIR/check_unixsocket.xpl
11 ## Test data
12 #Ensure that each of following uses UNIX Socket
13 -->quiet
14 -->wait_for 1 SELECT count(*) from performance_schema.threads WHERE PROCESSLIST_COMMAND='Query' AND CONNECTION_TYPE='Socket';
15 EOF
16
17 --write_file $MYSQL_TMP_DIR/check_connection.xpl
18 EOF
19
20 --exec $MYSQLXTEST --socket=$MASTER_X_MYSOCK -ux_root --password='' --file=$MYSQL_TMP_DIR/check_unixsocket.xpl 2>&1
21
22
23 --echo Test lock file issue
24 --write_file $MYSQL_TMP_DIR/mysqlx.custom.lock
25 EOF
26
27 --let UNIX_SOCKET_REGEX= / \/.*\.(custom|socket) / SOCKET /
28
29 call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.custom' failed, lock file is empty");
30 --replace_regex /loose-mysqlx-socket=.*custom/loose-mysqlx-socket=SOCKET/
31 let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.custom;
32 --let $wait_for_unixsocket_status = undefined_value
33 --source include/restart_mysqld.inc
34
35 --replace_regex $UNIX_SOCKET_REGEX
36 exec $MYSQLXTEST
37 --socket=$MYSQL_TMP_DIR/mysqlx.custom
38 -ux_root --password='' --expect-error 2002
39 --file=$MYSQL_TMP_DIR/check_unixsocket.xpl 2>&1;
40
41
42 --mkdir $MYSQL_TMP_DIR/mysqlx.dir.socket.lock
43 call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.dir.socket' failed, can't read lock file");
44 call mtr.add_suppression("Plugin mysqlx reported: .* wasn't allocated by X Plugin ..+/mysqlx.dir.socket.lock");
45 --replace_regex /loose-mysqlx-socket=.*socket/loose-mysqlx-socket=SOCKET/
46 let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.dir.socket;
47 --let $wait_for_unixsocket_status = undefined_value
48 --source include/restart_mysqld.inc
49
50 --replace_regex $UNIX_SOCKET_REGEX
51 exec $MYSQLXTEST
52 --socket=$MYSQL_TMP_DIR/mysqlx.dir.socket
53 -ux_root --password='' --expect-error 2002
54 --file=$MYSQL_TMP_DIR/check_unixsocket.xpl 2>&1;
55
56
57 --remove_file $MYSQL_TMP_DIR/mysqlx.custom.lock
58 --write_file $MYSQL_TMP_DIR/mysqlx.custom.lock
59 Xinvalid_number
60 EOF
61
62 call mtr.add_suppression("Plugin mysqlx reported: .Setup of socket: '..+/mysqlx.custom' failed, invalid PID in UNIX socket lock file ");
63 --replace_regex /loose-mysqlx-socket=.*custom/loose-mysqlx-socket=SOCKET/
64 let $restart_parameters = restart: --loose-mysqlx-socket=$MYSQL_TMP_DIR/mysqlx.custom;
65 --let $wait_for_unixsocket_status = undefined_value
66 --source include/restart_mysqld.inc
67
68 --replace_regex $UNIX_SOCKET_REGEX
69 exec $MYSQLXTEST
70 --socket=$MYSQL_TMP_DIR/mysqlx.custom
71 -ux_root --password='' --expect-error 2002
72 --file=$MYSQL_TMP_DIR/check_unixsocket.xpl 2>&1;
73
74
75 ## Cleanup
76 --let $restart_parameters = restart:
77 --source include/restart_mysqld.inc
78
79 --remove_file $MYSQL_TMP_DIR/mysqlx.custom.lock
80 --rmdir $MYSQL_TMP_DIR/mysqlx.dir.socket.lock
81 --source ../include/xplugin_cleanup.inc
82