1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-24 14:20:59 +03:00

add cluster tester

This commit is contained in:
David Hill
2017-05-19 17:22:29 -05:00
parent 472b2bd861
commit 6c93fe5496
14 changed files with 2478 additions and 22 deletions

View File

@@ -215,6 +215,8 @@ SET(CPACK_RPM_platform_USER_FILELIST
"/usr/local/mariadb/columnstore/post/test-002.sh"
"/usr/local/mariadb/columnstore/post/test-003.sh"
"/usr/local/mariadb/columnstore/post/test-004.sh"
"/usr/local/mariadb/columnstore/bin/os_detect.sh"
"/usr/local/mariadb/columnstore/bin/columnstoreClusterTester.sh"
${ignored})
SET(CPACK_RPM_libs_USER_FILELIST

View File

@@ -10,7 +10,7 @@
# Argument 5 - Remote user name (optional)
# Argument 6 - Force a tty to be allocated (optional)
set stty_init {cols 512 -opost};
set timeout 30
set timeout 10
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set COMMAND [lindex $argv 2]
@@ -33,7 +33,7 @@ if { $TTYOPT != "" } {
}
log_user $DEBUG
spawn -noecho /bin/bash
expect -re {[$#] }
#expect -re {[$#] }
if { $PASSWORD == "ssh" } {
set PASSWORD ""
@@ -42,8 +42,9 @@ if { $PASSWORD == "ssh" } {
#
# send command
#
send "ssh $TTY $USERNAME@$SERVER $COMMAND\n"
send "ssh -v $TTY $USERNAME@$SERVER '$COMMAND'\n"
expect {
"cannot access" { exit 1}
"Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit 1}
"service not known" { send_user " FAILED: Invalid Host\n" ; exit 1}
"ssh: connect to host" { send_user " FAILED: Invalid Host\n" ; exit 1 }
@@ -57,14 +58,35 @@ expect {
}
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
-re {[$#] } { exit 0 }
"command not found" { exit 3 }
# -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
-re {[$#] } { exit 0 }
"Permission denied" { send_user " FAILED: Invalid password\n" ; exit 1 }
"command not found" { exit 3 }
# -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
"cannot access" { exit 1}
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
"(y or n)" { send "y\n"
expect -re {[$#] } { exit 0 }
}
"command not found" { exit 3 }
# expect -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
}
}
exit 0

View File

@@ -6,7 +6,7 @@
# Argument 1 - Remote Server Host Name or IP address
# Argument 2 - Remote Server root password
# Argument 3 - Command
set timeout 30
set timeout 10
set USERNAME $env(USER)"@"
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
@@ -22,9 +22,12 @@ if { $PASSWORD == "ssh" } {
#
# send command
#
expect -re {[$#] }
send "scp $USERNAME$SERVER:$FILE .\n"
#expect -re {[$#] }
send "scp -v $USERNAME$SERVER:$FILE .\n"
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"100%" { send_user "DONE\n" ; exit 0 }
"authenticity" { send "yes\n"
expect {
"word: " { send "$PASSWORD\n" }
@@ -38,16 +41,18 @@ expect {
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
"scp:" { send_user "FAILED\n" ; exit 1 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
"100%" { send_user "DONE\n" }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"100%" { send_user "DONE\n" ; exit 0 }
"scp:" { send_user "FAILED\n" ; exit 1 }
"Permission denied" { send_user "FAILED: Invalid password\n" ; exit 1 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
"No such file or directory" { send_user "FAILED: No such file or directory\n" ; exit 1 }
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
}
#sleep to make sure it's finished
sleep 5
exit 0

15
oam/install_scripts/remote_scp_put.sh Normal file → Executable file
View File

@@ -22,9 +22,11 @@ if { $PASSWORD == "ssh" } {
#
# send command
#
expect -re "# "
send "scp $FILE $USERNAME$SERVER:$FILE\n"
send "scp -v $FILE $USERNAME$SERVER:$FILE\n"
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
-re "100%" { send_user "DONE\n" ; sleep 2; exit 0 }
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" }
@@ -39,16 +41,17 @@ expect {
-re "word: " { send "$PASSWORD\n" }
-re "passphrase" { send "$PASSWORD\n" }
-re "WARNING:" { send "rm -f /root/.ssh/known_hosts" ; exit 1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
-re "100%" { send_user "DONE\n" }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
-re "100%" { send_user "DONE\n" ; sleep 2 ; exit 0 }
-re "scp:" { send_user "FAILED\n" ; exit 1 }
-re "Permission denied" { send_user "FAILED: Invalid password\n" ; exit 1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
-re "No such file or directory" { send_user "FAILED: Invalid file\n" ; exit 1 }
-re "Connection refused" { send_user "FAILED: Connection refused\n" ; exit 1 }
-re "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
}
#sleep to make sure it's finished
sleep 5
exit 0

View File

@@ -24,4 +24,4 @@ add_subdirectory(idbhdfs)
add_subdirectory(winport)
add_subdirectory(thrift)
add_subdirectory(querytele)
add_subdirectory(clusterTester)

View File

@@ -0,0 +1,5 @@
install(PROGRAMS columnstoreClusterTester.sh
os_detect.sh
DESTINATION ${ENGINE_BINDIR} COMPONENT platform)

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
#!/bin/sh
#
detectOS () {
checkFile1=/etc/os-release
checkFile2=/etc/centos-release
if [ -f "$checkFile1" ]
then
osPrettyName=`cat $checkFile1 | grep PRETTY_NAME|awk -F"=" '{print $2}'`
osVersionID=`cat $checkFile1 | grep VERSION_ID | awk -F"=" '{print $2}' | awk -F"." '{print $1}' | sed 's/"//g'`
else
osPrettyName=`head -n 1 $checkFile2`
osVersionID=`echo $osPrettyName | awk -F" " '{print $3}' | awk -F"." '{print $1}'`
fi
#
osName=`echo $osPrettyName | awk -F" " '{print $1}' | sed 's/"//g'`
if [ -z "$osPrettyName" ]
then
osPrettyName=`uname -o -s -r -v`
fi
if [ -z "$osName" ] || [ -z "$osVersionID" ]
then
osTag=""
else
osTag=`echo $osName$osVersionID | awk '{print tolower($0)}'`
fi
}
#
detectOS
echo Operating System name: $osPrettyName
echo Operating System tag: $osTag
case "$osTag" in
centos6|centos7|ubuntu16|debian8|suse12)
;;
*)
echo OS not supported
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,92 @@
#!/usr/bin/expect
#
# $Id: remote_command.sh 3495 2012-12-17 22:51:40Z dhill $
#
# Remote command execution script to another server
# Argument 1 - Remote Server Host Name or IP address
# Argument 2 - Remote Server password
# Argument 3 - Command
# Argument 4 - debug flag
# Argument 5 - Remote user name (optional)
# Argument 6 - Force a tty to be allocated (optional)
set stty_init {cols 512 -opost};
set timeout 10
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set COMMAND [lindex $argv 2]
set DEBUG [lindex $argv 3]
if {[info exists env(USER)]} {
set USERNAME $env(USER)
} else {
set USERNAME "root"
}
set UNM [lindex $argv 4]
if { $UNM != "" && $UNM != "-" } {
set USERNAME "$UNM"
}
set TTY ""
set TTYOPT [lindex $argv 5]
if { $TTYOPT != "" } {
set TTY "-t"
}
log_user $DEBUG
spawn -noecho /bin/bash
#expect -re {[$#] }
if { $PASSWORD == "ssh" } {
set PASSWORD ""
}
#
# send command
#
send "ssh -v $TTY $USERNAME@$SERVER '$COMMAND'\n"
expect {
"cannot access" { exit 1}
"Host key verification failed" { send_user "FAILED: Host key verification failed\n" ; exit 1}
"service not known" { send_user " FAILED: Invalid Host\n" ; exit 1}
"ssh: connect to host" { send_user " FAILED: Invalid Host\n" ; exit 1 }
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"authenticity" { send "yes\n"
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
"command not found" { exit 3 }
# -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
"command not found" { exit 3 }
# -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
"cannot access" { exit 1}
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
"(y or n)" { send "y\n"
"command not found" { exit 3 }
# expect -re {[$#] } { exit 0 }
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"Exit status 3" { exit 1 }
"Exit status 4" { exit 1 }
timeout { exit 2 }
}
}
exit 0

View File

@@ -0,0 +1,58 @@
#!/usr/bin/expect
#
# $Id: remote_commend.sh 421 2007-04-05 15:46:55Z dhill $
#
# Remote command execution script to another server
# Argument 1 - Remote Server Host Name or IP address
# Argument 2 - Remote Server root password
# Argument 3 - Command
set timeout 10
set USERNAME $env(USER)"@"
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set FILE [lindex $argv 2]
set DEBUG [lindex $argv 3]
log_user $DEBUG
spawn -noecho /bin/bash
if { $PASSWORD == "ssh" } {
set PASSWORD ""
}
#
# send command
#
#expect -re {[$#] }
send "scp -v $USERNAME$SERVER:$FILE .\n"
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"100%" { send_user "DONE\n" ; exit 0 }
"authenticity" { send "yes\n"
expect {
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
}
}
"service not known" { send_user "FAILED: Invalid Host\n" ; exit 1 }
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection timed out" { send_user "FAILED: Connection timed out\n" ; exit 1 }
"lost connection" { send_user "FAILED: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
"word: " { send "$PASSWORD\n" }
"passphrase" { send "$PASSWORD\n" }
"scp:" { send_user "FAILED\n" ; exit 1 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
"100%" { send_user "DONE\n" ; exit 0 }
"scp:" { send_user "FAILED\n" ; exit 1 }
"Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
"No such file or directory" { send_user "FAILED: No such file or directory\n" ; exit 1 }
"Connection refused" { send_user "ERROR: Connection refused\n" ; exit 1 }
"Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
}
exit 0

View File

@@ -0,0 +1,57 @@
#!/usr/bin/expect
#
# $Id: remote_commend.sh 421 2007-04-05 15:46:55Z dhill $
#
# Remote command execution script to another server
# Argument 1 - Remote Server Host Name or IP address
# Argument 2 - Remote Server root password
# Argument 3 - Command
set timeout 30
set USERNAME $env(USER)"@"
set SERVER [lindex $argv 0]
set PASSWORD [lindex $argv 1]
set FILE [lindex $argv 2]
set DEBUG [lindex $argv 3]
log_user $DEBUG
spawn -noecho /bin/bash
if { $PASSWORD == "ssh" } {
set PASSWORD ""
}
#
# send command
#
send "scp -v $FILE $USERNAME$SERVER:$FILE\n"
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
-re "100%" { send_user "DONE\n" ; sleep 2; exit 0 }
-re "authenticity" { send "yes\n"
expect {
-re "word: " { send "$PASSWORD\n" }
-re "passphrase" { send "$PASSWORD\n" }
}
}
-re "service not known" { send_user "FAILED: Invalid Host\n" ; exit 1 }
-re "Connection refused" { send_user "FAILED: Connection refused\n" ; exit 1 }
-re "Connection timed out" { send_user "FAILED: Connection timed out\n" ; exit 1 }
-re "lost connection" { send_user "FAILED: Connection refused\n" ; exit 1 }
-re "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
-re "word: " { send "$PASSWORD\n" }
-re "passphrase" { send "$PASSWORD\n" }
-re "WARNING:" { send "rm -f /root/.ssh/known_hosts" ; exit 1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
}
expect {
"Exit status 0" { exit 0 }
"Exit status 1" { exit 1 }
-re "100%" { send_user "DONE\n" ; sleep 2 ; exit 0 }
-re "scp:" { send_user "FAILED\n" ; exit 1 }
-re "Permission denied, please try again" { send_user "FAILED: Invalid password\n" ; exit 1 }
-re "No such file or directory" { send_user "FAILED: Invalid file\n" ; exit 1 }
-re "Connection refused" { send_user "FAILED: Connection refused\n" ; exit 1 }
-re "Connection closed" { send_user "ERROR: Connection closed\n" ; exit 1 }
}
exit 0

View File

@@ -0,0 +1,40 @@
#!/bin/sh
#
detectOS () {
checkFile1=/etc/os-release
checkFile2=/etc/centos-release
if [ -f "$checkFile1" ]
then
osPrettyName=`cat $checkFile1 | grep PRETTY_NAME|awk -F"=" '{print $2}'`
osVersionID=`cat $checkFile1 | grep VERSION_ID | awk -F"=" '{print $2}' | awk -F"." '{print $1}' | sed 's/"//g'`
else
osPrettyName=`head -n 1 $checkFile2`
osVersionID=`echo $osPrettyName | awk -F" " '{print $3}' | awk -F"." '{print $1}'`
fi
#
osName=`echo $osPrettyName | awk -F" " '{print $1}' | sed 's/"//g'`
if [ -z "$osPrettyName" ]
then
osPrettyName=`uname -o -s -r -v`
fi
if [ -z "$osName" ] || [ -z "$osVersionID" ]
then
osTag=""
else
osTag=`echo $osName$osVersionID | awk '{print tolower($0)}'`
fi
}
#
detectOS
echo Operating System name: $osPrettyName
echo Operating System tag: $osTag
case "$osTag" in
centos6|centos7|ubuntu16|debian8|suse12)
;;
*)
echo OS not supported
exit 1
;;
esac
exit 0