summaryrefslogtreecommitdiff
path: root/test/integration/test-snapshot
Commit message (Collapse)AuthorAgeFilesLines
* Parse snapshot option for apt show/listDavid Kalnischkies2024-07-081-7/+12
| | | | | | | | | | | | | The option is supported by the command (as this is done by a bit more low level code), but the command line parsing did not expect them to be used for the apt show & list command, so that it would report error. As such, a workaround for this issue is to use: -o APT::Snapshot=BANANA instead of e.g. -S BANANA Closes: #1075819
* test-snapshot: Add test case for automatic snapshotJulian Andres Klode2024-02-201-6/+32
| | | | | | 1. repository not supporting snapshots, implicit Enabled 2. repository not supporting snapshots, Enabled: yes 3. URL-based lookup, implicit Enabled
* test-snapshot: Fix a test caseJulian Andres Klode2024-02-201-1/+1
| | | | | | This was accidentally using testfailure instead of testfailureequal, hence trying to run the output string as a command :(
* Automatically enable snapshots where supportedJulian Andres Klode2024-02-201-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | Convert sources.list Snapshot option from opt-in to automatic. If we can find a snapshot server, Snapshot: yes is assumed if a snapshot is specified. On the implementation side, we record automatic snapshot enablement by adding a '?' suffix to the snapshot timestamp, if any is specified, this avoids introducing bugs into the code where we could end up with an empty snapshot. This has an annoying internal implementation caveat: Since we call GetDebReleaseIndexBy() with the SHADOWED option emplaced, if we do not find a server, we need to remove the SHADOWED option again, but we already have inserted a shadowed release index into the list. This will simply insert the release index a second time without the SHADOWED option which in preliminary testing works fine, but it would arguably be more correct to also remove the release index again if we have created it. FIXME: This only has one test case: A source with supported snapshot server is auto-discovered. We should also add a test case where we cannot detect a server and then don't fail in automatic mode.
* Ensure that Snapshots: no doesn't get overriden by host-name configJulian Andres Klode2023-05-241-0/+4
|
* Seed snapshot servers for well-known hostsJulian Andres Klode2023-05-241-1/+110
| | | | | This will attempt to fallback to a per-server setting if we could not determine a value from the release file.
* Initial support for snapshot servers, apt --snapshot optionJulian Andres Klode2023-05-021-0/+191
Provide snapshot support for offical Debian and Ubuntu archives. There are two ways to enable snapshots for sources: 1. Add Snapshot: yes to your sources file ([snapshot=yes]). This will allow you to specify a snapshot to use when updating or installing using the --snapshot,-S option. 2. Add Snapshot: ID to your sources files to request a specific snapshot for this source. Snapshots are discovered using Label and Origin fields in the Release file of the main source, hence you need to have updated the source at least once before you can use snapshots. The Release file may also declare a snapshots server to use, similar to Changelogs, it can contain a Snapshots field with the values: 1. `Snapshots: https://example.com/@SNAPSHOTID@` where `@SNAPSHOTID@` is a placeholder that is replaced with the requested snapshot id 2. `Snapshots: no` to disable snapshot support for this source. Requesting snapshots for this source will result in a failure to load the source. The implementation adds a SHADOWED option to deb source entries, and marks the main entry as SHADOWED when a snapshot has been requested, which will cause it to be updated, but not included in the generated cache. The concern here was that we need to keep generating the shadowed entries because the cleanup in `apt update` deletes any files not queued for download, so we gotta keep downloading the main source. This design is not entirely optimal, but avoids the pitfalls of having to reimplement list cleanup. Gaps: - Ubuntu Pro repositories and PPAs are not yet supported.