tests: port sv-48030-exec-plus-bug.sh to Alpine Linux

On Alpine Linux v3.6, the test failed because the created 'tstcmd'
script lacks a shebang - see shortened log:

  + echo printf "%s\n" "$@"
  + chmod +x bin/tstcmd
  + PATH=/tmp/tmp.10fq3tSrnx/bin:...
  + .../find/find bin -maxdepth 0 -exec tstcmd {} +
  find: ‘tstcmd’: Exec format error
  + [ = bin ]
  sh: bin: unknown operand
  + return 1

* find/testsuite/sv-48030-exec-plus-bug.sh: Add a shebang to the
generated 'tstcmd' script, and add quotes around the find call to
avoid the "unknown operand" error.
This commit is contained in:
Bernhard Voelker 2018-03-04 22:22:30 +01:00
parent 15f9a4903c
commit 70c91e7a21

View File

@ -109,10 +109,10 @@ CMD='tstcmd'
make_test_data() {
# Create the CMD script and check that it works.
mkdir "$DIR" 'bin' \
&& echo 'printf "%s\n" "$@"' > "bin/$CMD" \
&& printf '%s\n' '#!/bin/sh' 'printf "%s\n" "$@"' > "bin/$CMD" \
&& chmod +x "bin/$CMD" \
&& PATH="$PWD/bin:$PATH" \
&& [ $( "${ftsfind}" bin -maxdepth 0 -exec "$CMD" '{}' + ) = 'bin' ] \
&& [ "$( "${ftsfind}" bin -maxdepth 0 -exec "$CMD" '{}' + )" = 'bin' ] \
|| return 1
# Create expected output file - also used for creating the test data.