diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-03-07 15:23:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-07 15:23:54 -0800 |
commit | 1b2f8679b864b882fdccaad6fdd6a5c86c83291b (patch) | |
tree | e131eaf7fbecf6c36ca6f21468cef6bd8ebac4cd /test/system/001-basic.bats | |
parent | e0f224816d41ccf353bccd9ef6933a201cdc7d64 (diff) | |
parent | 589248d2f359dea73fc763ac587e2927f005b300 (diff) | |
download | podman-1b2f8679b864b882fdccaad6fdd6a5c86c83291b.tar.gz podman-1b2f8679b864b882fdccaad6fdd6a5c86c83291b.tar.bz2 podman-1b2f8679b864b882fdccaad6fdd6a5c86c83291b.zip |
Merge pull request #2533 from edsantiago/bats
New system tests under BATS
Diffstat (limited to 'test/system/001-basic.bats')
-rw-r--r-- | test/system/001-basic.bats | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats new file mode 100644 index 000000000..85b9bc1ca --- /dev/null +++ b/test/system/001-basic.bats @@ -0,0 +1,50 @@ +#!/usr/bin/env bats +# +# Simplest set of podman tests. If any of these fail, we have serious problems. +# + +load helpers + +# Override standard setup! We don't yet trust podman-images or podman-rm +function setup() { + : +} + +@test "podman version emits reasonable output" { + run_podman version + + is "${lines[0]}" "Version:[ ]\+[1-9][0-9.]\+" "Version line 1" + is "$output" ".*Go Version: \+" "'Go Version' in output" + is "$output" ".*RemoteAPI Version: \+" "API version in output" +} + + +@test "podman can pull an image" { + run_podman pull $IMAGE +} + +# This is for development only; it's intended to make sure our timeout +# in run_podman continues to work. This test should never run in production +# because it will, by definition, fail. +@test "timeout" { + if [ -z "$PODMAN_RUN_TIMEOUT_TEST" ]; then + skip "define \$PODMAN_RUN_TIMEOUT_TEST to enable this test" + fi + PODMAN_TIMEOUT=10 run_podman run $IMAGE sleep 90 + echo "*** SHOULD NEVER GET HERE" +} + + +# Too many tests rely on jq for parsing JSON. +# +# If absolutely necessary, one could establish a convention such as +# defining PODMAN_TEST_SKIP_JQ=1 and adding a skip_if_no_jq() helper. +# For now, let's assume this is not absolutely necessary. +@test "jq is installed and produces reasonable output" { + type -path jq >/dev/null || die "FATAL: 'jq' tool not found." + + run jq -r .a.b < <(echo '{ "a": { "b" : "you found me" } }') + is "$output" "you found me" "sample invocation of 'jq'" +} + +# vim: filetype=sh |