Commit Graph

278 Commits

Author SHA1 Message Date
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 6effc023fc Oops, replacetest spec missing from dist tarballs
- Should've been in commit 0bbcbb050d
2012-08-24 13:54:25 +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 fb0d4f643a Clean up testroot /opt throughly to avoid other test from affecting us 2012-08-24 12:50:47 +03:00
Panu Matilainen 0936fbc7bb Axe the if-what jungle in rpmfiDecideFateIndex()
- Unless the file does not exist on disk, we cannot determine the
  correct action for config files and symlinks before we actually
  check them. Those are also the only types that *can* result in
  FA_ALTNAME/FA_SAVE action, anything else we can just create.
  Besides making the logic a whole lot easier to follow, it also
  fixes our remaining test-case failures. Who would've thought?
- Might be worth noting that this requires the pile of fsm fixes
  from previous commits to work.
2012-08-23 14:37:52 +03:00
Panu Matilainen 3b44f1dc8b Use fsm->action to decide whether we need a backup or not.
- We already have a carefully precalculated action decided for these
  things, use that instead of bunch of arbitrary (except for osuffix)
  conditions depending on several nasty hacks and hidden assumptions.
  Doing so fixes stuff, who would've thought of that?
- Adjust test-suite expectations
2012-08-23 13:20:57 +03:00
Panu Matilainen d7c3b4aaa0 Simplify the non-modified config file vs directory test
- Replacing a directory with something else is more complicated than
  other cases and deserves tests of its own. For simplicity in
  the config cases, remove the "and back" part of the test, and
  now this test actually succeeds.
2012-08-23 11:58:59 +03:00
Panu Matilainen c4f18ab2de Doh, gotta love it when test-suite expectations are wrong.
- Clearly if we have three cats we should be seeing three outputs as well...
2012-08-23 11:58:52 +03:00
Panu Matilainen a3a08a4b0a Use rpmfiConfigConflictIndex() for modified config testing on erase too
- Besides eliminating another copy-paste variant of the config file
  digest calculation and comparison, this fixes the case modified
  %config symlink gets silently erased. Unlike a regular config file,
  a symlink does not contain a whole lot of carefully tuned data, but
  if it's marked %config I think we should honor the %config file rules.
- Adjust test-suite expectations to match the new behavior.
2012-08-22 11:56:12 +03:00
Panu Matilainen 79f8122f41 Polish the symlink config file comparison a bit
- Similar treatment as in commit 9f9ed70e2d,
  pay more attention to what kind of files we're comparing in each case,
  add a little breathing room and extra comments.
- Handle the case where on-disk link is identical to the one in new
  package in which case no backup will be needed, fixing two cases
  of unwanted backups in the test-suite.
  (similar to commit 7a50e9de80)
- Other than the on-disk vs new package change, probably doesn't change
  anything yet, but prepares us for the next steps.
2012-08-21 15:54:38 +03:00
Panu Matilainen 500782b3d4 Erm, remember to actually enable all the new tests 2012-08-21 13:59:38 +03:00
Panu Matilainen f6cf0a13cd Add a third set of config tests for file type changes testing
- Several (expected) breakages here too, some backups missing, and
  some redundant backups taken
- This is by no means complete set of the possible changes but
  gotta start someplace...
2012-08-21 12:30:04 +03:00
Panu Matilainen 4eca2f8662 Add similar set of %config tests on symlinks
- Several cases are (expectedly) broken here: sometimes backup not
  taken when wanted, sometimes redundant backups taken
2012-08-21 12:28:09 +03:00
Panu Matilainen a838a9ffd6 Prepare config test-suite to cleaning up directories 2012-08-21 12:22:08 +03:00
Panu Matilainen 14116eba5a Further parametrize the config test spec file to allow more cases 2012-08-21 12:21:35 +03:00
Panu Matilainen 3f67160a2e And yet more %config test-cases
- Test behavior when installing over a pre-existing file
- Test behavior on erasure
- Two of the erasure-tests are currently failing due to regression
  introduced in commit 1845c1d711
