Rebased on top of upstream head commit:
8f21ebba42 LTP 20240524
Update Note:
* This update fixes the following issues (on some releases)
- LP: #2067648 io_control01 in ubuntu_ltp_controllers fails on Noble
- LP: #2023564 cve-2018-13405 / creat09 - test failed on XFS (Setgid bit is set)
- LP: #2023566 openat04 - test failed on EXT2, EXT3, EXT4, BTRFS (Setgid bit is set)
- LP: #2057747 swapon01 - TBROK Test killed on ext2
- LP: #2055536 keyctl05 - TFAIL: unexpected error adding 'dns_resolver' key: EINVAL (22)
- LP: #2045890 fallocate06 - Case 3 in fallocate06 for btrfs (Fill FS: no; Use copy on write: yes) failed with 6.5 PowerPC and 64k ARM64'
* This update is known to have the following issues:
- LP: #2068692 logrotate_sh in commands of ubuntu_ltp_stable failed with "Failed to create a compressed file"
- LP: #2069791 shmat04 from ubuntu_ltp_syscalls failed on M-6.5 (TFAIL: shmid_ds.shm_nattch (1) != 0 (0))
- LP: #2069823 msgstress01 from ubuntu_ltp_syscalls failed with WARNING on ARM64 (TWARN: Out of runtime during forking...)
* This update includes a SAUCE patch for logrotate_sh failure (LP: #2068692)
it has landed upstream and will be merged in the future:
- UBUNTU: SAUCE: logrotate: fix permission issue for test2
* LTP upstream bumps minimum supported kernel to 4.4 since 20240524,
therefore sru-trusty will not be updated.
UBUNTU: SAUCE: logrotate: fix permission issue for test2
When running this logrotate test on Ubuntu, this test will fail with:
logrotate_tests 2 TINFO: sleep 1 min to wait for rotating logs
logrotate_tests 2 TFAIL: [ -f /var/log/tst_largelogfile.1.gz ] failed unexpectedly
logrotate_tests 2 TFAIL: Failed to create a compressed file
Look more closely to what this test is trying to do we will see there
are two issues here in the tst_largelog.conf:
1. "include /etc/logrotate.d"
This will rotate other log files defined here, since we are just testing
the log rotation capability I think there is no need to rotate log files
other than the testfile itself.
2. Permission issue
Trying to rotate the target file on Ubuntu will cause the following error:
error: skipping "/var/log/tst_largelogfile" because parent directory has
insecure permissions (It's world writable or writable by group which
is not "root") Set "su" directive in config file to tell logrotate
which user/group should be used for rotation.
Fix these by removing the extra include, reuse the existing user/group
setting for test1 with setup() as suggested by Petr Vorel.
Link: https://<email address hidden>/
Reviewed-by: Petr Vorel <email address hidden>
Tested-by: Petr Vorel <email address hidden>
Signed-off-by: Po-Hsu Lin <email address hidden>
syscalls/msgstress01: Fix off by one in array access
The size returned from recvmsg() is the size of the payload but the
payload is defined as:
struct {
char len;
char pbytes[99];
} data;
So the lenght of the pbytes is actually one byte shorter than the size
and we access one byte after the array in the comparsion.
Better fix for this would be removal of the len from the data payload
but since we are close to the release lets do the minimal fix now and do
the cleanup after the release.
Make the test exit if runtime has been exhausted before we finished the
requested amount of iterations.
For that to happen we let the main test process to loop while checking
the runtime and set the stop flag if runtime was exhausted. We also need
to separate the stop and fail flag and add counter for finished children.
Also if we exhaust our runtime during the initial fork phase we print a
warning, since we hardly did a meaningful testing in that case.
The changes can be tested with -I parameter, e.g. -I 5 should trigger
the TWARN message and you should be able to get the test to stop in the
message sending phase with larger -I value.
- if queue is full msgsnd() will block in the kernel
- if queue is empty msgrcv() will block in the kernel
And if the other process from the reader-writer pair exits the queue
will be never changed and the test will get stuck and killed by watchdog
timer.
What we need to do is to use IPC_NOWAIT, retry manually (after short
usleep) and handle errors manually as well. In that case no processes
will sleep in kernel and setting the stop flag will actually stop the
test.
Link: https://<email address hidden>/
Acked-by: Andrea Cervesato <email address hidden>
Reviewed-by: Martin Doucha <email address hidden>
Reviewed-by: Petr Vorel <email address hidden>
Signed-off-by: Cyril Hrubis <email address hidden>