diff options
author | Ed Santiago <santiago@redhat.com> | 2019-02-20 13:19:20 -0700 |
---|---|---|
committer | Ed Santiago <santiago@redhat.com> | 2019-03-07 13:09:54 -0700 |
commit | 681eae9bcc856f8dad107765a97c29d0fe093d4a (patch) | |
tree | a8224181c5b01ebfece7e309117b9bc1d4e5a9a0 /test/system/001-basic.bats | |
parent | 1b253cf73a360557196213684cec63b37407ed7c (diff) | |
download | podman-681eae9bcc856f8dad107765a97c29d0fe093d4a.tar.gz podman-681eae9bcc856f8dad107765a97c29d0fe093d4a.tar.bz2 podman-681eae9bcc856f8dad107765a97c29d0fe093d4a.zip |
new system tests under BATS
Initial attempt at writing a framework for podman system tests.
The idea is to define a useful set of primitives that will
make it easy to write actual tests and to interpret results
of failing ones.
This is a proof-of-concept right now; only a small number of
tests, by no means comprehensive. I am requesting review in
order to find showstopper problems: reasons why this approach
cannot work. Should there be none, we can work toward running
these as gating tests for Fedora and RHEL8.
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/001-basic.bats')
-rw-r--r-- | test/system/001-basic.bats | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats new file mode 100644 index 000000000..15d5f38db --- /dev/null +++ b/test/system/001-basic.bats @@ -0,0 +1,38 @@ +#!/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" + + # FIXME: enable for 1.1 +# is "$output" ".*RemoteAPI Version: \+" "API version in output" +} + + +@test "podman can pull an image" { + run_podman pull $PODMAN_TEST_IMAGE_FQN +} + +# 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 $PODMAN_TEST_IMAGE_FQN sleep 90 + echo "*** SHOULD NEVER GET HERE" +} |