Various file conflict and upgrade/downgrade tests rely on packages
built in a previous testcase, which is broken. Merge these into
groups that consist of multiple individual cases.
Fakechroot returns -ENOENT for such paths:
$ FAKECHROOT_BASE=$PWD/tests/testing fakechroot ls /not_an.rpm
/not_an.rpm
$ FAKECHROOT_BASE=$PWD/tests/testing fakechroot ls $PWD/not_an.rpm
ls: cannot access /home/mmarek/GIT/rpm/not_an.rpm: No such file or directory
Signed-off-by: Michal Marek <mmarek@suse.com>
- Three-way tests for explicit (aka manually added) file conflicts:
conflict within added set, and conflict in transaction <-> database.
- The problem message rpm creates for the third case is pretty bad,
it misses the fact its on an installed package and gets the name
wrong too. Better than not detecting though, and the message has
been broken for a long time so not related to the recent other
changes.
- Further parametrize conflicttest.spec to allow for different attributes
- Verify that the real file gets created without conflicts, that
it doesn't get removed when ghost is removed and gets normally removed
on erase.
- This is the case commit a712252392 was
supposed to fix (which it does but with, ahem, "slight" side-effects)
- Also test for the cases where packages are installed in different
transactions, the outcome should be exactly the same in every case
regardless of the order.
- Change the expected output to something slightly more readable for
us humans
- Rpm cannot currently *correctly* deal with directory symlink changing
to a directory through updates, detect early and abort with conflicts
instead of proceeding with known-broken results: previously these
would seemingly succeed but without actually doing the requested
changes, and leaving orphans on the disk. Far less evil than the
directory replacement failure but incorrect anyway.
- Same %pretrans wackiness as with directory replacements applies here.
- Adjust test-suite to match the new behavior.
- It's possible there are packages that have been relying on the former
broken "success" results, so this might need further fine-tuning...
- Rpm cannot currently deal with directory changing to something else
through upgrades. Until now we've barfed up an ugly error in the
middle of transaction, leaving partially installed broken junk behind.
It'd sure be nice to be able to actually handle this some day, but
until then detecting and aborting early is a far better option than
the former behavior.
- There are some "only in rpm" level bizarre quirks here: packages
can work around this limitation by using a %pretrans scriptlet,
which runs before the conflict detection. But this means a possible
test-transaction (as done by eg yum) will still see the conflicts,
as we obviously dont want to run disk-modifying scripts on
test-transaction. So when looking at these removal conflicts, we filter
them out on test-transaction IFF the package has a %pretrans script
so there's a chance it might actually fix the conflict when we get
to it in a real transaction. Obviously %pretrans from any package
could in theory fix such issues, but as this is evil enough as it is,
try to limit the damage... Without %pretrans, the only other option
to get around these is manual intervention.
- Of particular interest is directory changing to something else
(including the infamous symlink case), which we miserably fail
currently. Until we can somehow manage them someday, we should
abort early (by conflicts) instead of barfing up garbage in
middle of transaction.
- One test for the normal situation where identical basenames are
not a problem, and another one where this causes a self-conflict
because of a directory symlink.
- Add colored binary packages (as there's no guarantee we can build
them from test-suite), test that colored conflicts get resolved
to preferred color.
- Except for four rpmbuild tests which rely on an actual compiler
being available (faking *that* would get entertaining...), the entire
test-suite is now executing everything in the fakechroot environment.
- handle failed element in rpmteOpen() already, avoiding need to check
everywhere else
- elements cancelled due to parent failure can further cancel their
dependent elements
- all failed, including skipped, elements are now logged