3
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; version 2 of the License.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
# Use like this in the ATRT test file:
23
# args: --test-file=suite/ndb/t/smoke.test
28
RESULT_FILE="$RUN_DIR/mysqltest.out"
29
MYSQL_TEST_DIR=$MYSQL_BASE_DIR/mysql-test
30
RUN_LOG="$RUN_DIR/ndb_testrun.log"
32
# Expected subdirectory by tests written for MTR.
35
$MYSQL_BASE_DIR/bin/ndb_waiter -c $NDB_CONNECTSTRING > $RESULT_FILE
37
cd $MYSQL_BASE_DIR/mysql-test
39
NDB_MGM="$MYSQL_BASE_DIR/storage/ndb/src/mgmclient/ndb_mgm"
40
if [ -f "$MYSQL_BASE_DIR/bin/ndb_mgm" ]; then
41
NDB_MGM="$MYSQL_BASE_DIR/bin/ndb_mgm"
44
NDB_NDBD="$MYSQL_BASE_DIR/bin/ndbd"
45
if [ -f "$MYSQL_BASE_DIR/bin/ndbmtd" ]; then
46
NDB_NDBD="$MYSQL_BASE_DIR/bin/ndbmtd"
48
if [ -f "$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbd" ]; then
49
NDB_NDBD="$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbd"
51
if [ -f "$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbmtd" ]; then
52
NDB_NDBD="$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbmtd"
55
NDB_TOOLS_DIR="$MYSQL_BASE_DIR/bin"
56
if [ -e "$MYSQL_BASE_DIR/storage/ndb/tools" ]; then
57
NDB_TOOLS_DIR="$MYSQL_BASE_DIR/storage/ndb/tools"
60
NDB_EXAMPLES_DIR="$MYSQL_BASE_DIR/bin"
61
if [ -e "$MYSQL_BASE_DIR/storage/ndb/ndbapi-examples" ]; then
62
NDB_EXAMPLES_DIR="$MYSQL_BASE_DIR/storage/ndb/ndbapi-examples"
65
NDB_EXAMPLES_BINARY="$MYSQL_BASE_DIR/bin/ndbapi_simple"
66
if [ -f "$MYSQL_BASE_DIR/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple" ]; then
67
NDB_EXAMPLES_BINARY="$MYSQL_BASE_DIR/storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple"
70
echo "Default group suffix: $MYSQL_GROUP_SUFFIX"
72
# MYSQL_GROUP_SUFFIX: This is a MySQL client, started as a NDB API client by ATRT.
73
NDB_CONNECTSTRING=$NDB_CONNECTSTRING MYSQL_TEST_DIR=$MYSQL_BASE_DIR/mysql-test \
74
NDB_TOOLS_OUTPUT=$RUN_LOG NDB_EXAMPLES_OUTPUT=$RUN_LOG NDB_MGM=$NDB_MGM NDB_NDBD=NDB_NDBD \
75
NDB_TOOLS_DIR=$NDB_TOOLS_DIR NDB_EXAMPLES_DIR=$NDB_EXAMPLES_DIR NDB_EXAMPLES_BINARY=$NDB_EXAMPLES_BINARY \
76
MYSQLTEST_VARDIR=$RUN_DIR MYSQL_GROUP_SUFFIX=.1.4node \
77
$MYSQL_BASE_DIR/bin/mysqltest --defaults-file=$MYSQL_HOME/my.cnf \
80
--basedir=$MYSQL_BASE_DIR/mysql-test/ \
85
--skip-safemalloc $* | tee -a $RESULT_FILE
87
# Could be added, but would then also need the mtr database:
88
# --include=include/mtr_check.sql \
89
# We could also run the bootstrap scripts
91
echo "Run complete, result code: '$?'"
94
f=`grep -c '\[ fail \]' $RESULT_FILE`
95
o=`grep -c '\[ pass \]' $RESULT_FILE`
97
if [ ( $r -eq 0 ) -o ( $o -gt 0 -a $f -eq 0 ) ]
99
echo "NDBT_ProgramExit: OK"
103
echo "NDBT_ProgramExit: Failed"