mirror of
https://github.com/torvalds/linux.git
synced 2026-04-22 00:33:58 -04:00
A test is considered failed when a sample trace exceeds the threshold. Failed tests return the same exit code as passed tests, requiring test frameworks to determine the result by searching for "hit stop tracing" in the output. Assign a distinct exit code for failed tests to enable the use of shell expressions and seamless integration with testing frameworks without the need to parse output. Add enum type for return value. Update `make check`. Cc: Daniel Bristot de Oliveira <bristot@kernel.org> Cc: John Kacur <jkacur@redhat.com> Cc: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com> Cc: Eder Zulian <ezulian@redhat.com> Cc: Dan Carpenter <dan.carpenter@linaro.org> Cc: Jan Stancek <jstancek@redhat.com> Link: https://lore.kernel.org/20250417185757.2194541-1-costa.shul@redhat.com Signed-off-by: Costa Shulyupin <costa.shul@redhat.com> Reviewed-by: Tomas Glozar <tglozar@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
26 lines
714 B
Bash
26 lines
714 B
Bash
#!/bin/bash
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
source tests/engine.sh
|
|
test_begin
|
|
|
|
set_timeout 2m
|
|
|
|
check "verify help page" \
|
|
"osnoise --help"
|
|
check "verify the --priority/-P param" \
|
|
"osnoise top -P F:1 -c 0 -r 900000 -d 1M -q"
|
|
check "verify the --stop/-s param" \
|
|
"osnoise top -s 30 -T 1 -t" 2
|
|
check "verify the --trace param" \
|
|
"osnoise hist -s 30 -T 1 -t" 2
|
|
check "verify the --entries/-E param" \
|
|
"osnoise hist -P F:1 -c 0 -r 900000 -d 1M -b 10 -E 25"
|
|
|
|
# Test setting default period by putting an absurdly high period
|
|
# and stopping on threshold.
|
|
# If default period is not set, this will time out.
|
|
check_with_osnoise_options "apply default period" \
|
|
"osnoise hist -s 1" 2 period_us=600000000
|
|
|
|
test_end
|