File: tag.bats

package info (click to toggle)
golang-github-containers-buildah 1.19.6%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,020 kB
  • sloc: sh: 1,957; makefile: 199; perl: 173; awk: 12; ansic: 1
file content (30 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download
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
#!/usr/bin/env bats

load helpers

@test "tag by name" {
  run_buildah from --pull=false --signature-policy ${TESTSDIR}/policy.json scratch
  cid=$output
  run_buildah commit --signature-policy ${TESTSDIR}/policy.json "$cid" scratch-image
  run_buildah 125 inspect --type image tagged-image
  run_buildah tag scratch-image tagged-image tagged-also-image named-image
  run_buildah inspect --type image tagged-image
  run_buildah inspect --type image tagged-also-image
  run_buildah inspect --type image named-image
}

@test "tag by id" {
  _prefetch busybox
  run_buildah pull --quiet --signature-policy ${TESTSDIR}/policy.json busybox
  id=$output

  # Tag by ID, then make a container from that tag
  run_buildah tag $id busybox1
  run_buildah from busybox1            # gives us busybox1-working-container

  # The from-name should be busybox1, but ID should be same as pulled image
  run_buildah inspect --format '{{ .FromImage }}' busybox1-working-container
  expect_output "localhost/busybox1:latest"
  run_buildah inspect --format '{{ .FromImageID }}' busybox1-working-container
  expect_output $id
}