Repository navigation
Commit 033dc0d
committed
Test applying OCI deltas with the ostree backend
Three tests covering the whole path from a delta on disk to an imported
image, at increasing degrees of realism:
`test_apply_delta_whole_layers` builds a delta whose patches are the
target layers carried verbatim. The format allows that, and the layer
reconstruction dispatches on media type, so this exercises parsing,
validation, source lookup and the import while needing no external
tooling - it runs everywhere.
`test_apply_delta_chunked` and `test_apply_delta_derived` use the real
`oci-delta` to build the delta, and skip themselves when it is not
installed. The first covers an ostree-native image, whose layers are
made of repo objects under `sysroot/ostree/` that do not exist in the
commit's file tree - it passes only because oci-delta is told never to
ask for one. The second covers a derived layer, an ordinary root
filesystem tar, which is the case that actually drives
`OstreeDataSource`; the file it patches lives at `/etc/bigconf`, i.e.
at a path the importer relocates, and the test asserts both that it
lands at `/usr/etc/bigconf` and that the patch is far smaller than the
layer, which it can only be if the content really was read back out of
the source commit.
`oci-delta` goes in a new optional package list, because it is not
available on every distribution we build on.
Assisted-by: AI
Signed-off-by: Alexander Larsson <alexl@redhat.com>1 parent 9d3cb1e commit 033dc0d
5 files changed
Lines changed: 454 additions & 5 deletions
File tree
- contrib/packaging
- crates/lib
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
328 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
329 | 329 | | |
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
0 commit comments