mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-23 21:05:00 +00:00
pt-summary shouldn't leave empty files; both summary tools should
die if passed a --save-samples directory that has files in it.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 39
|
||||
plan 40
|
||||
|
||||
TMPDIR="$TEST_TMPDIR"
|
||||
PATH="$PATH:$PERCONA_TOOLKIT_SANDBOX/bin"
|
||||
@@ -25,6 +25,13 @@ setup_commands
|
||||
|
||||
collect_system_data "$p"
|
||||
|
||||
p2="$TMPDIR/collect_mysql_info2"
|
||||
mkdir "$p2"
|
||||
touch "$p2/some_empty_file"
|
||||
collect_system_data "$p2"
|
||||
|
||||
cmd_ok "test ! -e \"$p2/some_empty_file\"" "collect_system_data removes empty files before exiting"
|
||||
|
||||
cat <<EOF > "$TMPDIR/expected"
|
||||
Fusion-MPT SAS
|
||||
EOF
|
||||
@@ -181,7 +188,7 @@ test_linux_exclusive_collection () {
|
||||
|
||||
is \
|
||||
"$(ls "${dir}/2" | grep 'lvs\|vgs\|netstat' | sort | xargs echo )" \
|
||||
"lvs netstat vgs" \
|
||||
"lvs lvs.stderr netstat vgs" \
|
||||
"linux_exclusive_collection: And works as expected if they are there"
|
||||
|
||||
local i=1
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 42
|
||||
plan 44
|
||||
|
||||
. "$LIB_DIR/alt_cmds.sh"
|
||||
. "$LIB_DIR/log_warn_die.sh"
|
||||
@@ -1154,6 +1154,24 @@ EOF
|
||||
parse_arcconf "$samples/arcconf-003_900285.txt" > "$TMPDIR/got"
|
||||
no_diff "$TMPDIR/got" "$TMPDIR/expected" "Bug 900285"
|
||||
|
||||
# parse_uptime
|
||||
|
||||
cat <<EOF > "$TMPDIR/in"
|
||||
15:10:14 up 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08
|
||||
EOF
|
||||
is \
|
||||
"$( parse_uptime "$TMPDIR/in" )" \
|
||||
"1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08" \
|
||||
"parse_uptime works with Ubuntu's uptime"
|
||||
|
||||
cat <<EOF > "$TMPDIR/in"
|
||||
some weird format etc 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08
|
||||
EOF
|
||||
is \
|
||||
"$( parse_uptime "$TMPDIR/in" )" \
|
||||
" some weird format etc 1 day, 15:08, 11 users, load average: 0.18, 0.09, 0.08" \
|
||||
"parse_uptime returns uptime as-if if it doesn't contain an 'up'"
|
||||
|
||||
# report_system_summary
|
||||
parse_options "$BIN_DIR/pt-summary"
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
plan 8
|
||||
plan 9
|
||||
|
||||
TMPDIR="$TEST_TMPDIR"
|
||||
PATH="$PATH:$PERCONA_TOOLKIT_SANDBOX/bin"
|
||||
@@ -58,3 +58,8 @@ is \
|
||||
"$(get_var "Open_tables" "$samples/temp002/mysql-status")" \
|
||||
"40" \
|
||||
"get_var works on a status dump"
|
||||
|
||||
|
||||
dies_ok \
|
||||
"setup_data_dir $PERCONA_TOOLKIT_BRANCH" \
|
||||
"setup_data_dir dies if passed a populated directory" 2>/dev/null
|
||||
|
Reference in New Issue
Block a user