summaryrefslogtreecommitdiff
path: root/testprogs
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2017-05-05 01:10:56 +0200
committerVolker Lendecke <vl@samba.org>2017-05-05 23:44:16 +0200
commit0b1ba00b007802932d501dbb315616f6d5c4306f (patch)
tree06173ea767bdfc118c3e510132937207c92e3afe /testprogs
parent825d00df19f32845a66b080354824fada946d620 (diff)
downloadsamba-0b1ba00b007802932d501dbb315616f6d5c4306f.tar.gz
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
Diffstat (limited to 'testprogs')
-rwxr-xr-xtestprogs/blackbox/subunit.sh10
1 files 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 <<END syntax.
timestamp
- echo "failure: $1 ["
+ printf 'failure: %s [\n' "$1"
cat -
echo "]"
}
@@ -60,7 +60,7 @@ subunit_error_test () {
# we use stdin because the failure message can be arbitrarily long, and this
# makes it convenient to write in scripts (using <<END syntax.
timestamp
- echo "error: $1 ["
+ printf 'error: %s [\n' "$1"
cat -
echo "]"
}
@@ -70,7 +70,7 @@ subunit_skip_test () {
# the error text.
# we use stdin because the failure message can be arbitrarily long, and this
# makes it convenient to write in scripts (using <<END syntax.
- echo "skip: $1 ["
+ printf 'skip: %s [\n' "$1"
cat -
echo "]"
}