From 0b1ba00b007802932d501dbb315616f6d5c4306f Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Fri, 5 May 2017 01:10:56 +0200 Subject: [PATCH] testprogs: Ignore escape characters when printing test name Long story: This was triggered by the addition of the test_trust_ntlm.sh script in commits 3caca9b and 2de1994. test_trust_ntlm.sh creates a variable CREDS="$REALM\\$USERNAME%$PASSWORD" that is then used as part of the test name. subunit.sh uses echo to print the name that is then picked up by subunithelper.py. test_trust_ntlm.sh also uses /bin/sh as shell which can be a POSIX compliant shell like dash. This combination broke 'make test' for any username starting with the letter c. In this case CREDS contains the escape sequence \c that is defined to stop producing further output at this point. dash implements this feature and the echo in subunit.sh as a result skips the output after \c, including skipping the newline. This means that the data received by subunithelper.py contains the timestamp from the next line in the test name, which then breaks the testcase tracking. Fix this by replacing the echo in subunit.sh with a printf that does not trigger the special handling of escape characters. Signed-off-by: Christof Schmitt Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Fri May 5 23:44:16 CEST 2017 on sn-devel-144 --- testprogs/blackbox/subunit.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testprogs/blackbox/subunit.sh b/testprogs/blackbox/subunit.sh index 5c81ce20a11..aca53f72536 100755 --- a/testprogs/blackbox/subunit.sh +++ b/testprogs/blackbox/subunit.sh @@ -28,14 +28,14 @@ timestamp() { subunit_start_test () { # emit the current protocol start-marker for test $1 timestamp - echo "test: $1" + printf 'test: %s\n' "$1" } subunit_pass_test () { # emit the current protocol test passed marker for test $1 timestamp - echo "success: $1" + printf 'success: %s\n' "$1" } # This is just a hack as we have some broken scripts @@ -48,7 +48,7 @@ subunit_fail_test () { # we use stdin because the failure message can be arbitrarily long, and this # makes it convenient to write in scripts (using <