summaryrefslogtreecommitdiff
path: root/mysql-test/ndb
diff options
context:
space:
mode:
authorjoreland@mysql.com <>2004-12-31 06:36:32 +0100
committerjoreland@mysql.com <>2004-12-31 06:36:32 +0100
commit8f2d0ec1a1aa0af13e30718d86eef75ab5f4853c (patch)
treea1d6407a6626529b28b62eaf78d244fe41fa644f /mysql-test/ndb
parent91a04d182bcfd0f04cba5a57b8f3dbc6e1c00f59 (diff)
parentdd32940b50b9fd02b8f3e7aeda4cc8123dafd2e0 (diff)
downloadmariadb-git-8f2d0ec1a1aa0af13e30718d86eef75ab5f4853c.tar.gz
merge
Diffstat (limited to 'mysql-test/ndb')
-rw-r--r--mysql-test/ndb/basic.result69
-rw-r--r--mysql-test/ndb/basic.test17
-rw-r--r--mysql-test/ndb/basic_log.result0
-rw-r--r--mysql-test/ndb/ndbcluster.sh60
-rw-r--r--mysql-test/ndb/restart.result16
-rw-r--r--mysql-test/ndb/restart.test12
-rw-r--r--mysql-test/ndb/restart_log.result20
7 files changed, 190 insertions, 4 deletions
diff --git a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result
new file mode 100644
index 00000000000..7049c02f304
--- /dev/null
+++ b/mysql-test/ndb/basic.result
@@ -0,0 +1,69 @@
+-- NDB Cluster -- Management Client --
+---------------------------------------------------------------------------
+ NDB Cluster -- Management Client -- Help
+---------------------------------------------------------------------------
+HELP Print help text
+HELP SHOW Help for SHOW command
+HELP DEBUG Help for debug compiled version
+SHOW Print information about cluster
+START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
+ Start backup (default WAIT COMPLETED)
+ABORT BACKUP <backup id> Abort backup
+SHUTDOWN Shutdown all processes in cluster
+CLUSTERLOG ON [<severity>] ... Enable Cluster logging
+CLUSTERLOG OFF [<severity>] ... Disable Cluster logging
+CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off
+CLUSTERLOG INFO Print cluster log information
+<id> START Start DB node (started with -n)
+<id> RESTART [-n] [-i] Restart DB node
+<id> STOP Stop DB node
+ENTER SINGLE USER MODE <api-node> Enter single user mode
+EXIT SINGLE USER MODE Exit single user mode
+<id> STATUS Print status
+<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
+PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
+CONNECT [<connectstring>] Connect to management server (reconnect if already connected)
+QUIT Quit management client
+
+<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
+<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | GREP | DEBUG | BACKUP
+<level> = 0 - 15
+<id> = ALL | Any database node id
+
+Connected to Management Server at: localhost:1186
+Node 1: started (Version 4.1.8)
+Node 2: started (Version 4.1.8)
+
+Node 1: started (Version 4.1.8)
+
+Node 2: started (Version 4.1.8)
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Cluster logging is disabled
+Cluster logging is enabled.
+Cluster logging is disabled
+ALL disabled
+ALL enabled
diff --git a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test
new file mode 100644
index 00000000000..945bda94ff6
--- /dev/null
+++ b/mysql-test/ndb/basic.test
@@ -0,0 +1,17 @@
+help
+all status
+1 status
+2 status
+all clusterlog connection=8
+all clusterlog startup=7
+all clusterlog checkpoint=7
+all clusterlog noderestart=15
+all clusterlog statistics=7
+all clusterlog error=7
+all clusterlog info=7
+all clusterlog backup=15
+clusterlog off
+clusterlog toggle
+clusterlog off
+clusterlog off all
+clusterlog on all
diff --git a/mysql-test/ndb/basic_log.result b/mysql-test/ndb/basic_log.result
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/mysql-test/ndb/basic_log.result
diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
index 60188705857..848223a091c 100644
--- a/mysql-test/ndb/ndbcluster.sh
+++ b/mysql-test/ndb/ndbcluster.sh
@@ -47,6 +47,7 @@ fi
pidfile=ndbcluster.pid
cfgfile=Ndb.cfg
+test_ndb=
stop_ndb=
initial_ndb=
status_ndb=
@@ -59,6 +60,9 @@ ndb_imem=24M
while test $# -gt 0; do
case "$1" in
+ --test)
+ test_ndb=1
+ ;;
--stop)
stop_ndb=1
;;
@@ -67,8 +71,7 @@ while test $# -gt 0; do
initial_ndb=1
;;
--debug*)
- f=`echo "$1" | sed -e "s;--debug=;;"`
- flags_ndb="$flags_ndb $f"
+ flags_ndb="$flags_ndb $1"
;;
--status)
status_ndb=1
@@ -232,7 +235,7 @@ status_ndbcluster
status_ndbcluster() {
# Start management client
- echo "show" | $exec_mgmtclient
+ $exec_mgmtclient -e show
}
stop_default_ndbcluster() {
@@ -241,7 +244,7 @@ stop_default_ndbcluster() {
exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
-echo "shutdown" | $exec_mgmtclient 2>&1 | cat > /dev/null
+$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null
if [ -f "$fs_ndb/$pidfile" ] ; then
kill_pids=`cat "$fs_ndb/$pidfile"`
@@ -276,6 +279,44 @@ if [ -f "$fs_ndb/$pidfile" ] ; then
fi
}
+initialize_ndb_test ()
+{
+ fs_result=$fs_ndb/r
+ rm -rf $fs_result
+ mkdir $fs_result
+ echo ------------------
+ echo starting ndb tests
+ echo ------------------
+}
+
+do_ndb_test ()
+{
+ test_name=$1
+
+ clusterlog=$fs_ndb/ndb_3_cluster.log
+
+ test_log_result=$fs_result/${test_name}_log.result
+ test_log_reject=$fs_result/${test_name}_log.reject
+ test_result=$fs_result/${test_name}.result
+ test_reject=$fs_result/${test_name}.reject
+
+ clean_log='s/.*\[MgmSrvr\]//'
+
+ cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result
+
+ cp ndb/${test_name}.result $test_result
+
+ cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject
+ cat $clusterlog | sed -e $clean_log > $test_log_reject
+
+ t="pass"
+ diff -C 5 $test_result $test_reject || t="fail"
+ printf "ndb_mgm output %20s [%s]\n" $test_name $t
+ t="pass"
+ diff -C 5 $test_log_result $test_log_reject || t="fail"
+ printf "clusterlog output %20s [%s]\n" $test_name $t
+}
+
if [ $status_ndb ] ; then
status_ndbcluster
exit 0
@@ -287,4 +328,15 @@ else
start_default_ndbcluster
fi
+if [ $test_ndb ] ; then
+ initialize_ndb_test
+ all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"`
+ for a in $all_tests ; do
+ do_ndb_test $a
+ done
+ echo ------------------
+ echo shutting down cluster
+ stop_default_ndbcluster
+fi
+
exit 0
diff --git a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result
new file mode 100644
index 00000000000..efa1399b5d9
--- /dev/null
+++ b/mysql-test/ndb/restart.result
@@ -0,0 +1,16 @@
+-- NDB Cluster -- Management Client --
+Connected to Management Server at: localhost:1186
+ALL disabled
+Cluster logging is enabled.
+ALERT enabled
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Node 1 is being restarted.
+
+Executing CLUSTERLOG on node 1 OK!
+Executing CLUSTERLOG on node 2 OK!
+
+Node 1 is being restarted.
+
+ALL enabled
diff --git a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test
new file mode 100644
index 00000000000..6ea9e919368
--- /dev/null
+++ b/mysql-test/ndb/restart.test
@@ -0,0 +1,12 @@
+clusterlog off all
+clusterlog on
+clusterlog on alert
+all clusterlog connection=0
+sleep 1
+1 restart
+sleep 5
+all clusterlog connection=8
+sleep 1
+1 restart
+sleep 5
+clusterlog on all
diff --git a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result
new file mode 100644
index 00000000000..2b25fc7b5b6
--- /dev/null
+++ b/mysql-test/ndb/restart_log.result
@@ -0,0 +1,20 @@
+ ALERT -- Node 2: Network partitioning - arbitration required
+ ALERT -- Node 2: Arbitration won - positive reply from node 3
+ ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
+ ALERT -- Node 2: Node failure of 1 DBLQH completed
+ ALERT -- Node 2: Node failure of 1 DBDICT completed
+ ALERT -- Node 2: Node failure of 1 DBDIH completed
+ ALERT -- Node 2: Node failure of 1 DBTC completed
+ ALERT -- Node 2: Node 2 completed failure of Node 1
+ ALERT -- Node 2: All nodes completed failure of Node 1
+ ALERT -- Node 3: Node 1 Disconnected
+ ALERT -- Node 2: Node 1 Disconnected
+ ALERT -- Node 2: Network partitioning - arbitration required
+ ALERT -- Node 2: Arbitration won - positive reply from node 3
+ ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
+ ALERT -- Node 2: Node failure of 1 DBLQH completed
+ ALERT -- Node 2: Node failure of 1 DBDICT completed
+ ALERT -- Node 2: Node failure of 1 DBDIH completed
+ ALERT -- Node 2: Node failure of 1 DBTC completed
+ ALERT -- Node 2: Node 2 completed failure of Node 1
+ ALERT -- Node 2: All nodes completed failure of Node 1