-
Notifications
You must be signed in to change notification settings - Fork 807
/
Copy pathregistries.bats
32 lines (26 loc) · 1021 Bytes
/
registries.bats
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bats
load helpers
@test "registries" {
registrypair() {
image1=$1
image2=$2
# Create a container by specifying the image with one name.
run_buildah --retry from --quiet --pull=ifmissing $WITH_POLICY_JSON $image1
cid1=$output
# Create a container by specifying the image with another name.
run_buildah --retry from --quiet --pull=ifmissing $WITH_POLICY_JSON $image2
cid2=$output
# Get their image IDs. They should be the same one.
run_buildah inspect -f "{{.FromImageID}}" $cid1
iid1=$output
run_buildah inspect -f "{{.FromImageID}}" $cid2
expect_output $iid1 "$image2.FromImageID == $image1.FromImageID"
# Clean up.
run_buildah rm -a
run_buildah rmi -a
}
# Test with pairs of short and fully-qualified names that should be the same image.
registrypair busybox docker.io/busybox
registrypair busybox docker.io/library/busybox
registrypair fedora-minimal:32 registry.fedoraproject.org/fedora-minimal:32
}