mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-14 07:06:28 +00:00
Add diag() for Bash tests. Diag 'ollect_mysql_info.t find_my_cnf_file gets the correct file' when it fails.
This commit is contained in:
@@ -85,6 +85,7 @@ is \
|
||||
"$cnf_file" \
|
||||
"/tmp/12345/my.sandbox.cnf" \
|
||||
"find_my_cnf_file gets the correct file"
|
||||
[ $? -ne 0 ] && diag "$p/mysqld-instances"
|
||||
|
||||
res=$(find_my_cnf_file "$samples/ps-mysqld-001.txt")
|
||||
is "$res" "/tmp/12345/my.sandbox.cnf" "ps-mysqld-001.txt"
|
||||
|
@@ -211,6 +211,17 @@ wait_for_files() {
|
||||
done
|
||||
}
|
||||
|
||||
diag() {
|
||||
if [ $# -eq 1 -a -f "$1" ]; then
|
||||
echo "# $1:"
|
||||
awk '{print "# " $0}' "$1"
|
||||
else
|
||||
for line in "$@"; do
|
||||
echo "# $line"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
# ############################################################################
|
||||
# Script starts here
|
||||
# ############################################################################
|
||||
|
Reference in New Issue
Block a user