33ac181 Use mirrorlist instead of baseurl for updates tests

Authored and Committed by adamwill 6 years ago
    Use mirrorlist instead of baseurl for updates tests
    
    The reason we have all this horrible code to use the commented-
    out baseurl lines in the repo files instead of the metalinks
    that are usually used is a timing issue with the metalink
    system. As a protection against stale mirrors, the metalink
    system sends the package manager a list of mirrors *and a list
    of recent checksums for the repo metadata*. The package manager
    goes out and gets the metadata from the first mirror on the
    list, then checksums it; if the checksum isn't on the list of
    checksums it got from mirrormanager, it assumes that means the
    mirror is stale, and tries the next on the list instead.
    
    The problem is that MM's list of checksums is currently only
    updated once an hour (by a cron job). So we kept running into
    a problem where, when a test ran just after one of the repos
    had been regenerated, the infra mirror it's supposed to use
    would be rejected because the checksum wasn't on the list - but
    not because the mirror was stale, but because it was too fresh,
    it had got the new packages and metadata but mirrormanager's
    list of checksums hadn't been updated to include the checksum
    for the latest metadata.
    
    All this baseurl munging code was getting ridiculous, though,
    what with the tests getting more complicated and errors showing
    up in the actual repo files and stuff. It occurred to me that
    instead of using the baseurl we can just use the 'mirrorlist'
    system instead of 'metalink'. mirrorlist is the dumber, older
    system which just provides the package manager a list of mirrors
    and nothing else - the whole stale-mirror-detection-checksum
    thing does not happen with mirrorlists, the package manager just
    tries all the mirrors in order and uses the first that works.
    And happily, it's very easy to convert the metalink URLs into
    mirrorlist URLs, and it saves all that faffing around trying to
    fix up baseurls.
    
    Also, adjust upgrade_boot to do the s/metalink/mirrorlist/
    substitution, so upgrade tests don't run into the timing issue
    in the steps before the main repo_setup run is done by
    upgrade_run, and adjust repo_setup_compose to sub this line out
    later.
    
    Signed-off-by: Adam Williamson <awilliam@redhat.com>
    
        
file modified
+15 -53
file modified
+3 -0
file modified
+1 -1