PT-2037 - added test for the situation when both --system-only and --mysql-only are specified

This commit is contained in:
svetasmirnova
2022-01-27 19:21:04 +03:00
parent 9427c16314
commit 3767e57e15
2 changed files with 21 additions and 0 deletions

View File

@@ -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" \

View File

@@ -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+
# ###########################################################################