2012-08-21 08:59:29 +03:00
Panu Matilainen 7a50e9de80 Dont create redundant %config backups when on-disk content is same as new
- When on-disk %config file contents match the contents of the new
  package (such as config in old package was buggy, fixed in new
  and admin worked around in the meantime) there's no point creating
  a backup that's identical to what you already have. Note that
  we create the new config anyway instead of skipping as timestamp
  might have changed.
- Adjust test-cases to the new saner behavior.
2012-08-20 12:42:36 +03:00
Panu Matilainen bfb364563a Dont create %config backups on skipped files
- This cosmetical only, but there's no point creating the same backup
  twice. Depends on commit f7f5f88f9f.
2012-08-20 11:12:05 +03:00
Panu Matilainen abe15e3a62 Test that the %config backup contents are what we expect
- Note we're only checking the contents where backups *should* be
  created, not much point checking buggy behavior.
2012-08-20 11:06:40 +03:00
Panu Matilainen fe62087ac9 Yet more %config test-cases - shared configs have quirks of their own 2012-08-20 10:55:20 +03:00
Panu Matilainen 69850340e6 Add similar set of %config(noreplace) tests
- The first tests are kinda redundant but extra tests never hurt anybody...
2012-08-20 10:24:45 +03:00
Panu Matilainen 2b55fc1a48 Adjust the config test descriptions a bit to make room... 2012-08-20 10:16:10 +03:00
Panu Matilainen 83302bcfcf Add further "parametrization" to our config file test spec
- Currently unused but to allow for testing further cases with the
  same base spec...
2012-08-20 10:04:07 +03:00
Panu Matilainen da65571917 Add a test-case for another %config file special case
- When an existing config file content changes between package versions
  but the file has already been changed to match the content of the
  new version, we still create a backup file that's identical
  to the one that ends up being installed. This is a bug of sorts,
  but documenting the existing behavior before changing it.
2012-08-20 10:02:26 +03:00
Panu Matilainen c7403b0c88 Tighten the existing %config tests a bit
- Test for actual file content
- Also clean up any .rpm[new|save|orig] files from the testroot
2012-08-20 09:49:13 +03:00
Panu Matilainen bf3d65e795 Add a test-case for the shared file timestamp behavior
- Prior to commit f7f5f88f9f, this
  would've failed: removing the last package to be installed would
  cause timestamp failure on all others. The order is arbitrary in
  this testcase but it matters in real-world situations such as
  secondary arch packages.
2012-08-17 14:15:04 +03:00
Panu Matilainen 4e221afaa2 Add test for file verification from originating package 2012-08-07 12:52:29 +03:00
Panu Matilainen 72621fcf32 Add tests for invalid --relocate detection and --badreloc functionality 2012-08-07 10:28:59 +03:00
Panu Matilainen 077db96e9d Add a test-case for various %files manifest globbing scenarios
- In particular (aside from basics working) we're interested in
  the broken symlink behavior: at least glibc and Solaris have
  a weird glob() which doesn't return broken symlinks at all,
  yet we need to be able to package them (and that's why rpm
  carries its own copy of a differently broken, old glibc glob)
- Also test for directory-only match (RhBug:505995 cases)
2012-05-30 13:40:01 +03:00
Panu Matilainen 0920d3339b Add a few basic test-cases for tilde in version comparison 2012-04-23 11:16:04 +03:00
Panu Matilainen 4935f48532 Add further version comparison test-cases
- Add pile of further tests for the more common constructs,
  collect various (old and new) corner cases from bugzilla.
2012-04-21 09:19:02 +03:00
Panu Matilainen bad173ef16 Use a bit more complicated test for the install/remove file verification
- Previous test only used a single file and no package-specific
  directories, now we have multiple files and multiple directories,
  some owned by the package and some not.
- This test fails right now due to previously unnoticed regression
  in commit 1845c1d711
