summaryrefslogtreecommitdiff
path: root/test/system/001-basic.bats
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2019-03-05 09:58:30 -0700
committerEd Santiago <santiago@redhat.com>2019-03-07 14:09:00 -0700
commit589248d2f359dea73fc763ac587e2927f005b300 (patch)
tree089364b57364c0d77d1afac4d0193915a221371a /test/system/001-basic.bats
parent681eae9bcc856f8dad107765a97c29d0fe093d4a (diff)
downloadpodman-589248d2f359dea73fc763ac587e2927f005b300.tar.gz
podman-589248d2f359dea73fc763ac587e2927f005b300.tar.bz2
podman-589248d2f359dea73fc763ac587e2927f005b300.zip
Implement review feedback
- document a recommended convention for fail-fast tests - document the requirement for jq. (And, add a fail-fast test for its presence; remove the duplicated checks in subtests) - add further sanity checks to 'help' test. Add missing documentation. Remove a no-longer-needed workaround for usage-message bug fixed in #2486 - add a documented TEMPLATE - and, since we're at 1.1, enable 'Remote API' check in version test - better diagnostics in setup/teardown; add vim filetype hint; better formatting of actual-vs-expect errors - new pod-top, logs, build tests - improve error messages - add $IMAGE alias for ridiculous $PODMAN_TEST_IMAGE_FQN - final cleanup, in prep for merge Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test/system/001-basic.bats')
-rw-r--r--test/system/001-basic.bats24
1 files changed, 18 insertions, 6 deletions
diff --git a/test/system/001-basic.bats b/test/system/001-basic.bats
index 15d5f38db..85b9bc1ca 100644
--- a/test/system/001-basic.bats
+++ b/test/system/001-basic.bats
@@ -14,16 +14,13 @@ function setup() {
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"
+ is "$output" ".*RemoteAPI Version: \+" "API version in output"
}
@test "podman can pull an image" {
- run_podman pull $PODMAN_TEST_IMAGE_FQN
+ run_podman pull $IMAGE
}
# This is for development only; it's intended to make sure our timeout
@@ -33,6 +30,21 @@ function setup() {
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
+ 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