aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Tervala <tero.tervala@unikie.com>2022-07-04 10:37:22 +0300
committerDavid Gibson <david@gibson.dropbear.id.au>2022-07-26 21:39:07 +1000
commitc7c7f17a83d5ec1049ddfcaf22f40fcdc53ac0c4 (patch)
treea6e080ea4064b39255d5b571f0d3151d49f26474
parent01f23ffe1679bc8009fa14b7d8d728f317d053ea (diff)
downloaddtc-c7c7f17a83d5ec1049ddfcaf22f40fcdc53ac0c4.tar.gz
Fix test script to run also on dash shell
/bin/sh points to dash instead of bash in some linux distros. One test would fail if dash was used, this fix will allow all tests to run properly on dash too. dash built-in printf does not support "\xNN" -hex escape format. "\NNN" -octal escape format is supported by both bash and dash printf. Replaced "$(echo "$expect")" because this actually runs /bin/echo instead of shell internal echo and in some cases causes "\NNN" escapes to be printed as the actual characters they represent instead of the escape sequence itself. Cosmetic quotes added to make printout a bit clearer. Signed-off-by: Tero Tervala <tero.tervala@unikie.com> Message-Id: <20220704073722.1075849-1-tero.tervala@unikie.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
-rwxr-xr-xtests/run_tests.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index c78351d..1b16eb8 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -195,7 +195,7 @@ asm_to_so_test () {
run_fdtget_test () {
expect="$1"
shift
- printf "fdtget-runtest.sh %s $*: " "$(echo $expect)"
+ printf "fdtget-runtest.sh \"%s\" $*: " "$expect"
base_run_test sh "$SRCDIR/fdtget-runtest.sh" "$expect" "$@"
}
@@ -862,7 +862,7 @@ fdtget_tests () {
run_fdtget_test "61 62 63 0" -tbx $dtb /randomnode tricky1
run_fdtget_test "a b c d de ea ad be ef" -tbx $dtb /randomnode blob
run_fdtget_test "MyBoardName\0MyBoardFamilyName\0" -tr $dtb / compatible
- run_fdtget_test "\x0a\x0b\x0c\x0d\xde\xea\xad\xbe\xef" -tr $dtb /randomnode blob
+ run_fdtget_test "\012\013\014\015\336\352\255\276\357" -tr $dtb /randomnode blob
# Here the property size is not a multiple of 4 bytes, so it should fail
run_wrap_error_test $DTGET -tlx $dtb /randomnode mixed