Commit Graph

24 Commits

Author SHA1 Message Date
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 a2c346b3cd Remove now redundant TOPDIR removals from tests
No longer needed as each test gets its own environment.
Lots of similar cleanup possible, but one thing at a time...
2020-06-12 13:18:56 +03:00
Panu Matilainen b0d656ae8e Run tests sharing built material as groups
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.
2020-06-12 13:18:56 +03:00
Panu Matilainen b13a81d02a Merge RPMDB_CLEAR into RPMDB_INIT, they're never used separately
If we need to init, we need an empty database. Having these separate
is a historical artifact from the early days of the test-suite.
2020-06-12 13:18:56 +03:00
Florian Festi 394cbfb668 tests: Do not pass real pathnames to fakechroot commands
for the remaining tests.
Also add a Provides: /bin/sh to one of the specs as the test does no longer
works without for some unknown reason.
2016-08-29 18:12:42 +02:00
Michal Marek 5b8b2bdd32 tests: Do not pass real pathnames to fakechroot commands
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>
2016-08-29 16:21:15 +02:00
Panu Matilainen 909aab0916 Add test-case for explicit file conflict variants
- 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.
2013-03-20 12:50:48 +02:00
Panu Matilainen 0485eab2c9 Add testcase for %ghost shared with a real file
- 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)
2013-01-30 14:01:07 +02:00
Panu Matilainen c694721ecc Add further multilib resolution test-cases
- 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
2012-08-29 14:27:39 +03:00
Panu Matilainen ff8d3e9c8f Tweak the conflict test descriptions a bit 2012-08-29 14:27:34 +03:00
Panu Matilainen a7a06ec88f Detect attempts to replace directory symlink to directory in package
- 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...
2012-08-24 13:36:52 +03:00
Panu Matilainen 00d82f1322 Detect attempts to replace directories and report as conflicts
- 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.
2012-08-24 13:02:09 +03:00
Panu Matilainen 0bbcbb050d Add pile of new test-cases for file type changes in upgrades
- 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.
2012-08-24 12:51:26 +03:00
Panu Matilainen df475ec90c Add test-cases for identical basenames within package
- 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.
2012-04-16 14:14:37 +03:00
Panu Matilainen a925a16f5b Add test-cases for three RhBug:705115 scenarios 2011-05-26 14:24:46 +03:00
Panu Matilainen b40fe69c3b Add two basic multilib conflict resolution tests
- 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.
2011-05-26 14:18:09 +03:00
Panu Matilainen aea6f0423f Execute all non-compilation rpmbuild tests in fakechroot
- 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.
2011-04-04 14:05:17 +03:00
Panu Matilainen f5b288fef6 Explicitly initialize the test-root database always
- Otherwise various places will be emitting "generating xx missing indexes"
  warnings, we dont want that noise in the test-suite results
2011-04-01 17:43:13 +03:00
Panu Matilainen 1b78ed281b Improve failed transaction element behavior + logging
- 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
2010-02-25 12:38:22 +02:00
Panu Matilainen fde84f901c Log all install/erase failures in rpmtsProcess() 2010-02-25 10:58:09 +02:00
Panu Matilainen 4662e50781 Add couple of tests for symlink <-> directory behavior 2008-11-24 13:33:41 +02:00
Panu Matilainen 53b14ecfea Add keywords to all tests
- just initial groupings to have something there..
2008-11-22 14:07:34 +02:00
Panu Matilainen 4ba4e709ef Add banners for nicer test output 2008-11-22 13:26:43 +02:00
Panu Matilainen 9844bfc9b7 Add some basic tests for file conflict behavior 2008-11-21 23:59:25 +02:00