summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2018-01-05 08:37:51 -0600
committerAtomic Bot <atomic-devel@projectatomic.io>2018-01-08 15:44:49 +0000
commitd0fb2e48e5d8ea47332b0a9608129ab268338c7e (patch)
tree4a45cb3439a9d0a96be0924fa37aa91c441be67b /test
parente2616d9acf21e101bab5ca7850c3f2b544acfe96 (diff)
downloadpodman-d0fb2e48e5d8ea47332b0a9608129ab268338c7e.tar.gz
podman-d0fb2e48e5d8ea47332b0a9608129ab268338c7e.tar.bz2
podman-d0fb2e48e5d8ea47332b0a9608129ab268338c7e.zip
Don't pull cached images
In our tests, each test instance is already seeded with images. In that case, we do not need to pull down an image that is already seeded. Signed-off-by: baude <bbaude@redhat.com> Closes: #191 Approved by: baude
Diffstat (limited to 'test')
-rw-r--r--test/podman_images.bats23
-rw-r--r--test/podman_run.bats3
-rw-r--r--test/podman_run_ns.bats6
-rw-r--r--test/podman_tag.bats21
4 files changed, 13 insertions, 40 deletions
diff --git a/test/podman_images.bats b/test/podman_images.bats
index b500f6b98..3ea8af793 100644
--- a/test/podman_images.bats
+++ b/test/podman_images.bats
@@ -2,43 +2,32 @@
load helpers
-IMAGE="busybox"
-
function teardown() {
cleanup_test
}
+function setup() {
+ copy_images
+}
@test "podman images" {
- run bash -c ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${IMAGE}
- echo "$output"
- [ "$status" -eq 0 ]
run bash -c ${PODMAN_BINARY} ${PODMAN_OPTIONS} images
echo "$output"
[ "$status" -eq 0 ]
- run bash -c ${PODMAN_BINARY} ${PODMAN_OPTIONS} rmi ${IMAGE}
- echo "$output"
- [ "$status" -eq 0 ]
}
@test "podman images test valid json" {
- ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${IMAGE}
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} images --format json
echo "$output" | python -m json.tool
[ "$status" -eq 0 ]
- run bash -c ${PODMAN_BINARY} ${PODMAN_OPTIONS} rmi ${IMAGE}
- echo "$output"
- [ "$status" -eq 0 ]
}
@test "podman images check name json output" {
- ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${IMAGE}
+ ${PODMAN_BINARY} ${PODMAN_OPTIONS} rmi -fa
+ ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${ALPINE}
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} images --format json
[ "$status" -eq 0 ]
name=$(echo $output | python -c 'import sys; import json; print(json.loads(sys.stdin.read())[0])["names"][0]')
- [ "$name" == "docker.io/library/${IMAGE}:latest" ]
- run bash -c ${PODMAN_BINARY} ${PODMAN_OPTIONS} rmi ${IMAGE}
- echo "$output"
- [ "$status" -eq 0 ]
+ [ "$name" == "docker.io/library/alpine:latest" ]
}
@test "podman images short options" {
diff --git a/test/podman_run.bats b/test/podman_run.bats
index 46b136fee..6ffc47ef3 100644
--- a/test/podman_run.bats
+++ b/test/podman_run.bats
@@ -101,9 +101,6 @@ function setup() {
IMAGE="docker.io/library/fedora:latest"
@test "run limits test" {
-
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${IMAGE}"
-
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run --ulimit rtprio=99 --cap-add=sys_nice ${IMAGE} cat /proc/self/sched"
echo $output
[ "$status" -eq 0 ]
diff --git a/test/podman_run_ns.bats b/test/podman_run_ns.bats
index 0d6e645c0..8ed710394 100644
--- a/test/podman_run_ns.bats
+++ b/test/podman_run_ns.bats
@@ -11,9 +11,6 @@ function setup() {
}
@test "run pidns test" {
-
- ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${ALPINE}
-
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} run ${ALPINE} sh -c 'echo \$\$'"
echo $output
[ "$status" -eq 0 ]
@@ -32,9 +29,6 @@ function setup() {
}
@test "run ipcns test" {
-
- ${PODMAN_BINARY} ${PODMAN_OPTIONS} pull ${ALPINE}
-
tmp=$(mktemp /dev/shm/foo.XXXXX)
run ${PODMAN_BINARY} ${PODMAN_OPTIONS} run --ipc=host ${ALPINE} ls $tmp
echo $output
diff --git a/test/podman_tag.bats b/test/podman_tag.bats
index 79a7f5638..024cf6295 100644
--- a/test/podman_tag.bats
+++ b/test/podman_tag.bats
@@ -2,17 +2,16 @@
load helpers
-IMAGE="alpine:latest"
-
function teardown() {
cleanup_test
}
+function setup() {
+ copy_images
+}
+
@test "podman tag with shortname:latest" {
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} pull $IMAGE"
- echo "$output"
- [ "$status" -eq 0 ]
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag $IMAGE foobar:latest"
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag ${ALPINE} foobar:latest"
[ "$status" -eq 0 ]
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} inspect foobar:latest"
echo "$output"
@@ -22,10 +21,7 @@ function teardown() {
}
@test "podman tag with shortname" {
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} pull $IMAGE"
- echo "$output"
- [ "$status" -eq 0 ]
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag $IMAGE foobar"
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag ${ALPINE} foobar"
echo "$output"
[ "$status" -eq 0 ]
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} inspect foobar:latest"
@@ -36,10 +32,7 @@ function teardown() {
}
@test "podman tag with shortname:tag" {
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} pull $IMAGE"
- echo "$output"
- [ "$status" -eq 0 ]
- run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag $IMAGE foobar:v"
+ run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} tag ${ALPINE} foobar:v"
echo "$output"
[ "$status" -eq 0 ]
run bash -c "${PODMAN_BINARY} ${PODMAN_OPTIONS} inspect foobar:v"