You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/test/inject-smart.sh b/test/inject-smart.sh
index 046322b..4bca492 100755
--- a/test/inject-smart.sh
+++ b/test/inject-smart.sh
@@ -105,7 +105,14 @@ get_field()
json="$($NDCTL list -b $bus -d $dimm -H)"
val="$(jq -r ".[].dimms[].health.$smart_listing" <<< $json)"
val="$(translate_val $val)"
- printf "%0.0f\n" "$val"
+
+ # val can be e.g. "20.0". Printf complains on this for locales that
+ # use ',' as the decimal separator. For this %0.0f case, it doesn't
+ # matter what the decimal separator is, and bash helpfully does print
+ # "20" even if #$? indicates an error, and there is an error message
+ # on stderr. Ignore the error, and just pick the "20" to avoid such
+ # cases
+ printf "%0.0f\n" "$val" 2 >/dev/null || true
}
verify()
With locale set to
cs_CZ.UTF-8
, inject-smart.sh test fails with the following error (full log of the test here):This is caused by the floating point separator being
,
in Czech locale rather than.
:Running the test with
LC_ALL=C
fixes the issue.The text was updated successfully, but these errors were encountered: