Commit e4feb1ec authored by Alan Maguire's avatar Alan Maguire Committed by Khalid Elmously

ftrace/selftest: make unresolved cases cause failure if --fail-unresolved set

BugLink: https://bugs.launchpad.net/bugs/1877958

Currently, ftracetest will return 1 (failure) if any unresolved cases
are encountered.  The unresolved status results from modules and
programs not being available, and as such does not indicate any
issues with ftrace itself.  As such, change the behaviour of
ftracetest in line with unsupported cases; if unsupported cases
happen, ftracetest still returns 0 unless --fail-unsupported.  Here
--fail-unresolved is added and the default is to return 0 if
unresolved results occur.
Signed-off-by: default avatarAlan Maguire <alan.maguire@oracle.com>
Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
(backported from commit b730d668)
[PHLin: context adjustment]
Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 4542148a
......@@ -14,6 +14,7 @@ echo " Options:"
echo " -h|--help Show help message"
echo " -k|--keep Keep passed test logs"
echo " -v|--verbose Show all stdout messages in testcases"
echo " --fail-unresolved Treat UNRESOLVED as a failure"
echo " -d|--debug Debug mode (trace all shell commands)"
exit $1
}
......@@ -62,6 +63,10 @@ parse_opts() { # opts
DEBUG=1
shift 1
;;
--fail-unresolved)
UNRESOLVED_RESULT=1
shift 1
;;
*.tc)
if [ -f "$1" ]; then
OPT_TEST_CASES="$OPT_TEST_CASES `abspath $1`"
......@@ -96,6 +101,7 @@ LOG_DIR=$TOP_DIR/logs/`date +%Y%m%d-%H%M%S`/
KEEP_LOG=0
DEBUG=0
VERBOSE=0
UNRESOLVED_RESULT=0
# Parse command-line options
parse_opts $*
......@@ -160,7 +166,7 @@ eval_result() { # sigval
$UNRESOLVED)
prlog " [UNRESOLVED]"
UNRESOLVED_CASES="$UNRESOLVED_CASES $CASENO"
return 1 # this is a kind of bug.. something happened.
return $UNRESOLVED_RESULT # depends on use case
;;
$UNTESTED)
prlog " [UNTESTED]"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment