~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to storage/ndb/test/run-test/atrt-mysqltest

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
 
4
#
 
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.
 
8
#
 
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.
 
13
#
 
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
 
17
 
 
18
#
 
19
# Use like this in the ATRT test file:
 
20
#
 
21
# max-time: 180
 
22
# cmd: atrt-mysqltest
 
23
# args: --test-file=suite/ndb/t/smoke.test
 
24
#
 
25
set -x
 
26
RUN_DIR=`pwd`
 
27
 
 
28
RESULT_FILE="$RUN_DIR/mysqltest.out"
 
29
MYSQL_TEST_DIR=$MYSQL_BASE_DIR/mysql-test
 
30
RUN_LOG="$RUN_DIR/ndb_testrun.log"
 
31
 
 
32
# Expected subdirectory by tests written for MTR.
 
33
mkdir -p $RUN_DIR/tmp
 
34
 
 
35
$MYSQL_BASE_DIR/bin/ndb_waiter -c $NDB_CONNECTSTRING > $RESULT_FILE
 
36
 
 
37
cd $MYSQL_BASE_DIR/mysql-test
 
38
 
 
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"
 
42
fi
 
43
 
 
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"
 
47
fi
 
48
if [ -f "$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbd" ]; then
 
49
  NDB_NDBD="$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbd"
 
50
fi
 
51
if [ -f "$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbmtd" ]; then
 
52
  NDB_NDBD="$MYSQL_BASE_DIR/storage/ndb/src/kernel/ndbmtd"
 
53
fi
 
54
 
 
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"
 
58
fi
 
59
 
 
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"
 
63
fi
 
64
 
 
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"
 
68
fi
 
69
 
 
70
echo "Default group suffix: $MYSQL_GROUP_SUFFIX"
 
71
 
 
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 \
 
78
                              --tmpdir=$RUN_DIR \
 
79
                              --logdir=$RUN_DIR \
 
80
                              --basedir=$MYSQL_BASE_DIR/mysql-test/ \
 
81
                              --ps-protocol \
 
82
                              --tail-lines=20 \
 
83
                              --database=test \
 
84
                              --nowarnings \
 
85
                              --skip-safemalloc $* | tee -a $RESULT_FILE
 
86
 
 
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
 
90
 
 
91
echo "Run complete, result code: '$?'"
 
92
 
 
93
r=$?
 
94
f=`grep -c '\[ fail \]' $RESULT_FILE`
 
95
o=`grep -c '\[ pass \]' $RESULT_FILE`
 
96
 
 
97
if [ ( $r -eq 0 ) -o ( $o -gt 0 -a $f -eq 0 ) ]
 
98
then
 
99
    echo "NDBT_ProgramExit: OK"
 
100
    exit 0
 
101
fi
 
102
 
 
103
echo "NDBT_ProgramExit: Failed"
 
104
exit 1