aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorbaude <bbaude@redhat.com>2017-11-01 13:59:11 -0500
committerbaude <bbaude@redhat.com>2017-11-01 14:19:19 -0500
commit8cf07b2ad1ed8c6646c48a74e9ecbb2bfeecb322 (patch)
tree625fdeaf51ffced387b4ba2e48d93288f3f1b9b2 /test
parentf5019df3f5da9030ce21e5c8ad3d3921a6585e7f (diff)
downloadpodman-8cf07b2ad1ed8c6646c48a74e9ecbb2bfeecb322.tar.gz
podman-8cf07b2ad1ed8c6646c48a74e9ecbb2bfeecb322.tar.bz2
podman-8cf07b2ad1ed8c6646c48a74e9ecbb2bfeecb322.zip
libpod create and run
patched version of the same code that went into crio Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/helpers.bash2
-rw-r--r--test/kpod_create.bats24
-rw-r--r--test/kpod_run.bats20
3 files changed, 45 insertions, 1 deletions
diff --git a/test/helpers.bash b/test/helpers.bash
index 428336268..dee2193d3 100644
--- a/test/helpers.bash
+++ b/test/helpers.bash
@@ -90,7 +90,7 @@ CRIO_CNI_PLUGIN=${CRIO_CNI_PLUGIN:-/opt/cni/bin/}
POD_CIDR="10.88.0.0/16"
POD_CIDR_MASK="10.88.*.*"
-KPOD_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTIONS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY}"
+KPOD_OPTIONS="--root $TESTDIR/crio $STORAGE_OPTIONS --runroot $TESTDIR/crio-run --runtime ${RUNTIME_BINARY} --conmon ${CONMON_BINARY}"
cp "$CONMON_BINARY" "$TESTDIR/conmon"
diff --git a/test/kpod_create.bats b/test/kpod_create.bats
new file mode 100644
index 000000000..46a460ecd
--- /dev/null
+++ b/test/kpod_create.bats
@@ -0,0 +1,24 @@
+#!/usr/bin/env bats
+
+load helpers
+
+function teardown() {
+ cleanup_test
+}
+
+ALPINE="docker.io/library/alpine:latest"
+
+@test "create a container based on local image" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull docker.io/library/busybox:latest
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} create docker.io/library/busybox:latest ls
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "create a container based on a remote image" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} create ${ALPINE} ls
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
diff --git a/test/kpod_run.bats b/test/kpod_run.bats
new file mode 100644
index 000000000..4945691a7
--- /dev/null
+++ b/test/kpod_run.bats
@@ -0,0 +1,20 @@
+#!/usr/bin/env bats
+
+load helpers
+
+ALPINE="docker.io/library/alpine:latest"
+
+@test "run a container based on local image" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} pull docker.io/library/busybox:latest
+ echo "$output"
+ [ "$status" -eq 0 ]
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} run docker.io/library/busybox:latest ls
+ echo "$output"
+ [ "$status" -eq 0 ]
+}
+
+@test "run a container based on a remote image" {
+ run ${KPOD_BINARY} ${KPOD_OPTIONS} run ${ALPINE} ls
+ echo "$output"
+ [ "$status" -eq 0 ]
+}