Merge pt-ms-pt-stalk-standard-mysql-options.

This commit is contained in:
Daniel Nichter
2013-03-09 11:57:41 -07:00
10 changed files with 347 additions and 48 deletions

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
plan 3
TMPFILE="$TEST_PT_TMPDIR/parse-opts-output"
TOOL="pt-mysql-summary"
PT_TMPDIR="$TEST_PT_TMPDIR"
source "$LIB_DIR/log_warn_die.sh"
source "$LIB_DIR/parse_options.sh"
source "$LIB_DIR/mysql_options.sh"
cnf="/tmp/12345/my.sandbox.cnf"
parse_options "$PERCONA_TOOLKIT_BRANCH/bin/pt-mysql-summary" --defaults-file $cnf
is "$OPT_DEFAULTS_FILE" "$cnf" "--defaults-file works"
# ############################################################################
# Short forms work
# ############################################################################
parse_options "$PERCONA_TOOLKIT_BRANCH/bin/pt-mysql-summary" -F $cnf
is "$OPT_DEFAULTS_FILE" "$cnf" "-F works"
parse_options "$PERCONA_TOOLKIT_BRANCH/bin/pt-mysql-summary" -u msandbox
is "$OPT_USER" "msandbox" "-u works"
# ############################################################################
# Done
# ############################################################################

1
t/lib/bash/mysql_options.t Symbolic link
View File

@@ -0,0 +1 @@
../../../util/test-bash-functions

View File

@@ -144,7 +144,7 @@ like(
cleanup();
$retval = system("$trunk/bin/pt-stalk --daemonize --pid $pid_file --log $log_file --dest $dest --verbose 3 -- --defaults-file=$cnf");
$retval = system("$trunk/bin/pt-stalk --daemonize --pid $pid_file --log $log_file --variable Threads_running --dest $dest --verbose 3 -- --defaults-file=$cnf");
PerconaTest::wait_for_files($pid_file, $log_file);
PerconaTest::wait_for_sh("grep -q 'Check results' $log_file >/dev/null");
@@ -155,7 +155,7 @@ like(
$output,
qr/Check results: Threads_running=\d+, matched=no, cycles_true=0/,
"Matching results logged with --verbose 3"
) or diag(`cat $log_file 2>/dev/null`, `cat $dest/*-output 2>/dev/null`);
) or diag(`cat $dest/*-output 2>/dev/null`);
# #############################################################################
# --verbose 1 (just errors and warnings)