Age | Commit message (Collapse) | Author |
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
The ptest-runner has a default timeout of 300 secs and can be override
usint -t option in the runner.
There is a need to specify timeout by ptest because not all ptests takes
the sametime also are affected by machine. So add support to read a file
inside ptest folder (timeout-ptest) and override global timeout with it.
For example in glib-2.0,
/usr/lib/glib-2.0/ptest/run-ptest
/usr/lib/glib-2.0/ptest/timeout-ptest
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Since we are using threads to read from child, no complex logic is
needed for handle timeouts by std{out,err} in the child using alarm(2).
[YOCTO #14220]
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
In order to handle large output add a thread for read from childs using
a pipe and remove non-blocking option.
Modify bash unittest to output large data and cover this scenario.
[YOCTO #14220]
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Modify testcase to validate the actual exit status.
[YOCTO #14217]
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Fixes,
$ ./ptest-runner -d ./tests/data bash
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Fixes error
ERROR: Unable to detach from controlling tty, Inappropriate ioctl for device
when running multiple ptests
ptest-runner a b
or when invoked over ssh single command, like
$ ssh localhost ptest-runner
For ssh case, fd 0 is not a tty. (isatty(0) is false).
When running multiple ptests, deattach for parent needs to be
done only once.
Signed-off-by: Tero Kinnunen <tero.kinnunen@vaisala.com>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Enables multiple folders in -d option the current use case is to be able
specify multilib folders in the same run.
The -d option allows directories without whitespaces inside, example to
run after compile:
$ ./ptest-runner -d "test/data tests/data2/"
[YOCTO #12604]
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Fixes,
...
alimon@blackbox:~/upstream/ptest-runner2$ make CC=gcc check
gcc -std=gnu99 -pedantic -Wall -Werror -I . -g -c tests/main.c -o tests/main.o
gcc -std=gnu99 -pedantic -Wall -Werror -I . -g -c tests/ptest_list.c -o tests/ptest_list.o
gcc -std=gnu99 -pedantic -Wall -Werror -I . -g -c tests/utils.c -o tests/utils.o
gcc -lm -lrt -lpthread tests/main.o tests/ptest_list.o tests/utils.o utils.o ptest_list.o -o ptest-runner-test -lcheck -lsubunit -lutil
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcheck.a(check.o): in function `tcase_create':
(.text+0x1b3): undefined reference to `floor'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcheck.a(check.o): in function `tcase_set_timeout':
(.text+0x66b): undefined reference to `floor'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcheck.a(check.o): in function `check_get_clockid':
(.text+0xd03): undefined reference to `timer_create'
/usr/bin/ld: (.text+0xd25): undefined reference to `timer_delete'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcheck.a(check_pack.o): in function `ppack':
(.text+0x4fc): undefined reference to `__pthread_register_cancel'
/usr/bin/ld: (.text+0x546): undefined reference to `__pthread_unregister_cancel'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/libcheck.a(check_run.o): in function `srunner_run_tagged':
(.text+0xbf7): undefined reference to `timer_create'
/usr/bin/ld: (.text+0xc3c): undefined reference to `timer_settime'
/usr/bin/ld: (.text+0xc6c): undefined reference to `timer_delete'
collect2: error: ld returned 1 exit status
make: *** [Makefile:39: ptest-runner-test] Error 1
...
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Drop unused function parameters in wait_child().
The remaining warning in the top dir code is:
utils.c:25:9: warning: macro name is a reserved identifier [-Wreserved-id-macro]
#define _GNU_SOURCE
and it's not clear how to deal with that in a portable manner.
Drop unused variable in analizer code.
Rename analizer to analyzer.
Avoid program scope global by adding a set function for
the opts directory variable.
Free strdup()ed memory before exit.
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
|
|
Make tests build using: clang -Weverything
There are a few warnings that remain that are not
variable casting or macro fixes.
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
|
|
Fix basic errors found when building with the clang compiler
with the option -Weverything. There are a few warnings that remain
that are not variable casting, macro fixes, or similarily simple
changes.
Makefile: add -lutil for 'check' builds for clang/gcc
builds.
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
|
|
When running the run-execscript bash ptest as a user rather than root, a warning:
bash: cannot set terminal process group (16036): Inappropriate ioctl for device
bash: no job control in this shell
contaminates the bash log files causing the test to fail. This happens only
when run under ptest-runner and not when interactively testing!
The changes made to fix this include:
1. Get the process group id (pgid) before forking,
2. Set the pgid in both the parent and child to avoid a race,
3. Find, open and set permission on the child tty, and
4. Allow the child to attach to controlling tty.
Also add '-lutil' to Makefile. This lib is from libc and provides openpty.
Upstream-Status: Submitted [yocto@yoctoproject.org]
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com>
|
|
There was a race in the code where the pipes may not be read after the process has exited
and data may be left behind in them. This change to ordering ensures the pipes are read
after the exit code has been read meaning no data can be left behind and the logs should
be complete.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Rather than just killing the process we've swawned, set the process group
for spawned children and then kill the group of processes.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
There is no guarantee that the data written with fwrite will be flushed to the
buffer. If stdout and stderr are the same thing, this could lead to interleaved
writes. The common case is stdout output so flush the output pipes when writing to
stderr. Also flush stdout before the function returns.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
vredir ptest fails since too many file descriptors were open.
From the failed ptest log:
run-vredir
87,88c87,88
< ./vredir6.sub: line 10: /dev/null: Too many open files
< ./vredir6.sub: line 13: /dev/null: Too many open files
FAIL: run-vredir
Added function to close file descriptors before starting a new process.
Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
Signed-off-by: Randy Macleod <randy.macleod@windriver.com>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
If a process gets killed by timeout or OOM the output could end
without '\n' so add 'DURATION: N\n' after '\nERROR: ptest-dir\n'.
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
To fix buffer ordering problems.
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
In yocto project ptest data are installed to
PTEST_PATH ?= "${libdir}/${BPN}/ptest". Here make DEFAULT_DIRECTORY
be able to be defined outside of c code (e.g. passed in by CFLAGS),
in case libdir isn't "/usr/lib", which will cause "No ptests found"
error when running "ptest-runner" command. We will pass libdir to
DEFAULT_DIRECTORY when compiling to avoid that error.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
In stdout reported as,
...
BEGIN: ptest-dir
...
DURATION: N
END: ptest-dir
...
In XML reported as,
...
<testcase classname='test1' name='run-ptest'>
<duration>N</duration>
</testcase>
...
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
The ptest-runner support logging results to stdout and to a XML file
in stdout the ptest is mark as:
...
ERROR: Exit status is 1
TIMEOUT: ptest-directory
...
Add the same support in XML file for example,
...
<testcase classname='ptest-directory' name='run-ptest'>
<failure type='exit_code' message='run-ptest exited with code: 1'></failure>
<failure type='timeout'/>
</testcase>
...
[YOCTO #13088]
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
You can specify a set of ptests to be excluded, it will not fail
if some ptest excluded isn't found in the list of execution.
$ ./ptest-runner -e "hang glibc" -d tests/data
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Fix usage of relative paths in -d argument.
$ ./ptest-runner -d ./tests/data
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
In some ptest packages exists symlink in the ptest directory causing
to load/run twice the same ptest,
For example in perl5:
/usr/lib/perl -> /usr/lib/perl5
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linaro.org>
|
|
The current implementation uses the system clock to calculate how long
a ptest has been running with no output. If a ptest changes the system
clock as part of the test, that can cause the current implementation
to falsely trigger a timeout or miss an actual timeout. It is
preferrable to use a monotonic clock for calculating elapsed time in
order to avoid these issues.
This change tries to use the monotonic clock first and falls back to
the realtime clock if the monotonic clock is not supported.
Signed-off-by: Jeffrey Pautler <jeffrey.pautler@ni.com>
|
|
ptest-runner -t xx gives segfault
Signed-off-by: Anders Wallin <wallinux@gmail.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
The format follow the one defined in the Yocto wiki:
https://wiki.yoctoproject.org/wiki/QA/xUnit_XML_Template
It is only the minimum required but it can be extended in the future.
Signed-off-by: Schuler Christian <schuler.christian@siemens.com>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
This allows to easily add additional parameters.
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Print exit status before TIMEOUT to give clear information
to the user about exit status before TIMEOUT and END.
[YOCTO #10842]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Now the run_timeout_ptest runs only one test so is not needed
to detect when this ptest starts as before.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
This test case covers the case when a run-ptest script fails and
prints ERROR in the output.
[YOCTO #9752]
Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Now test_run_ptests only runs succesful ptests, this commit creates
test_timeout_ptest for test TIMEOUT run-ptest script.
Also creates new functions for run specific ptest and search for specific
output in this case TIMEOUT.
Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
If some run-ptest script fails the user needs to be noticed so
add print "ERROR" when fork fail or run-ptest exits different than
zero.
[YOCTO #9752]
Signed-off-by: Edwin Plauchu <edwin.plauchu.camacho@linux.intel.com>
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
Comply with old ptest-runner behaviour displaying ptest directory in,
BEGIN, END and TIMEOUT lines.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
ptest-runner shell script currently change to the ptest directory
before call run-ptest.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
|
|
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
When RELEASE env var is enabled the ptest-runner is compiled with
optimizations otherwise is compiled with debug information.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
- Case all tests.
- Case of hang also adds data for simulate hang.
- Case for read data in stderr.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
- run_child: Fix pipe setup for capture output.
- wait_child: Change usage of select for poll and fix TIMEOUT write
now to stdout.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
run_ptests: Takes every ptests and executes it using fork/excve
if timeout is enabled it look at stdout, stderr ptest output if
no have output in more than N secods kills it.
tests/data: Add simple run-ptest scripts for with echo name of
the ptests.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|
|
run_ptest implementation.
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
|