Description:
In the build of Cluster-7.1.5, we have total failures on some platforms,
I do not have a complete list yet.
On Solaris 10, x86_64, the relevant log lines are:
=====
2010-07-12 13:24:16 START run the unittest
cd unittest && /usr/local/bin/make-3.78.1 test
perl unit.pl run mytap mysys ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/myisammrg ../storage/myisam ../storage/ndb
Running tests: mytap mysys ../storage/archive ../storage/blackhole ../storage/csv ../storage/federated ../storage/heap ../storage/innobase ../storage/myisammrg ../storage/myisam ../storage/ndb
mytap/t/basic-t..................................................ok
2/5 skipped: Sensa fragoli
mysys/bitmap-t...................................................ok
mysys/base64-t...................................................ok
mysys/my_atomic-t................................................ok
../storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t............./storage/ndb/src/ndbjtie/jtie/test/jtie_unit_tests-t: syntax error at line 34: `test_counter=$' unexpected
dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-3
Failed 3/3 tests, 0.00% okay
../storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t.............../storage/ndb/src/ndbjtie/test/ndbjtie_unit_tests-t: syntax error at line 34: `test_counter=$' unexpected
dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED tests 1-6
Failed 6/6 tests, 0.00% okay
../storage/ndb/src/ndbjtie/mysql/test/mysql_utils_unit_tests-t...ok
1/1 skipped: test_mysql_utils test file missing
../storage/ndb/src/common/portlib/NdbDir-t.......................failed at line 409
FAILED--Further testing stopped: Signal 6 thrown
make-3.78.1: *** [test] Error 29
=====
Looking into the failing test file, I see:
1 #!/bin/sh
2 #
.. ...
31 run_test()
32 {
33 test_name=$1;
34 test_counter=$(expr $test_counter + 1)
35 script_name="test_$test_name.sh"
36
Checking the shell binaries, it is obvious that "/bin/sh" is no bash:
> ls -ldi /usr/bin/bash /sbin/sh /bin/sh
45 lrwxrwxrwx 1 root root 13 Oct 18 2008 /bin/sh -> ../../sbin/sh
1793 -r-xr-xr-x 1 root root 82468 Oct 18 2006 /sbin/sh
45327 -r-xr-xr-x 1 root bin 611132 May 2 2007 /usr/bin/bash
So the bashism in line 34 must be expected to fail.
How to repeat:
Run the unittest on a machine whose shell is not bash.
Suggested fix:
Do not write bashisms in shell script.
In this case, replace
34 test_counter=$(expr $test_counter + 1)
by
34 test_counter=`expr $test_counter + 1`