Age | Commit message (Collapse) | Author |
|
Fix typo in pids test name.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The ROD could not detect failures when the output was redirected into a
file since the redirection was handled in the caller.
For example doing:
ROD echo a > /proc/cpus
Would have worked just fine since the $@ in ROD function would contain
only 'echo a'.
Moreover doing:
ROD false > tmpfile
Would end up writing the error message to the tmpfile instead of the
stdout.
For this reasons the ROD has been changed to take special char \> as
redirection operator. The only difference is that the > in the ROD
command must be prefixed with \ so that it's passed along with the file
to the ROD function. The $@ there is split on '>' and the redirection is
done inside ROD function which fixes the errors described above.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
Print which fallocate flag is not supported instead of plain:
"operation not supported"
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
FALLOC_FL_PUNCH_HOLE flag for fallocate syscall is available since Linux
2.6.38 and it's quietly ignored in older versions.
Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
|
|
Most of the functionality has been preserved.
The main changes are:
---------------------
Changed the testcases to use test.sh.
Got rid of bashisms.
The code is much more clean now :).
The testcases no longer move all system processes into test subgroups
which has proven to be troublesome for a few reasons. The main one was
that when the testcase failed to clean up the system ended up
half-functioning. The other was that this did not scale up reasonably as
the runtime depends on number of processes and there were systems (with
large amounts of CPUs and RAM and slightly older kernel) where only one
of the stress tests took about hour. The stress tests should now take at
most a few minutes each (at least they all took less than five minutes
on slowest machine I had) and the run should be < 1h on reasonably fast
machine.
I've also removed the ns namespace testcases since I haven't tested
these and discussion on ML suggested that ns namespace needs some extra
steps. We may add them later.
Another TODO is proper release agent testing, but since the original
code didn't actually test it (the code checked if release agent could be
set but that was all it tested) I've omitted it for now as well.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
For the same reason we added it to the C library in 420add2.
To quote the commit to the C library:
"Various desktop deamons (gvfsd-trash is known for that) may be
stupid enough to probe all newly mounted filesystem which results in
umount(2) failing with EBUSY."
The shell version does also check if the device is actually mounted and
do not attempt to do umount if it's not so it could be directly used in
cleanups.
This commit also makes use of the tst_umount() in mkfs01.sh and df01.sh
which has been found failing rarely.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The current code fails to build on sparc64.
It turns out that <linux/uaccess.h> is a better candidate than
<asm-generic/uaccess.h>, since the former takes into account
possible architecture-specific changes.
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Looking at the source carefully the mount_times parameter caused the
test to be executed n-times and this is the reason there is cleanup
hacked in the test setup.
So let's get rid of it as well has of the cleanup hack in setup.
Signed-off-by: Cedric Hnyda <chnyda@suse.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The changes to cgroup_fj_utility.sh didn't made it to:
commit a6e8e5ad92ed5f54a2776acb2ab816fd8e1e8f3b
Author: Cyril Hrubis <chrubis@suse.cz>
Date: Tue Jan 19 11:57:56 2016 +0100
testcases/cgroup_fj: Fixes.
Sorry everyone.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Unlocking an uninitialized rwlock as well as unlocking locked rwlock in
different thread was always undefined operation on Linux, but until
recently it just returned 0. For newer glibc (found in 2.21 and 2.22)
these testcases fails on x86_64 with invalid instruction.
See also:
https://bugzilla.suse.com/show_bug.cgi?id=962558
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
* Add executable flag to the pids.sh script
* Redirect stderr to stdout for kill pids_task2
* Fix the limit for third testcase:
Since we start a pids_task1 which tries to do a fork and expects to
succeed the limit must be lesser number of attached tasks - 2. It
makes more sense to increase the parameter by two rather than
decreasing it since the test 'pids.sh 3 1' fails because it tries to
start -1 tasks. The runtest file is updated accordingly.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
* Do not use full path when executing test binaries
* Make use of $TMPDIR
* Correct TCONF exits
* Decrease sleeps from 1 second to 100 miliseconds
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
With new enough mkfs.btrfs (v4.3.1+ here) the minimal size of the device
you can format with btrfs is apparently 100MB, so this commit increases
the size of the device created by tst_acquire_device() to 100MB in both
shell and C test library.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
In some environments the current limit (2) is not enough, and only
3rd or 4th access will succeed. Therefore, let's increase it slightly.
The new limit (10) is the same value we have in open_uinput().
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
I did a mistake in:
commit 80edf93dc1631ab8846066f720a80f8d11afa6b5
Author: Cyril Hrubis <chrubis@suse.cz>
Date: Tue Sep 1 15:03:40 2015 +0200
containers/netns: Add IFLA_NET_NS_PID configure check
Since once we execute the [ ] command the $? will be set to 0 and we
will do TBROK instead of intended TCONF.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
It can take up to 10ms for the /dev/disk/by-* files to appear after we
do the mkswap -L or mkswap -U. Now the test waits up to 100ms for the
files to be created before it calls swapon.
This fixes random sporadic failures I've seen on some systems.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
So that we can finally sleep for less than 1 second in shell testcases.
+ documentation in the test-writing-guidelines
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Fixes failures on debian where dash shell breaks the "-L ltp_testswap"
on space when it's assigned as device=$3.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
On older distributions the uinput module is not loaded automatically
when userspace tries to open /dev/input/uinput and has to be loaded
manually.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The opendir approach si prone to race conditions. Since if the newly
created input char device was missing at the time we called opendir() we
will never try to open it.
This changes the function to open /dev/input/event[0-100] blindly
instead.
We also retry opening the device with a short usleep() in between to
make sure we do not fail in cases where the device creation is delayed
substantially.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
cgroup_fj_function_cpuset_yes_no_1_yes_2_3_2_1 fails on newer systems.
Once upon a time there was backward compatibility noprefix mount option
for cpuset cgroup but since we cannot cannot mount cgroups on newer
systems (since it's allready mounted) the test is pointless (and will
fail).
The test was removed from runtest/controllers.
The option noprefix was removed for all function testcases since it was
only used for that testcase.
Signed-off-by: Cedric Hnyda <cedric@hnyda.net>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Btrfs reports symlinks to be 4 blocks in size.
Also rename the test symlink so that it's clear it's symlink.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The file is set as global make dependency in testcase.mk and the problem
is that the regen.sh script still takes 0.2s on reasonably modern
machine and because of that the parallel make can run the script several
times since the file is created at the very end of the script. I've seen
build failures where the script was stared from both tools/Makefile and
testcases/kernel/Makefile and the build failed since the result was
corrupted header.
So this patch adds '@touch linux_syscall_numbers.h' before we start the
regen.sh script so that the rest of make processes will see the goal as
finished and wouldn't start the regen.sh script while one instance is
allready running.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
1) Create a virtual mouse and write in /dev/uinput and
check that the data is well received in /dev/input/eventX
2) Create a virtual mouse, write in /dev/uinput, grab the
device and check that the data are not received in other
proccess.
3) Create a virtual mouse and check that the data are well
received in /dev/input/mice
4) Create a virtual mouse and send empty moves: check that
nothing is received in /dev/input/eventX
5) Create a virtual mouse and send events which cannot be
sent and check that they are not received in eventX
6) Test auto-repeat
Signed-off-by: Cedric Hnyda <chnyda@suse.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
As it was the foo.ko module may end up in MAKE_TARGETS (for any make
goal) even if WITH_MODULES was set to 'no' if there was any file with
.ko suffix left in the directory. Since the SKIP was set to 2
incorrectly in that case.
Not that this was a serious bug but it caused quite a lot of head
scratching before I figured out why the build system is even trying to
build the modules when kernel-devel package wasn't installed and the
configure set WITH_MODULES to 'no'.
Now we explictilty add the '*.ko' into MAKE_TARGETS only for install and
clean goals instead of playing with different SKIP variable values.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
sigval_t is glibc only construct, we use a union of sigval
which pretty much is same effect as sigval_t. POSIX defines
it that way too:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
I was to hasty to remove it, the old shell tests stil use it mostly to
print file content in case of failure. So this commit restores them
until old test are rewritten.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
* they are installed in the same target path
/opt/ltp/testcases/bin/runtests_noltp.sh
and overwrite each other in non-deterministic way
when multiple processes are used in "make install"
./temp/log.do_install:install -m 00775
"ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/sysvipc/runtests_noltp.sh"
"ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
./temp/log.do_install:install -m 00775
"ltp/20120903-r2/ltp-20120903/testcases/kernel/containers/utsname/runtests_noltp.sh"
"ltp/20120903-r2/image/opt/ltp/testcases/bin/runtests_noltp.sh"
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
|
|
glibc 2.23+ has dropped this header and moreover its not used in
testcase (which is using ltp_syscall to make the call).
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
|
|
Use CFLAGS="$CFLAGS $wflags" instead of CFLAGS+=" $wflags".
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Test which(1) command with some basic options.
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
There was only one test using tst_res() instead of tst_resm() and even
that was a typo.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
shmget()/shmat() fails to allocate huge pages shared memory segment
with EINVAL if its size is not in the range [ N*HUGE_PAGE_SIZE - 4095,
N*HUGE_PAGE_SIZE ]. This is a problem in the memory segment size round
up algorithm. The requested size is rounded up to PAGE_SIZE (4096), but
if this roundup does not match HUGE_PAGE_SIZE (2Mb) boundary - the
allocation fails.
This bug is present in all RHEL6 versions, but not in RHEL7. It looks
like this was fixed in mainline kernel > v3.3 by the following patches:
091d0d5 shm: fix null pointer deref when userspace specifies
invalid hugepage size
af73e4d hugetlbfs: fix mmap failure in unaligned size request
42d7395 mm: support more pagesizes for MAP_HUGETLB/SHM_HUGETLB
40716e2 hugetlbfs: fix alignment of huge page requests
Signed-off-by: Li Wang <liwang@redhat.com>
|
|
Commit cb2313789a21fb ("ltp_rt_sigaction: SPARC fixes for -O0") did
not consider the situation where the compiler (-O2) optimizes out
rt_stub functions and the labels we define in them, since these
functions are not used explicitly anywhere.
To avoid this let's explicitly mark them as used.
__attribute__((used)) should not bring any new build errors, because
it's supported by gcc and clang (at least since 3.0).
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
|
|
Signed-off-by: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com>
|
|
Description of Problem:
There is a race condition if we map a same file on different processes.
Region tracking is protected by mmap_sem and hugetlb_instantiation_mutex.
When we do mmap, we don't grab a hugetlb_instantiation_mutex, but only
mmap_sem (exclusively). This doesn't prevent other tasks from modifying
the region structure, so it can be modified by two processes concurrently.
Testcase hugemmap06.c is the trigger to cause system crash:
crash> bt -s
PID: 4492 TASK: ffff88033e437520 CPU: 2 COMMAND: "hugemmap06"
#0 [ffff88033dbb3960] machine_kexec+395 at ffffffff8103d1ab
#1 [ffff88033dbb39c0] crash_kexec+114 at ffffffff810cc4f2
#2 [ffff88033dbb3a90] oops_end+192 at ffffffff8153c840
#3 [ffff88033dbb3ac0] die+91 at ffffffff81010f5b
#4 [ffff88033dbb3af0] do_general_protection+338 at ffffffff8153c332
#5 [ffff88033dbb3b20] general_protection+37 at ffffffff8153bb05
[exception RIP: list_del+40]
RIP: ffffffff812a3598 RSP: ffff88033dbb3bd8 RFLAGS: 00010292
RAX: dead000000100100 RBX: ffff88013cf37340 RCX: 0000000000002dc2
RDX: dead000000200200 RSI: 0000000000000046 RDI: 0000000000000009
RBP: ffff88033dbb3be8 R8: 0000000000015598 R9: 0000000000000000
R10: 000000000000000f R11: 0000000000000009 R12: 000000000000000a
R13: ffff88033d64b9e8 R14: ffff88033e5b9720 R15: ffff88013cf37340
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0000
#6 [ffff88033dbb3bf0] region_add+154 at ffffffff811698da
#7 [ffff88033dbb3c40] alloc_huge_page+669 at ffffffff8116a61d
#8 [ffff88033dbb3ce0] hugetlb_fault+1083 at ffffffff8116b9bb
#9 [ffff88033dbb3d90] handle_mm_fault+917 at ffffffff81153295
#10 [ffff88033dbb3e00] __do_page_fault+326 at ffffffff8104f156
#11 [ffff88033dbb3f20] do_page_fault+62 at ffffffff8153e78e
#12 [ffff88033dbb3f50] page_fault+37 at ffffffff8153bb35
RIP: 00000000004027c6 RSP: 00007f7cadef9e80 RFLAGS: 00010297
RAX: 000000005a49238f RBX: 00007ffcb2d19320 RCX: 000000357498e084
RDX: 000000357498e0b0 RSI: 00007f7cadef9e5c RDI: 000000357498e4e0
RBP: 0000000000000008 R8: 000000357498e0a0 R9: 000000357498e100
R10: 00007f7cadefa9d0 R11: 0000000000000206 R12: 0000000000000007
R13: 0000000000000002 R14: 0000000000000003 R15: 00002aaaac000000
ORIG_RAX: ffffffffffffffff CS: 0033 SS: 002b
The fix are all these below commits:
f522c3ac00(mm, hugetlb: change variable name reservations to resv)
9119a41e90(mm, hugetlb: unify region structure handling)
7b24d8616b(mm, hugetlb: fix race in region tracking)
1406ec9ba6(mm, hugetlb: improve, cleanup resv_map parameters)
Signed-off-by: Li Wang <liwang@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
Do the same as in commit 3337c31d3577 ("syscalls: avoid creating
whiteout device in tests"), because overlayfs refuses to create
whiteout device.
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
|
|
creat() syscall check of syscalls/creat/creat09 is wrong.
When creat() syscall cannot make a file the test result
becomes PASS.
Signed-off-by: TAKAHASHI Tetsuya <takahashi.tetsuya.cis@canon-is.co.jp>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
|
|
Test pwritev(2) with some basic functions.
Pwritev(2) should succeed to write the expected content of data and
the file offset is not changed after writing the file.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Test preadv(2) with some basic functions.
Preadv(2) should succeed to read the expected content of data
and the file offset is not changed after reading the file.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Li Wang <liwang@redhat.com>
|
|
Signed-off-by: Li Wang <liwang@redhat.com>
|
|
The test compares cubic and dctcp congestion control algorithms
performance. One of the hosts emulates packets congestion with netem
loss 0.03%. Also ECN is enabled on the host, which is required
for dctcp algorithm to work properly.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
|
|
A char device with major 0 and minor 0 is known as whiteout device [1]
and overlayfs refuses to create such device. mknod01 and mount02 fail
on overlayfs because of this restriction.
Fix it by creating null device instead.
[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/overlayfs.txt?h=v4.3#n92
Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
|
|
Some tests don't pass __NR_* as argument directly, but use a variable.
Because ltp_syscall is a macro that stringifies "NR" argument we get
output such as: "syscall tests[i].syscall not supported on your arch".
Add syscall number to output as well.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
get_thread_area() and set_thread_area() system calls are not supported
on a set of targets. Corresponding syscall numbers are not defined, and
in LTP they become defined as '-1' in <linux_syscall_numbers.h> header.
This test uses switch-case for its own purposes with _NR_get_thread_area
and __NR_set_thread_area as case selections. It causes compile-time
error, at least for ARM target.
In this patch, the test code is refactored to remove switch-case, and
repair test build.
Warning about comparsion of signed and unsigned fixed too.
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
Created new testcases to test the pids controller
which is used to stop any new tasks from being fork()'d
after a certain limit is reached.
Signed-off-by: Cedric Hnyda <chnyda@suse.com>
|
|
Add new testcase for sched_setattr
Signed-off-by: Cui Bixuan <cuibixuan@huawei.com>
|
|
Avoid errno direct use, call safe macros instead.
Simplify time() calls which should never fail.
Signed-off-by: Nicolas Joly <njoly@pasteur.fr>
|
|
In a rare situation on system with many CPUs, small RAM
and overcommit_memory == 2, threads that are already started
can create memory pressure, that causes pthread_create
to hit EAGAIN. Don't fail the test, keep going with threads
that are already spawned.
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|