File: keyring_migration_password.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (43 lines) | stat: -rw-r--r-- 1,345 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43

# Checking if perl Expect module is installed on the system.
# If not, the test will be skipped.
--source include/have_expect.inc
--source include/not_windows.inc

--echo #
--echo # Bug#33619511: MySQL server exits in debug build when -p parameter used
--echo #

# No $ sign before the name to make it visible in Perl code below
--let MYSQLD_ARGS = --datadir=$MYSQLD_DATADIR --secure-file-priv="" -p
--let MYSQLD_LOG = $MYSQL_TMP_DIR/bug33619511_log.txt

# Start a custom mysqld instance and interactively fill up the dummy password.
# Server should exit with "[Server] Aborting"
--perl

use strict;
require Expect;

# 1. Start the server
# The server should enter password prompt, we'll type a password 'a'.
# Use "log_stdout(0)" to avoid leaking output to record file because it contains timestamps and custom paths.
my $texp = new Expect();
$texp->raw_pty(1);
$texp->log_stdout(0);
$texp->log_file("$ENV{MYSQLD_LOG}", "w");
$texp->spawn("$ENV{MYSQLD} $ENV{MYSQLD_ARGS}");
$texp->expect(15,' -re ',[ 'Enter password:' => sub {
    $texp->send("a\n");}]) or die "Error sending the password";

$texp->soft_close();

EOF

--echo # Expect log that proves the server clean exit
--let SEARCH_FILE = $MYSQLD_LOG
--let SEARCH_PATTERN=\[ERROR\] \[MY-[0-9]+] \[Server\] Aborting
--source include/search_pattern.inc

# Cleanup
--remove_file $MYSQLD_LOG