Skip to content

Commit 3070eed

Browse files
committed
added int tests for copy and store copy
1 parent 00f1ccf commit 3070eed

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

.github/workflows/tests.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,43 @@ jobs:
216216
- name: Verify - hauler store copy
217217
run: |
218218
hauler store copy --help
219-
# need more tests here
219+
# verify via registry target
220+
hauler store serve registry --port 5002 --readonly=false &
221+
until curl -sf http://localhost:5002/v2/_catalog; do : ; done
222+
hauler store copy registry://localhost:5002 --plain-http
223+
# verify blobs actually landed in the registry backend
224+
[ $(find registry -type f | wc -l) -gt 0 ]
225+
# verify --only is accepted (a registry seeded fresh at startup from the
226+
# whole store can't prove exclusion here -- registry-side filtering is
227+
# covered by --only's own unit tests)
228+
hauler store copy registry://localhost:5002 --plain-http --only busybox
229+
pkill -f "hauler store serve registry --port 5002"
230+
rm -rf registry
231+
# verify via directory target (files and charts only; images and cosign artifacts are skipped)
232+
hauler store copy dir://./store-copy-output
233+
test -f ./store-copy-output/hauler-manifest.yaml
234+
rm -rf ./store-copy-output
235+
236+
- name: Verify - hauler copy
237+
run: |
238+
hauler copy --help
239+
# source registry (seeded from the store, which already has busybox)
240+
hauler store serve registry --port 5004 --readonly=false --directory registry-src &
241+
until curl -sf http://localhost:5004/v2/_catalog; do : ; done
242+
# destination registry
243+
hauler store serve registry --port 5005 --readonly=false --directory registry-dst &
244+
until curl -sf http://localhost:5005/v2/_catalog; do : ; done
245+
# verify a direct registry-to-registry copy, bypassing the store
246+
# (destination path is deliberately distinct from anything the destination
247+
# registry auto-seeded at startup, so its presence proves the copy, not the seed)
248+
hauler copy localhost:5004/hauler-dev/library/busybox:latest localhost:5005/mycopy/busybox:latest --plain-http
249+
test -d registry-dst/docker/registry/v2/repositories/mycopy/busybox
250+
# verify --platform copies a single platform out of the index
251+
hauler copy localhost:5004/hauler-dev/library/busybox:latest localhost:5005/mycopy/busybox-platform:amd64 --plain-http --platform linux/amd64
252+
test -d registry-dst/docker/registry/v2/repositories/mycopy/busybox-platform
253+
pkill -f "hauler store serve registry --port 5004"
254+
pkill -f "hauler store serve registry --port 5005"
255+
rm -rf registry-src registry-dst
220256
221257
- name: Verify - hauler store extract
222258
run: |

0 commit comments

Comments
 (0)