From 498d2d602e09d74c4e1da4b549c12c5f62e7d16e Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Sun, 2 Oct 2016 19:13:00 +1100 Subject: [PATCH] test: add more debugging output In several places, we previously didn't output the $output of the failing command, leading to confusion when debugging. A proper fix is to alias oci{c,d} in helpers.sh like runC does, but that can come later. Signed-off-by: Aleksa Sarai --- test/ctr.bats | 4 ++-- test/pod.bats | 11 ++++++++--- test/runtimeversion.bats | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/test/ctr.bats b/test/ctr.bats index 5f808fea..0ede579c 100644 --- a/test/ctr.bats +++ b/test/ctr.bats @@ -14,8 +14,8 @@ function teardown() { start_ocid run ocic pod create --config "$TESTDATA"/sandbox_config.json - [ "$status" -eq 0 ] echo "$output" + [ "$status" -eq 0 ] pod_id="$output" run ocic ctr create --config "$TESTDATA"/container_redis.json --pod "$pod_id" echo "$output" @@ -45,8 +45,8 @@ function teardown() { start_ocid run ocic pod create --config "$TESTDATA"/sandbox_config.json - [ "$status" -eq 0 ] echo "$output" + [ "$status" -eq 0 ] pod_id="$output" run ocic pod list echo "$output" diff --git a/test/pod.bats b/test/pod.bats index 1bc20142..9b8f918a 100644 --- a/test/pod.bats +++ b/test/pod.bats @@ -15,20 +15,25 @@ function teardown() { start_ocid run ocic pod create --config "$TESTDATA"/sandbox_config.json - [ "$status" -eq 0 ] echo "$output" + [ "$status" -eq 0 ] id="$output" run ocic pod stop --id "$id" + echo "$output" [ "$status" -eq 0 ] + echo "$output" run ocic pod remove --id "$id" + echo "$output" [ "$status" -eq 0 ] run ocic pod create --config "$TESTDATA"/sandbox_config.json - [ "$status" -eq 0 ] echo "$output" + [ "$status" -eq 0 ] id="$output" run ocic pod stop --id "$id" + echo "$output" [ "$status" -eq 0 ] run ocic pod remove --id "$id" + echo "$output" [ "$status" -eq 0 ] stop_ocid cleanup_pods @@ -42,8 +47,8 @@ function teardown() { start_ocid run ocic pod create --config "$TESTDATA"/sandbox_config.json - [ "$status" -eq 0 ] echo "$output" + [ "$status" -eq 0 ] pod_id="$output" run ocic ctr create --config "$TESTDATA"/container_redis.json --pod "$pod_id" echo "$output" diff --git a/test/runtimeversion.bats b/test/runtimeversion.bats index 60bbfa2e..20848fb4 100644 --- a/test/runtimeversion.bats +++ b/test/runtimeversion.bats @@ -9,6 +9,7 @@ function teardown() { @test "ocic runtimeversion" { start_ocid ocic runtimeversion + echo "$output" [ "$status" -eq 0 ] stop_ocid }