perf test perftool_testsuite: Use absolute paths

Test cases from perftool_testsuite are affected by the current
directory where the test are run. For this reason, the test
driver has to change the directory to the base_dir for references to
work correctly.

Utilize absolute paths when sourcing and referencing other scripts so
that the current working directory doesn't impact the test cases.

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Jakub Brnak <jbrnak@redhat.com>
Signed-off-by: Michael Petlan <mpetlan@redhat.com>
Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Veronika Molnarova
2025-09-30 18:09:17 +02:00
committed by Arnaldo Carvalho de Melo
parent a93b9ccb03
commit 241f21be7d
8 changed files with 202 additions and 84 deletions

View File

@@ -12,11 +12,12 @@
# This test checks whether the invalid and incompatible options are reported
#
# include working environment
. ../common/init.sh
DIR_PATH="$(dirname $0)"
TEST_RESULT=0
# include working environment
. "$DIR_PATH/../common/init.sh"
if ! check_kprobes_available; then
print_overall_skipped
exit 2
@@ -33,7 +34,9 @@ for opt in '-a' '-d' '-L' '-V'; do
! $CMD_PERF probe $opt 2> $LOGS_DIR/invalid_options_missing_argument$opt.err
PERF_EXIT_CODE=$?
../common/check_all_patterns_found.pl "Error: switch .* requires a value" < $LOGS_DIR/invalid_options_missing_argument$opt.err
"$DIR_PATH/../common/check_all_patterns_found.pl" \
"Error: switch .* requires a value" \
< $LOGS_DIR/invalid_options_missing_argument$opt.err
CHECK_EXIT_CODE=$?
print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "missing argument for $opt"
@@ -66,7 +69,8 @@ for opt in '-a xxx -d xxx' '-a xxx -L foo' '-a xxx -V foo' '-a xxx -l' '-a xxx -
! $CMD_PERF probe $opt > /dev/null 2> $LOGS_DIR/aux.log
PERF_EXIT_CODE=$?
../common/check_all_patterns_found.pl "Error: switch .+ cannot be used with switch .+" < $LOGS_DIR/aux.log
"$DIR_PATH/../common/check_all_patterns_found.pl" \
"Error: switch .+ cannot be used with switch .+" < $LOGS_DIR/aux.log
CHECK_EXIT_CODE=$?
print_results $PERF_EXIT_CODE $CHECK_EXIT_CODE "mutually exclusive options :: $opt"