Age | Commit message (Collapse) | Author |
|
Raw sockets receive all packets from all interfaces as soon as they are
created. They don't need to be bound to one or more interfaces like I thought.
This creates the socket with a NULL packet type which appears to be unused in
the Linux kernel and receives no packets. The protocol is then changed to
ETH_P_ALL when binding to the netdevice we are interested in.
I assume it is impossible for a packet to have zero for its packet type. Most
likely using ETH_P_LOOP would have been OK too, but I suppose that is really
used by some hardware.
This also fixes various other problems that have been observed with this
test. Such as memory allocation failures.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Cc: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Tested-by: Jan Stancek <jstancek@redhat.com>
|
|
Without this test failure was wrongly reported:
rpc_test 1 TFAIL: tirpc_rpcb_getaddr 10.0.0.2 536875000 failed unexpectedly
Also make sure with variable that server has started before trying to
kill it.
Kill server with SIGPIPE, should be enough and SIGKILL
produced warning, which might be confused:
/opt/ltp/testcases/bin/rpc_test.sh: line 61: 3827 Killed $SERVER $PROGNUMNOSVC
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
This fixes build on mipsel/mips/sparc64.
Fixes: 69e287bc2 ("syscalls/kill11: convert to new library")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
We need to increase the data pointer by the amount already read.
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
The non _time64 syscalls can only be called with the old timespec and
calling them with the libc timespec or the new kernel timespec is
incorrect.
Similarly, calling the libc interfaces with the old timespec is
incorrect as well and they should be called only with the libc timespec.
This patch updates various testcases that have got this issue.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Fixes: d20a3e8f9 ("syscalls/fanotify: New test for FAN_MODIFY_DIR")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
|
|
Even though reads are blocking and packets are flipped into the netdevice
buffer whole, it seems read may return before a full packet is read into user
land. Retrying read should prevent timeouts and read failures on some
machines.
Also this increases the timeout to wait for the checkpoint to a large value
because sometimes the kernel stalls, possibly while trying to (re)claim
memory, and this causes the checkpoint wait to timeout and everything to be
cleaned up. If the kernel is left in a stalled state, this can result in a
stack trace which is more useful.
Closes: #674
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reported-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
Cc: Petr Vorel <pvorel@suse.cz>
|
|
TIRPC_LIBS variable requires including include/mk/env_pre.mk.
(Not included in Makefile.inc, because all it's users include
env_pre.mk themselves).
Fixes: c7d2a7458 ("rpc-tirpc: Detect libtirpc with pkg-config")
Fixes: 60b20c428 ("rpc: Enable and fix build basic RPC tests with glibc SunRPC")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
|
|
Fixme: 3190368d2 ("rpc/rpc_test.sh: Rewrite into new shell API")
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Currently, we use return instead of zero_offset. I debug this code
(early return, ext4 filesystem)as below:
---------------------------------------
TEST(ioctl(dev_fd, LOOP_SET_DIRECT_IO, 1));
if (TST_RET == 0) {
tst_res(TPASS, "LOOP_SET_DIRECT_IO succeeded unexpectedly");
SAFE_IOCTL(dev_fd, LOOP_SET_DIRECT_IO, 0);
}
return;
---------------------------------------
this case will be broke when using i parameter,
ioctl_loop05.c:62: BROK: ioctl(3,LOOP_SET_DIRECT_IO,...) failed: EINVAL (22)
It seems the last test affected this test, so I move zero status to the
beginning of the test to avoid unknown error.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Current regex matches any word character followed by space
and one of letters "abdft". So it doesn't match only symbol type,
but can match for example value and size:
$ grep "\w [a,b,d,f,t]" nm.out
__libc_csu_init T 10000640 b4
matches ^ ^
Signed-off-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Tested-by: Li Wang <liwang@redhat.com>
|
|
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Acked-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
|
|
Also remove min_kver because it is arbitrary. We know this test works on much
older kernels, but it will probably hit bugs that have been fixed for a long
time.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
[ pvorel: change CAN_MTU to use sizeof() like it's in <linux/can.h> ]
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
The prctl() syscall check does return in case of success hence the check
for NoNewPrivs was never executed. Move the proc check before the sycall
check to fix that.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
by introducing $ROUTE_CHANGE_IP for shell based tests (only these
rewritten into new shell API) and $ROUTE_CHANGE_NETLINK with C Netlink
API based tests.
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
changing destination, gateway and interface. These tests are inspired by
shell tests, but send UDP packets instead of ICMP and there is no
receiver of the packets thus no verification. Tests are much faster that
shell tests.
lhost address is not used, but NIC is set (required by interface tests).
* use libmnl and new C API, requires pkg-config (and pkg.m4 macro for
aclocal) for detection (but that's already needed for TI-RPC tests)
* add shell wrappers
* move common code for changing iface to route-lib.sh
* travis: add libmnl libraries to most of travis jobs
* cleanup test description and Makefile
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
based on setup_addrinfo() from netstress.c.
Added only to new C API, thus code kept in tst_net.c, instead of safe_net.c,
which is also for legacy API.
Reviewed-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Acked-by: Cyril Hrubis <chrubis@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
Suggested-by: Richard Palethorpe <rpalethorpe@suse.com>
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
|
|
The code in __loop_update_dio() uses inode->i_sb->s_bdev to get the
logical block size for the backing file for the loop device. If that
pointer is NULL, which happens to be the case for Btrfs, the checks for
alignment and block size are ignored and direct I/O can be turned on
regardless of the offset and logical block size.
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
CC: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
|
|
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
|
|
It helps to have more advanced commands without having to declare
function.
Suggested-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Li Wang <liwang@redhat.com>
|
|
Block this signal so that the default default disposition (program
termination) does not kill the parent process before we can get the
pending signal with sigwait().
Also remove the useless sleep in child that only slow downs the test.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Richard Palethorpe <rpalethorpe@suse.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Fix the test failure and following compile warning (gcc version 10.0.1):
lremovexattr01.c: In function ‘verify_lremovexattr’:
lremovexattr01.c:98:6: warning: ‘strcmp’ of a string of length 13 and an array of size 13 evaluates to nonzero [-Wstring-compare]
98 | if (strcmp(got_value, XATTR_VALUE)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jan Stancek <jstancek@redhat.com>
|
|
Reduce some boiler plate code in FAN_REPORT_FID tests and
save fid only once per object instead of once per expected event.
Suggested-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Acked-by: Jan Kara <jack@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
|
|
- Watch dir modify events with name info
- Watch self delete events w/o name info
- Test inode and filesystem marks
- Check getting events for all file and dir names
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Acked-by: Jan Kara <jack@suse.cz>
|
|
Test reporting events with fid also with recusrive inode marks:
- Test events "on self" (FAN_DELETE_SELF) on file and dir
- Test events "on child" (FAN_MODIFY) on file
With recursive inode marks, verify that the FAN_MODIFY event reported
to parent "on child" is merged with the FAN_MODIFY event reported to
child.
The new test case is a regression test for commit f367a62a7cad:
fanotify: merge duplicate events on parent and child
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Acked-by: Jan Kara <jack@suse.cz>
|
|
- Fix calculation of events buffer size
- Read file events and dir events in two batches
- Generate FAN_MODIFY event explicitly with truncate() operation
instead of FAN_ATTRIB event implicitly with create() operation
- FAN_MODIFY and FAN_DELETE_SELF may or may not be merged
- Use macro FAN_MOVE for FAN_MOVED_FROM | FAN_MOVED_TO
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Matthew Bobrowski <mbobrowski@mbobrowski.org>
Acked-by: Jan Kara <jack@suse.cz>
|
|
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
setsockopt(IP_ADDRFORM) is broken in kernel 5.6 which results in test failures.
Add the fix commit hash to test tags and check setsockopt() return value
manually so that the test can print the appropriate hints.
Also improve post-fail cleanup.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Delayed file deletion makes stress testing Btrfs on small block devices
difficult. Each test case would require explicit FS cleanup synchronization.
Drop Btrfs tests from LVM runfile for now.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Add support scripts for LVM tests that can be used with external testing tools.
- generate_lvm_runfile.sh - Creates runtest/lvm.local with testcases for all
locally supported FS types
- prepare_lvm.sh - Creates 2 LVM volume groups and mounts logical volumes
for all locally supported FS types
- cleanup_lvm.sh - remove LVM volume groups created by prepare_lvm.sh and
release the associated loop devices
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
tst_acquire_device__() currently uses a hardcoded filename so only one loop
device can be used at a time. Allow setting arbitrary temp filename so that
multiple different loop devices can be acquired.
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Test its lo_sizelimit field. If lo_sizelimit is 0, it means max
available. If sizelimit is less than loop_size, loopsize will
be truncated.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
|
|
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
|
|
In a setup of mount mark and directory inode mark the FAN_ONDIR flag
set on one mark should not imply that all events in the other mark mask
are expected on directories as well.
Add a regression test case for commit 55bf882c7f13:
fanotify: fix merging marks masks with FAN_ONDIR
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
|
|
This adds support for time64 tests to the existing clock_adjtime()
syscall tests.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
|
|
This case depends on PCL(Portable Coroutine Library), but this library
isn't included in most distributions. This case can't be compile since
2004. This case is hard to maintain and useless, we can remove it.
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Fixes #489
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
|
|
Fixes #491
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Acked-by: Cyril Hrubis <metan@ucw.cz>
|
|
Fixes #594
Signed-off-by: Martin Doucha <mdoucha@suse.cz>
Reviewed-by: Cyril Hrubis <metan@ucw.cz>
|
|
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Sean T Allen <sean@seantallen.com>
|
|
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Li Wang <liwang@redhat.com>
|
|
Merged pipe2_02.c into pipe2_01.c.
Also, add O_DIRECT flag test. This flag was introduced since
commit 9883035ae7ed ("pipes: add a "packetized pipe" mode for writing").
Signed-off-by: Yang Xu <xuyang2018.jy@cn.fujitsu.com>
Signed-off-by: Li Wang <liwang@redhat.com>
|
|
To change the capacity of a pipe was involved from kernel-2.6.35 version.
F_SETPIPE_SZ (int; since Linux 2.6.35)
F_GETPIPE_SZ (void; since Linux 2.6.35)
Signed-off-by: Li Wang <liwang@redhat.com>
|