summaryrefslogtreecommitdiff
path: root/test/kpod_pull.bats
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2017-11-01 11:24:59 -0400
committerMatthew Heon <matthew.heon@gmail.com>2017-11-01 11:24:59 -0400
commita031b83a09a8628435317a03f199cdc18b78262f (patch)
treebc017a96769ce6de33745b8b0b1304ccf38e9df0 /test/kpod_pull.bats
parent2b74391cd5281f6fdf391ff8ad50fd1490f6bf89 (diff)
downloadpodman-a031b83a09a8628435317a03f199cdc18b78262f.tar.gz
podman-a031b83a09a8628435317a03f199cdc18b78262f.tar.bz2
podman-a031b83a09a8628435317a03f199cdc18b78262f.zip
Initial checkin from CRI-O repo
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'test/kpod_pull.bats')
-rw-r--r--test/kpod_pull.bats138
1 files changed, 138 insertions, 0 deletions
diff --git a/test/kpod_pull.bats b/test/kpod_pull.bats
new file mode 100644
index 000000000..c12c62413
--- /dev/null
+++ b/test/kpod_pull.bats
@@ -0,0 +1,138 @@
+#!/usr/bin/env bats
+
+load helpers
+
+IMAGE="alpine:latest"
+
+function teardown() {
+ cleanup_test
+}
+
+@test "kpod pull from docker with tag" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull debian:6.0.10
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi debian:6.0.10
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from docker without tag" {
+ run ${KPOD_BINARY} $KPOD_OPTIONS pull debian
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi debian
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from a non-docker registry with tag" {
+ run ${KPOD_BINARY} $KPOD_OPTIONS pull registry.fedoraproject.org/fedora:rawhide
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi registry.fedoraproject.org/fedora:rawhide
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from a non-docker registry without tag" {
+ run ${KPOD_BINARY} $KPOD_OPTIONS pull registry.fedoraproject.org/fedora
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi registry.fedoraproject.org/fedora
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull using digest" {
+ run ${KPOD_BINARY} $KPOD_OPTIONS pull alpine@sha256:1072e499f3f655a032e88542330cf75b02e7bdf673278f701d7ba61629ee3ebe
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi alpine:latest
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from a non existent image" {
+ run ${KPOD_BINARY} $KPOD_OPTIONS pull umohnani/get-started
+ echo "$output"
+ [ "$status" -ne 0 ]
+}
+
+@test "kpod pull from docker with shortname" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull debian
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi docker.io/debian:latest
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from docker with shortname and tag" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull debian:6.0.10
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} $KPOD_OPTIONS rmi docker.io/debian:6.0.10
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "kpod pull from docker-archive" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} save -o alp.tar alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull docker-archive:alp.tar
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ rm -f alp.tar
+}
+
+@test "kpod pull from oci-archive" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} save --format oci-archive -o oci-alp.tar alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull oci-archive:oci-alp.tar
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ rm -f oci-alp.tar
+}
+
+@test "kpod pull from local directory" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run mkdir test_pull_dir
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} push alpine dir:test_pull_dir
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi alpine
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull dir:test_pull_dir
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} rmi test_pull_dir
+ echo "$output"
+ [ "$status" -eq 0 ]
+ rm -rf test_pull_dir
+}