0999921 Tweak detection of installed update packages

Authored and Committed by adamwill 3 years ago
1 file changed. 7 lines added. 6 lines removed.
    Tweak detection of installed update packages
    
    Previously we were relying on `rpm -q` always outputting the
    right package last. We saw some test failures on recent kernel
    updates, e.g. https://openqa.fedoraproject.org/tests/658768 ,
    which indicate this isn't always the case; there the 'right'
    package was second of three for kernel, third of three for
    kernel-core and first of three for kernel-modules. So we need to
    make it more robust. This uses an additional call:
    `rpm -q $pkg --last | head -1` to find the most recent package,
    if there are more than one; this should always be the right one,
    I hope. Note we cannot just add `--last` to the `rpm -q --qf...`
    call because the output when you do that is weird; you get the
    output you'd get if you just called `rpm -q --last` first, and
    *then* the query-formatted output afterwards (though with the
    modified order as expected). There doesn't seem to be any way to
    get only the latter.
    
    I also tweaked the log uploading so we always upload the working
    logs even when the test passes; it can't hurt anything and it is
    sometimes useful to have them.
    
    Signed-off-by: Adam Williamson <awilliam@redhat.com>
    
        
file modified
+7 -6