Age | Commit message (Collapse) | Author |
|
1) Take use of some safe macros
2) Remove duplicate tests stat06
3) Add ELOOP check
4) Remove useless struct member
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
1) Take use of some safe macros
2) Remove duplicate tests stat02,stat05
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
sighandler_counter
1) bionic(Android libc) doesn't implement libc sigpending() currently,
so we can skip it on Android by the detection. Also add break to
avoid potential compiler warnings.
2) Fix sigpending02 -i n by resetting sighandler_counter variable.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
|
|
Don't alway skip libc stime() for Android because bionic(Android libc)
may implement it in the future.
Also add break to fix potential compiler warnings.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
|
|
Use pre-created files by the library instead of creating them
by hand in the setup() routine.
Signed-off-by: Sandeep Patil <sspatil@android.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
...and drop the duplicate "invalid addrlen" test case.
Signed-off-by: Sandeep Patil <sspatil@android.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
This just remove some unnecessary breaks (not all).
Breaks after tst_brk() aren't removed, as it'd produce warning on some
gcc versins.
Reported-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Enji Cooper <yaneurabeya@gmail.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
To fix an obvious integer overflow when system(32bit) original nr_hugepages >= 512.
--- Error log ---
# grep -i hugepage /proc/meminfo
HugePages_Total: 512
HugePages_Free: 512
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
# readelf -h hugeshmat04 |grep -i ELF
ELF Header:
Class: ELF32
# ./hugeshmat04
tst_test.c:1085: INFO: Timeout per run is 0h 05m 00s
mem.c:814: INFO: set nr_hugepages to -1024
mem.c:823: BROK: nr_hugepages = 512, but expect -1024
mem.c:814: INFO: set nr_hugepages to 512
-----------------
Reported-by: Zhonghua Hao <zhao@redhat.com>
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Quoting Wei Li:
"
On my machine running linux-4.19.23, the fstat05 test case went failed:
[root@localhost ltp_20180926_src]# ./testcases/kernel/syscalls/fstat/fstat05
fstat05 1 TFAIL : fstat05.c:168: fstat() returned 0 but we wanted -1
Finally i found that, the end of head was expanded after invoking setup(), more
than 4 * getpagesize(), then ptr_str is not a point outside user's accessible
address space any more.
"
This fixes the test by using the tst_get_bad_addr() instead of sbrk() + delta.
Reported-by: Wei Li <liwei391@huawei.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
1)The 'MS_REC' and 'MS_PRIVATE' flag are not defined on some old distros,
so add them into 'include/lapi/mount.h' to fix it.
2)Enclose macro with complex values in parentheses.
Signed-off-by: Jinhui huang <huangjh.jy@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Jinhui huang <huangjh.jy@cn.fujitsu.com>
Reviewed-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
|
|
Reported-by: Dengke Du <dengke.du@windriver.com>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
We will test stime() libc wrapper, __NR_stime and __NR_settimeofday
syscalls.
Note:
1) bionic (Android libc) does not provide stime(), so avoid testing
it on Android.
2) some arches(e.g. x86_64) don't define __NR_stime directly because
glibc implements stime() by __NR_settimeofday.
Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Steve Muckle <smuckle@google.com>
Tested-by: Steve Muckle <smuckle@google.com>
|
|
Remove all debug checks and simplify the test.
Signed-off-by: Sandeep Patil <sspatil@android.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
In the process, drop checks for UCLINUX and WCOREDUMP.
Make the test simple and remove all the logic to detect if a
system is "in stress".
Signed-off-by: Sandeep Patil <sspatil@android.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
We're now testing sigpending() libc wrapper, __NR_sigpending and
__NR_rt_sigpending syscalls.
This brings again testing libc sigpending() implementation, which was
removed in
63f8a3f77 ("sigpending: use direct syscall")
and removes sharing code and directory rt_sigpending introduced in
b03885fff ("rt_sigpending02: reuse code from sigpending02")
+ removed unused headers.
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
This commit makes use of the newly added test variants to switch between
different syscall variants/wrappers at runtime.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Mark Salyzyn <salyzyn@android.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
Fixes: 270
clock_adjtime{01,02} are created using the new API, based on existing
adjtimex(2) tests. clock_adjtime() syscall might have as execution
path:
1) a regular POSIX clock (only REALTIME clock implements adjtime())
- will behave exactly like adjtimex() system call.
- only one being tested here.
2) a dynamic POSIX clock (which ops are implemented by PTP clocks)
- will trigger the PTP clock driver function "adjtime()"
- different implementations from one PTP clock to another
- might return EOPNOTSUPP (like ptp_kvm_caps, for example)
- no observed execution entry point for clock_adjtime()
Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Used by clock_XXXtime() tests, defining MAX_CLOCKS in common header.
Signed-off-by: Rafael David Tinoco <rafael.tinoco@linaro.org>
|
|
This tests the userfaultfd syscall to handle pagefault events.
It does so by registering a userfaultfd object to the address of
a memory page. In a second thread it handles the event and writes
data in the monitored memory page to indicate success.
Signed-off-by: Christian Amann <camann@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
This adds tests for the ioctl request FIDEDUPERANGE
on a btrfs device.
These tests set the contents of two files, and checks
if the following entities are set correctly after
the ioctl call:
- errno (set by ioctl)
- number of deduplicated bytes
- status field of the file_dedupe_range_info struct
Signed-off-by: Christian Amann <camann@suse.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
This fixes build on uClibc with disabled fts.h support and MUSL, which
does not have fts.h at all.
Reported-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
According to man msgrcv(3) struct for user buffer should be defined by
user. Therefore rename it as MUSL defines struct msgbuf in <sys/msg.h>
under _BSD_SOURCE, so the name conflict.
Reported-by: Dengke Du <dengke.du@windriver.com>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
Suggested-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Test basic functionality of sigpending/rt_sigpending.
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Rather than forking the code of sigpending02 completely, reuse its code
for rt_sigpending02 by conditionally compiling the syscalls accordingly.
That way we ensure tests written for either rt_sigpending or sigpending
are also considered for the respective other.
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Paul Lawrence <paullawrence@google.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The testcase is broken on system with PERF_COUNT_HW_INSTRUCTIONS not supported.
Previously, it does the event check in count_hardware_counters, but that has
been filtered out on s390 platform via commit 6730475ba5. So now test break
as follow:
perf_event_open02 1 TBROK : perf_event_open02.c:275: perf_event_open failed: errno=ENOENT(2): No such file or directory
perf_event_open02 2 TBROK : perf_event_open02.c:275: Remaining cases broken
Signed-off-by: Li Wang <liwang@redhat.com>
Reviewed-by: Michael Holzheu <holzheu@linux.ibm.com>
Acked-by: Jan Stancek <jstancek@redhat.com>
|
|
A new BROK was occurred on a special numa system which node 1 just has
memory but no cpu. This special configuration makes numa system detection
is_numa(NULL, NH_MEMS, 2) get pass in setup() but test failed in the mem.c
library funcion test_ksm_merge_across_nodes becuase the NH_CPUS is to requre
testing node should have cpu.
However, I have gone though all of our LTP ksm tests and confirmed that there
is no necessary to do cpu check for it, actully only ksm06 invoke that funcion.
In this patch I just remove the NH_CPUS flag to get ksm06 test pass.
# numactl -H
available: 2 nodes (0-1)
node 0 cpus: 0 1 2 3 4 5 6 7
node 0 size: 31431 MB
node 0 free: 26355 MB
node 1 cpus:
node 1 size: 255 MB
node 1 free: 213 MB
node distances:
node 0 1
0: 10 40
1: 40 10
# ./ksm06
tst_test.c:1085: INFO: Timeout per run is 0h 10m 00s
mem.c:539: INFO: need NUMA system support
tst_test.c:920: BROK: Test haven't reported results!
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: Jan Stancek <jstancek@redhat.com>
|
|
We don't need to skip all the tests just because we are unable to add
a test user. Not having a test user only affects PRIO_USER test case.
So just skip that one and continue running the rest of the tests when
useradd is not available or can't write to /etc/passwd (Eg: read-only
filesystem)
If useradd is present and it still fails for other reasons, then
consider it an error in the test preparation phase.
This also allows this test case to be built and run on Android.
Signed-off-by: Saravana Kannan <saravanak@google.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Test simple tgkill() error cases.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Li Wang <liwang@redhat.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
tgkill() should fail with EAGAIN when RLIMIT_SIGPENDING is reached with
a real-time signal. Test this by starting a child thread with SIGRTMIN
blocked and a limit of 0 pending signals, then attempting to deliver
SIGRTMIN from the parent thread.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Li Wang <liwang@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
tgkill() delivers a signal to a specific thread. Test this by
installing a SIGUSR1 handler which records the current pthread ID.
Start a number of threads in parallel, then one-by-one call tgkill(...,
tid, SIGUSR1) and check that the expected pthread ID was recorded.
Signed-off-by: Greg Hackmann <ghackmann@google.com>
Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Li Wang <liwang@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Test works with is glibc specific definitions M_MXFAST , M_NLBLKS, which
aren't supported on other libc (uClibc, MUSL, Bionic), probably no other
libc will ever define.
uClibc also defines them in headers, that's we explicitly check glibc.
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
Unlike glibc and uclibc (which define MREMAP_MAYMOVE under __USE_MISC)
MUSL requires _GNU_SOURCE.
+ Remove __USE_GNU
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
enum __ptrace_request is glibc/uclibc specific.
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
Unlike glibc and uclibc (which define SA_NOMASK under __USE_MISC)
MUSL requires _GNU_SOURCE.
_GNU_SOURCE is already used in crash02.c.
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
|
|
Test issue:
mtest01 start many children to alloc chunk of memory and do write
page (with -w option), but occasionally some children were killed by
oom-killer and exit with SIGCHLD signal sending. After the parent
reciving this SIGCHLD signal it will report FAIL as a test result.
It seems not a real kernel bug if something just like that, it's
trying to use 80% of memory and swap. Once it uses most of memory,
system starts swapping, but the test is likely consuming memory at
greater rate than kswapd can provide, which eventually triggers OOM.
---- FAIL LOG ----
mtest01 0 TINFO : Total memory already used on system = 1027392 kbytes
mtest01 0 TINFO : Total memory used needed to reach maximum = 12715520 kbytes
mtest01 0 TINFO : Filling up 80% of ram which is 11688128 kbytes
mtest01 1 TFAIL : mtest01.c:314: child process exited unexpectedly
-------------------
Rewrite changes:
To make mtest01 more easier to understand, I just rewrite it into
LTP new API and make a little changes in children behavior.
* decrease the pressure to 80% of free memory for testing
* drop the signal SIGCHLD action becasue new API help to check_child_status
* make child pause itself after finishing their memory allocating/writing
* parent sends SIGCONT to make children continue and exit
* use TST_PROCESS_STATE_WAIT to wait child changes to 'T' state
* involve ALLOC_THRESHOLD to rework same code in defines
* to make mtest01 support running with -i N > 1
Signed-off-by: Li Wang <liwang@redhat.com>
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Now that aio_tio is just a single file test, consolidate the aio tests
within io/aio.
Suggested-by: Steve Muckle <smuckle@google.com>
Reviewed-by: Steve Muckle <smuckle@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Convert to the new test lib and perform various cleanups.
Also refactor the test definition for readability.
Signed-off-by: Matthias Maennich <maennich@google.com>
Reviewed-by: Steve Muckle <smuckle@google.com>
[ pvorel: Fixed failing build when missing libaio, cleanup ]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
The alignment for O_DIRECT operations has to match the blocksize of the
underlying block device. Determine the alignment from the target file.
aio_tio test cases 1 and 2 failed (nondeterministic) on aarch64 when run
on a 4096 byte blocksize and with an alignment of 512 bytes.
Determining the blocksize from the block device and using it for the
alignment resolves the test issue.
Signed-off-by: Matthias Maennich <maennich@google.com>
Reviewed-by: Alessio Balsini <balsini@google.com>
Reviewed-by: Steve Muckle <smuckle@google.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
as default parameters.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
+ remove unused local ret variable.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
to reduce duplicity.
That required to rename variable s/FS_TYPE/TST_FS_TYPE/.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|