mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-11 02:04:38 +08:00
PT-2037 - added test for the situation when both --system-only and --mysql-only are specified
This commit is contained in:
@@ -1517,6 +1517,8 @@ stalk() {
|
||||
if [ -n "$last_prefix" ]; then
|
||||
margin=$(du -mc "$OPT_DEST"/"$last_prefix"-* | tail -n 1 | awk '{print $1'})
|
||||
fi
|
||||
# Disk space checked even if system data collection is OFF
|
||||
# See https://jira.percona.com/browse/PT-1486
|
||||
disk_space "$OPT_DEST" > "$OPT_DEST/$prefix-disk-space"
|
||||
check_disk_space \
|
||||
"$OPT_DEST/$prefix-disk-space" \
|
||||
|
||||
@@ -604,6 +604,25 @@ like(
|
||||
"Option --mysql-only collects MySQL data"
|
||||
);
|
||||
|
||||
# ###########################################################################
|
||||
# Test if options --mysql-only and --system-only specified together,
|
||||
# pt-stalk collects only disk-space, hostname, output, and trigger
|
||||
# ###########################################################################
|
||||
|
||||
cleanup();
|
||||
|
||||
$retval = system("$trunk/bin/pt-stalk --no-stalk --mysql-only --system-only --run-time 10 --sleep 2 --dest $dest --pid $pid_file --iterations 1 --prefix test -- --defaults-file=$cnf >$log_file 2>&1");
|
||||
|
||||
PerconaTest::wait_until(sub { !-f $pid_file });
|
||||
|
||||
$output = `ls $dest`;
|
||||
|
||||
is(
|
||||
$output,
|
||||
"test-disk-space\ntest-hostname\ntest-output\ntest-trigger\n",
|
||||
"If both options --mysql-only and --system-only are specified only essential collections are triggered"
|
||||
);
|
||||
|
||||
# ###########################################################################
|
||||
# Test report about performance schema transactions in MySQL 5.7+
|
||||
# ###########################################################################
|
||||
|
||||
Reference in New Issue
Block a user