summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-update-transactions
Commit message (Collapse)AuthorAgeFilesLines
* do not request files if we expect an IMS hitDavid Kalnischkies2015-06-091-6/+18
| | | | | | | | | | If we have a file on disk and the hashes are the same in the new Release file and the old one we have on disk we know that if we ask the server for the file, we will at best get an IMS hit – at worse the server doesn't support this and sends us the (unchanged) file and we have to run all our checks on it again for nothing. So, we can save ourselves (and the servers) some unneeded requests if we figure this out on our own.
* don't try other compressions on hashsum mismatchDavid Kalnischkies2015-06-071-2/+6
| | | | | | | | | If we e.g. fail on hash verification for Packages.xz its highly unlikely that it will be any better with Packages.gz, so we just waste download bandwidth and time. It also causes us always to fallback to the uncompressed Packages file for which the error will finally be reported, which in turn confuses users as the file usually doesn't exist on the mirrors, so a bug in apt is suspected for even trying it…
* detect Releasefile IMS hits even if the server doesn'tDavid Kalnischkies2015-05-131-0/+2
| | | | | | | | | | | Not all servers we are talking to support If-Modified-Since and some are not even sending Last-Modified for us, so in an effort to detect such hits we run a hashsum check on the 'old' compared to the 'new' file, we got the hashes for the 'new' already for "free" from the methods anyway and hence just need to calculated the old ones. This allows us to detect hits even with unsupported servers, which in turn means we benefit from all the new hit behavior also here.
* detect 416 complete file in partial by expected hashDavid Kalnischkies2015-05-121-0/+1
| | | | | | | If we have the expected hashes we can check with them if the file we have in partial we got a 416 for is the expected file. We detected this with same-size before, but not every server sends a good Content-Range header with a 416 response.
* a hit on Release files means the indexes will be hits tooDavid Kalnischkies2015-04-191-0/+7
| | | | | | | | | | | | | | | | | | If we get a IMSHit for the Transaction-Manager (= the InRelease file or as its still supported fallback Release + Release.gpg combo) we can assume that every file we would queue based on this manager, but already have locally is current and hence would get an IMSHit, too. We therefore save us and the server the trouble and skip the queuing in this case. Beside speeding up repetative executions of 'apt-get update' this way we also avoid hitting hashsum errors if the indexes are in fact already updated, but the Release file isn't yet as it is the case on well behaving mirrors as Release files is updated last. The implementation is a bit harder than the theory makes it sound as we still have to keep reverifying the Release files (e.g. to detect now expired once to avoid an attacker being able to silently stale us) and have to handle cases in which the Release file hits, but some indexes aren't present (e.g. user added a new foreign architecture).
* create our cache and lib directory always with mode 755David Kalnischkies2014-11-181-5/+1
| | | | | | | | | | | | | We autocreate for a while now the last two directories in /var/lib/apt/lists (similar for /var/cache/apt/archives) which is very nice for systems having any of those on tmpfs or other non-persistent storage. This also means though that this creation is effected by the default umask, so for people with aggressive umasks like 027 the directories will be created with 750, which means all non-root users are left out, which is usually exactly what we want then this umask is set, but the cache and lib directories contain public knowledge. There isn't any need to protect them from viewers and they render apt completely useless if not readable.
* disable the lock disabling in the testsDavid Kalnischkies2014-11-091-0/+1
| | | | | | | We create our own directories here and work without root in them, so we can also test the locking with them as it is how we usually operate. Git-Dch: Ignore
* check lists/ content in tests doing rollbackDavid Kalnischkies2014-10-201-10/+9
| | | | Git-Dch: Ignore
* autorun permission tests for all apt-get update callsDavid Kalnischkies2014-10-201-5/+0
| | | | | | | | Adds some infrastructure to run tests automatically for certain commands. The first command being 'apt-get update' (and 'apt update') which check for correct permission and owner of the files in lists/. Git-Dch: Ignore
* aborted reverify restores file owner and permissionDavid Kalnischkies2014-10-201-8/+57
| | | | | | | | | | If we get an IMS hit for an InRelease file we use the file we already have and pass it into reverification, but this changes the permissions and on abort of the transaction they weren't switched back. This is now done, additionally, every file in partial which hasn't failed gets permission and owner changed for root access as well, as it is very well possible that the next invocation will (re)use these files.
* Download Release first, then Release.gpgMichael Vogt2014-07-211-0/+1
| | | | | | | The old way of handling this was that pkgAcqMetaIndex was responsible to check/move both Release and Release.gpg in place. This breaks the assumption of the transaction that each pkgAcquire::Item has a single File that its responsible for.
* add pkgAcquire::TransactionHasError()Michael Vogt2014-07-211-0/+23