Commit Graph

9 Commits

Author SHA1 Message Date
Michal Domonkos 826cbb8869 Fix -V option usage in our tests
Coupling -V with -a when querying for specific packages makes little
sense and only causes the order of the output lines to depend on the
database ordering.

This is known to vary between the ndb and sqlite backends in particular,
confusing some of the tests that expect the lines to be in a specific
order.

While at it, fix all such questionable usages, even those that only
entail one package argument.

Fixes: #3242
2024-08-21 17:05:50 +03:00
Panu Matilainen 7d3d9041af Fix sbit removal if fchmodat() doesn't support AT_SYMLINK_NOFOLLOW
glibc versions prior to 2020 know about AT_SYMLINK_NOFOLLOW but don't
actually implement it for fchmodat() and returns ENOSYS when used.
We don't check the return code in removeSBITS() so this silently fails
on those older versions.

We already verify the thing is not a link in the fstatat() condition
because cap_set_fileat() doesn't have any "dont follow" mode at all,
so we can just as well drop it from the fchmodat() and make this
work on more libc versions.

Add a test for the suid bit removal while at it.
2023-11-10 11:25:43 +02:00
Michal Domonkos adafe8d047 Replace AT_CHECK and AT_CLEANUP with RPMTEST_*
We're going to do some stuff before and after these macros in the next
commits/PRs so better do this beforehand.
2023-07-05 13:41:03 +03:00
Panu Matilainen 6ee7cec81c Add test for colored file upgrade/reinstall
One of the situations which commit a7ceb572cf
did not cover proved out to be lethal...
2022-04-25 12:54:12 +03:00
Panu Matilainen 066c00c908 Revert "Fix shared colored files not removed on erasure regression in >= 4.14.0"
This causes a worse regression by removing files on update, revert
for further investigation.

This reverts commit 9e4caf0fc5.
2022-04-25 12:50:31 +03:00
Panu Matilainen 9e4caf0fc5 Fix shared colored files not removed on erasure regression in >= 4.14.0
Commit 2d52726bd5 was not SUPPOSED to
change any behavior, but it did: "shared" colored files (ie one being
wrong color and the other one actually installed) removed in the
same transaction would not get removed at all. Fix the embarrasment
that happens when you don't have systematic tests.

Fixes: #1800
2022-03-28 10:43:36 +03:00
Panu Matilainen 0bb3fa9025 Fix excluded paths taking part in file disposition calculations
Commit f311fb65ee added a step to reset
calculated states between rpmtsRun() calls to allow for %pretrans
hacks, but this causes actions set for --excludepath to get lost.
While those do get recalculated at the time of actual install and
correctly skipped, this causes them to be considered for file
disposition which they should not.
2022-03-28 10:43:36 +03:00
Panu Matilainen cf2752b05c Fix non-installed files taking part in file disposition calculations
Files that are not installed cannot conflict with anything, any more
than skipped files can. The latter we handled, the former not. Strange
what "obvious" cases can go on unnoticed forever, when lacking systematic
tests.
2022-03-28 10:43:36 +03:00
Panu Matilainen a7ceb572cf Add a bunch of file-erasure related testcases
Replace the two very basic file erase tests from "rpmdb" group with a more
elaborate set of tests in their own file. Some embarrassing failures
here, eg "shared" colored files getting left behind on erase. Oops.
2022-03-28 10:43:36 +03:00