Age | Commit message (Collapse) | Author |
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Use a failure status code for timeout to avoid confusion between tests
that take too long to execute versus a failure due to an operation
taking longer than expected.
v2: Add a "timed out" message before exiting. (Daniel Vetter)
Fix the timeout library check by disabling hard errors in xfail
tests, since these share the same exit status as test failure.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Install the test programs by default so that they can be packaged.
Tested with the testdisplay test so that it still runs after the
modifications as it depends on a data file to be present. Need to
pass -r option to enable QR code display on success (PNG data file).
Packaging is useful when building a complete software stack for a
DUT from scratch. This should bring us closer to achieving a
built-from-scratch testing workflow.
Package maintainers can always decide to ignore the installed files.
v2:
- Install more tests including scripts and their data
v3:
- Add clarification to commit message about why we do this.
(Chris Wilson & Thomas Wood)
- Change libexec into pkglibexec to comply to standard
(Thomas Wood)
- Do not install $(common_files). (Thomas Wood)
- Make it really obvious the installed files are tests by using
tests directory name to avoid any confusion with packagers.
v4:
- Fixed commit message.
v5:
- Add file locator helper to retain backwards compatibility.
(Thomas Wood)
- Test with testdisplay -r option that draws the .png file.
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add rules to fix unused-result warnings when compiling with
_FORTIFY_SOURCE defined and apply them to the library and tests.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add an optional dependency on libunwind to print stack traces when a
test assertion fails.
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Apparently nobody else likes testing and debugging GEM coherency issues.
However, this also means that QA is skipping these vital tests. Split
out a set of canaries into igt/gem_concurrent_blit and keep the rest in
igt/gem_concurrent_all.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89497
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We use SIGTERM to kill off child processes. We use it a lot. Reporting
everytime we use it is just spam. Treat the similar user signals
(SIGINT, SIGQUIT and the should-never-have-been SIGPIPE) similarly to
reduce noise.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Wood <thomas.wood@intel.com>
|
|
Useful for inspecting the screen state in kms tests when they fail.
Also move the screen clearing in kms_cursor_crc to the bottom.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
igt_interactive_debug should be defined in igt_core.c, rather than the
header, to avoid it being defined more than once.
Reported-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
I missed the quiet "Log start" between the test failure and the debug
output (and so was very confused by the repetition). You have to shout
at me!
v2: Thomas suggested I make the end of the logging clear as well. Since
I completely missed that there was a end marker, he must be right!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Thomas Wood <thomas.wood@intel.com>
|
|
igt_kms extensively uses line continuation when dumping state updates
at the debug level. They got badly mangled with the recent changes to
for the log handling functions. Two separate fixes:
- Don't prepend domain and other metainformation when it's just a
continuation line.
- Dont add newlines when dumping the log recorder.
If someone interleaves different log level messages this will go awry,
but really just don't do that.
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
Print the received signal name to stderr when handling a signal. This
uses an array of handled signal names since strsignal() only provides
descriptions.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Remove options from argv that have been handled by getopt to allow
additional non-option parameters to be processed in the test application.
This fixes issues when using options such as --debug with tests that accept
additional non-option parameters.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Using defines removes an extra function call and prepares for changes
to the command line argument handling.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add an exit status message to simple tests, similar to the one printed
for subtests. This includes the test outcome and the time taken to run
the test.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Subtest names should only contain '-', '_' and alphanumeric characters.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
These messages are sent to stderr and could indicate an issue when
enumerating subtests.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
This is a regression from commit df11a0f (lib: add a critical warning
level).
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Use cmdline variable for interactive debug instead of env var.
v2: Make interactive-debug domain optional and use "all" when not set.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Raw system calls aren't portable to other kernels.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
s/KMSG_INFO/KERN_INFO/
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
This provides symmetry with logging the start of the test via kmsg.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
v2: add an "application" filter for the default domain (used by
applications)
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Log domains can be used to identify the source of log messages, such as
the test being run or the helper library.
v2: Add separate domains for different parts of the helper library and
use an empty default domain for applications.
Expand the log output to include the process name and the log level
of the message in addition to the domain and pid.
Print the expanded message only for warning and debug messages.
v3: check for glibc before using program_invocation_short_name
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add a glossary of test name terms based on the details in
tests/NAMING-CONVENTION.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Simple tests do not support subtests, so fail if igt_subtest is used in
one.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Make timeout behaviour more consistent with igt_fail, where subsequent
subtests are only skipped if the failure occurs outside of a subtest.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85718
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
The IGT_TEST_DESCRIPTION macro can be used to define a description for a
test.
v2: Remove semicolon from end of macro (Damien Lespiau)
Add API documentation for the macro.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Several IGT tests cycle through a lot of GEM memory and
when running these tests on Android they tend to get
killed by the lowmemorykiller. The lowmemorykiller really
is not usefull in this context and is just preventing the
test from doing its job. This commit adds a function to
disable the lowmemorykiller by writing "9999" to its
oom adj parameter, which means it will never "select"
any process to kill. The normal linux oom killer is still
there to protect the kernel.
The low memory killer is disabled during the common
init function and then re-enabled by the exit handler.
To make this work for single tests the exit handler is now
installed in the common init function also so that it is
invoked for all tests.
This is just a hack to get round the fact that the i915
driver uses the concept of purgeable memory which is not
understood by the lowmemorykiller. If this ever gets
fixed then this patch can be removed.
Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: A bit of polish (coding style, static and rename
check_igt_exit to common_exit_handler, drop the is_disabled check
since we only call this once now).]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Flush any buffers before forking to prevent duplicated output.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Currently tests that use igt_simple_main will simply call
"exit()" if they pass, making it difficult to ensure that
any required cleanup is done. At present this is not an
issue, but it will be when I submit a patch to turn off the
lowmemorykiller for all tests.
Signed-off-by: Tim Gore <tim.gore@intel.com>
[danvet: Also update api docs.]
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
If we don't reset exit_handler_count before forking, we may have a
case where the forked process is killed before it even does
"exit_handler_count = 0": in that case, it is still finishing forking.
When that happens, we may end up calling our exit handlers. On the
specific bug I'm investigating, we call igt_reset_connnectors(), which
ends up in a deadlock inside malloc_atfork. If we attach gdb to the
forked process and get a backtrace, we have:
(gdb) bt
0 __lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
1 0x00007f15634d36bf in _L_lock_10524 () from /lib/x86_64-linux-gnu/libc.so.6
2 0x00007f15634d12ef in malloc_atfork (sz=139729840351352, caller=<optimized out>) at arena.c:181
3 0x00007f15640466a1 in drmMalloc () from /usr/lib/x86_64-linux-gnu/libdrm.so.2
4 0x00007f1564049ad7 in drmModeGetResources () from /usr/lib/x86_64-linux-gnu/libdrm.so.2
5 0x0000000000408f84 in igt_reset_connectors () at igt_kms.c:1656
6 0x00000000004092dc in call_exit_handlers (sig=15) at igt_core.c:1130
7 fatal_sig_handler (sig=15) at igt_core.c:1154
8 <signal handler called>
9 0x00007f15634cce60 in ptmalloc_unlock_all2 () at arena.c:298
10 0x00007f156350ca3f in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:188
11 0x000000000040a029 in __igt_fork_helper (proc=proc@entry=0x610fc4 <signal_helper>) at igt_core.c:910
12 0x000000000040459d in igt_fork_signal_helper () at igt_aux.c:110
13 0x0000000000402ab7 in __real_main63 () at bug.c:76
14 0x000000000040296e in main (argc=<optimized out>, argv=<optimized out>) at bug.c:63
After doing some searches for "stuck at malloc_atfork", it seems to me
we probably shouldn't be doing any malloc calls at this point of the
code, so the best way to do that is to make sure we can't really run
the exit handlers.
So on this patch, instead of resetting the exit handlers after
forking, we reset them before forking, and then restore the original
value on the parent process.
I can reproduce this problem by running "./kms_flip --run-subtest
2x-flip-vs-modeset" under an infinite loop. Usually after a few
hundred calls, we end up stuck on the deadlock mentioned above. QA
says this problem happens every time, but I'm not sure what is the
difference between our environments that makes the race condition so
much easier for them.
The kms_flip.c problem can be considered a regression introduced by:
commit eef768f283466b6d7cb3f08381f72ccf3951dc99
Author: Thomas Wood <thomas.wood@intel.com>
Date: Wed Jun 18 14:28:43 2014 +0100
tests: enable extra connectors in kms_flip and kms_pipe_crc_basic
even though this commit is not the one that introduced the real
problem.
It is also possible to reproduce this problem with a few modifications
to template.c:
- Add a call to igt_enable_connectors() inside the first fixture.
- Add igt_fork_signal_helper() and igt_stop_signal_helper() calls
around subtest B.
Note that the crucial piece is that the parent actively kills helper
children, and if we skip tests this can happen _really_ fast. See e.g.
commit a031a1bf93b828585e7147f06145fc5030814547
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Fri Sep 13 16:43:22 2013 +0200
lib/drmtest: ducttape over fork race
for past hilarity in this area.
Cc: Thomas Wood <thomas.wood@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81367
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
And notice that INFO is 6 not 5. This is because I had intended to use
KERN_NOTICE anyway...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Check any test specific options for conflicts with the standard set of
options.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Most tests use a printable character as the value for getopt to return,
so avoid conflicts by using non-printing values for the standard options.
v2: fix "-h" short option
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Write the program name if !list_only so that we associate oops with
simple tests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
One of the side-effects we test for are kernel oops and knowing the
guilty subtest can help speed up debugging. We can write to /dev/kmsg to
inject messages into dmesg, so let's do so before the start of every
test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|