testprogs: Ignore escape characters when printing test name
authorChristof Schmitt <cs@samba.org>
Thu, 4 May 2017 23:10:56 +0000 (01:10 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 5 May 2017 21:44:16 +0000 (23:44 +0200)
commit0b1ba00b007802932d501dbb315616f6d5c4306f
tree06173ea767bdfc118c3e510132937207c92e3afe
parent825d00df19f32845a66b080354824fada946d620
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 <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri May  5 23:44:16 CEST 2017 on sn-devel-144
testprogs/blackbox/subunit.sh