From a90bf444d3bb8f8d11103cac6cd0085873441e4a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 17 May 2023 14:10:51 +0200 Subject: [PATCH] Unhide imds error messages imds drivers may print error messages to stderr. Do not hide those. --- bin/imds | 2 +- tests/init-final.test | 2 +- tests/init-main.test | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/imds b/bin/imds index 3253b65..e1acd09 100755 --- a/bin/imds +++ b/bin/imds @@ -122,7 +122,7 @@ imds() { *) args="$key" ;; esac # TODO: retry/deadline - "$cmd" $args 2>/dev/null + "$cmd" $args rv=$? [ $err -eq 0 ] && continue [ $rv = "0" ] || return $rv diff --git a/tests/init-final.test b/tests/init-final.test index 312a0a2..a78cd79 100755 --- a/tests/init-final.test +++ b/tests/init-final.test @@ -48,7 +48,7 @@ run_userdata_body() { #!/bin/sh echo "hello from user-data" EOF - CLOUD="nocloud" atf_check \ + CLOUD="nocloud" atf_check -e match:"NoCloud 'meta-data' is empty" \ sh -c ". \"$lib\"; init__save_userdata" CLOUD="nocloud" atf_check \ -o match:"hello from user-data" \ diff --git a/tests/init-main.test b/tests/init-main.test index ce0842c..3786a08 100755 --- a/tests/init-main.test +++ b/tests/init-main.test @@ -69,7 +69,7 @@ save_userdata_plain_body() { fake_userdata_nocloud <<-EOF #userdata EOF - CLOUD="nocloud" atf_check \ + CLOUD="nocloud" atf_check -e match:"NoCloud 'meta-data' is empty" \ sh -c ". \"$lib\"; init__save_userdata" atf_check -o match:"^#userdata" cat var/lib/cloud/user-data }