2012-04-17 08:25: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 2685bc0036 Oops, automake isn't happy with comment here... 2012-04-05 16:57:29 +03:00
Panu Matilainen b44b9ea94d Arrange unified /bin <-> $(bindir) in test-suite root
- Rpm traditionally insists on putting itself into /bin and expects
  to find various things, especially /bin/sh there as well. This
  is normally the case, but on systems where the host /bin is symlink
  to eg /usr/bin, the test-suite /bin will be empty except for rpm
  itself causing a big number of bogus test-suite failures. Making
  test-suite root bin/ always a symlink to $(bindir) avoids this issue
  and works whether the host /bin is a real directory or not.
2012-04-05 14:21:27 +03:00
Panu Matilainen 6cc1680082 Fix test-suite root population wrt "optional" directories
- /proc, /sys and especially selinux directories are mostly Linux
  creatures and even those vary between versions. Use if to avoid
  the error code "leaking" in case the last directory is not present.
2012-04-05 13:27:51 +03:00
Panu Matilainen c411382194 Add test case for scriptlet behavior
- The test-root has a shell but rpm doesn't know about it, add a
  fakeshell metapackage that provides it. Should come in handy for
  other cases as well, up to now we've been limited to lua scripts only.
- Test that all the "normal" scripts get executed, in expected order
  and with expected arguments, on install, upgrade and erase.
- This would've saved the rather embarrassing breakage with commit
  274dbf557d at least, but better
  late than never as they say... It also serves to highlight and
  document  the arguably broken arguments to %pre- and %posttrans
  scripts (ie always 0)
2012-03-21 10:10:07 +02:00
Panu Matilainen 4e207bfdfc Unbreak rpm -V output (RhBug:797964)
- Commit ac0ab016a5 unintentionally
  changed the order of the problems shown in verify strings due to
  a dumb oversight (greetings to self, duh). In other words, this
  fixes a verify output regression in rpm >= 4.9.x by restoring
  the long-standing (and documented) order of the verify output chars.
- Also fix the testcase which unfortunately was only added after
  the output-changing commit so it didn't catch the breakage either :-/
2012-02-28 10:36:10 +02:00
Panu Matilainen 2a4333c18e Add a testcase for tag extension bad file name triplet detection 2012-02-21 16:56:48 +02:00
Panu Matilainen da0091cfc7 Also test that total size is calculated correctly wrt hardlinks 2012-02-09 14:16:29 +02:00
Panu Matilainen dd5771bbd6 Add a rough-cut testcase for hardlink handling
- Check that we get expected number of links in package generation,
  that all the files got installed and that the linked files are
  actually hardlinks (for our purposes, plain inode suffices)
2012-02-08 17:58:14 +02:00
Panu Matilainen f258e6089a Add tag extension to calculate hardlink count for files 2012-02-08 15:40:02 +02:00
Panu Matilainen 79bfdd7e9c Add a basic testcase for bogus filename triplet detection 2012-01-28 18:13:01 +02:00
Panu Matilainen 5e4fb2589c Add a basic testcase for bogus (incomplete) header detection 2012-01-28 15:54:40 +02:00
Panu Matilainen 9349705525 Add bunch of links to test-suite chroot to allow selinux to work
- With the new warning on failure to open selinux labels from
  commit 7a8b75d266, the test-suite
  fails on large number of tests due to the extra output. This
  takes care of these false alarms on F16 at least.
- Recent selinux wants /etc/selinux and /sys (for /sys/fs/selinux),
  older ones would want /selinux. Add in /proc for good measure,
  selinux doesn't need it butit wont hurt either, other things will
  want it sooner or later.
2012-01-13 08:04:00 +02:00
Ales Kozumplik f6baacaa07 Do not attempt running the test suite without fakechroot (ticket #851).
Partially resolves ticket #851.
2011-11-16 09:32:07 +01:00
Panu Matilainen f0d7459e51 Avoid XZ dependency in test-suite
- The two "hello" binaries packages used for various multilib checks were
  accidentally using xz payload compression, causing test-suite to
  fail when rpm was configured without xz support. Rebuild them with gzip
  compression instead to avoid silly failures - gzip compression
  support is mandatory, xz is not.
2011-11-14 10:36:57 +02:00