- 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.
- 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.
- 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
- 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.
- 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.
- 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.
- 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...
- 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
- 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.
- 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.
- 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.
- 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)
- 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
- 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.
- 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.
- /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.
- 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)
- 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 :-/
- 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)
- 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.
- 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.