update-samples on pt-ms

This commit is contained in:
Brian Fraser
2013-03-06 14:13:05 -03:00
parent 0efad73f3e
commit 6e964261b7
2 changed files with 21 additions and 6 deletions

View File

@@ -477,15 +477,30 @@ mysql_options() {
MYSQL_ARGS="$MYSQL_ARGS --host=$OPT_HOST" MYSQL_ARGS="$MYSQL_ARGS --host=$OPT_HOST"
fi fi
if [ -n "$OPT_USER" ]; then if [ -n "$OPT_USER" ]; then
MYSQL_ARGS="$MYSQL_ARGS --user='$OPT_USER'" MYSQL_ARGS="$MYSQL_ARGS --user=$OPT_USER"
fi fi
if [ -n "$OPT_PASSWORD" ]; then if [ -n "$OPT_PASSWORD" ]; then
MYSQL_ARGS="$MYSQL_ARGS --password='$OPT_PASSWORD'" MYSQL_ARGS="$MYSQL_ARGS --password=$OPT_PASSWORD"
fi fi
echo $MYSQL_ARGS echo $MYSQL_ARGS
} }
arrange_mysql_options() {
local opts="$1"
local rearranged=""
for opt in $opts; do
if [ "$(echo $opt | awk -F= '{print $1}')" = "--defaults-file" ]; then
rearranged="$opt $rearranged"
else
rearranged="$rearranged $opt"
fi
done
echo "$rearranged"
}
# ########################################################################### # ###########################################################################
# End mysql_options package # End mysql_options package
# ########################################################################### # ###########################################################################
@@ -2229,7 +2244,7 @@ report_mysql_summary () {
|| [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ]; then || [ -e "$dir/mysqldump" -a -s "$dir/mysqldump" ]; then
reply="y" reply="y"
elif [ -t 0 -a -t 1 ]; then elif [ -t 0 -a -t 1 ]; then
printf "Would you like to mysqldump -d the schema and analyze it? y/n " echo -n "Would you like to mysqldump -d the schema and analyze it? y/n "
read reply read reply
reply=${reply:-n} reply=${reply:-n}
fi fi
@@ -2237,7 +2252,7 @@ report_mysql_summary () {
if [ -z "${OPT_DATABASES}" ] && [ -z "$OPT_READ_SAMPLES" ] \ if [ -z "${OPT_DATABASES}" ] && [ -z "$OPT_READ_SAMPLES" ] \
&& [ ! -e "$dir/mysqldump" ]; then && [ ! -e "$dir/mysqldump" ]; then
echo "There are ${num_dbs} databases. Would you like to dump all, or just one?" echo "There are ${num_dbs} databases. Would you like to dump all, or just one?"
printf "Type the name of the database, or press Enter to dump all of them. " echo -n "Type the name of the database, or press Enter to dump all of them. "
local dbtodump="" local dbtodump=""
read dbtodump read dbtodump
local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )" local trg_arg="$( get_mysqldump_args "$dir/mysql-variables" )"

View File

@@ -144,7 +144,7 @@ like(
cleanup(); 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_files($pid_file, $log_file);
PerconaTest::wait_for_sh("grep -q 'Check results' $log_file >/dev/null"); PerconaTest::wait_for_sh("grep -q 'Check results' $log_file >/dev/null");
@@ -155,7 +155,7 @@ like(
$output, $output,
qr/Check results: Threads_running=\d+, matched=no, cycles_true=0/, qr/Check results: Threads_running=\d+, matched=no, cycles_true=0/,
"Matching results logged with --verbose 3" "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) # --verbose 1 (just errors and warnings)