Commit 261a04d2 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent cc24dad4
...@@ -3,20 +3,21 @@ ...@@ -3,20 +3,21 @@
# ---- deploy NEO for tests/benchmarks at a node ---- # ---- deploy NEO for tests/benchmarks at a node ----
# deploy [user@]<host>:<path> - deploy NEO & needed software for tests there # cmd_deploy [user@]<host>:<path> - deploy NEO & needed software for tests there
# ssh-key or password for access should be available # ssh-key or password for access should be available
deploy() { cmd_deploy() {
host=`echo $1 |sed -e 's/:[^:]*$//'` # user@host host=`echo $1 |sed -e 's/:[^:]*$//'` # user@host
path=${1:$((${#host} + 1))} # path path=${1:$((${#host} + 1))} # path
test -z "$host" -o -z "$path" && echo 1>&2 "invalid URL" && exit 1 test -z "$host" -o -z "$path" && echo 1>&2 "Usage: neotest deploy [user@]<host>:<path>" && exit 1
echo -e "\n*** deploying to $@ ..." echo -e "\n*** deploying to $@ ..."
scp $0 $host:neotest scp $0 $host:neotest
ssh $host ./neotest deploy-local "$path" ssh $host ./neotest deploy-local "$path"
} }
# deploy_local <path> - deploy NEO & needed software for tests @path # cmd_deploy_local <path> - deploy NEO & needed software for tests @path
deploy_local() { cmd_deploy_local() {
path=$1 path=$1
test-z "$path" && echo 1>&2 "Usage: neotest deploy-local
test -e $path/deployed && echo "# already deployed" && return test -e $path/deployed && echo "# already deployed" && return
mkdir -p $path mkdir -p $path
cd $path cd $path
...@@ -62,13 +63,13 @@ EOF ...@@ -62,13 +63,13 @@ EOF
case "$1" in case "$1" in
deploy) deploy)
shift shift
deploy "$@" cmd_deploy "$@"
exit exit
;; ;;
deploy-local) deploy-local)
shift shift
deploy_local "$@" cmd_deploy_local "$@"
exit exit
;; ;;
esac esac
...@@ -114,7 +115,8 @@ xmysql() { ...@@ -114,7 +115,8 @@ xmysql() {
} }
# if we are abnormally terminating # if we are abnormally terminating
trap 'set +e install_trap() {
trap 'set +e
echo "E: abnormal termination - stopping..." echo "E: abnormal termination - stopping..."
xneoctl set cluster stopping xneoctl set cluster stopping
sleep 1 sleep 1
...@@ -125,6 +127,7 @@ test -z "$j" && exit ...@@ -125,6 +127,7 @@ test -z "$j" && exit
echo "E: killing left jobs..." echo "E: killing left jobs..."
jobs -l jobs -l
kill $j' EXIT kill $j' EXIT
}
# ---- start NEO nodes ---- # ---- start NEO nodes ----
...@@ -409,8 +412,13 @@ bench_go() { ...@@ -409,8 +412,13 @@ bench_go() {
} }
# benchmark when client and storage are on the same computer # command: benchmark when client and storage are on the same computer
bench_local() { cmd_bench_local() {
install_trap
header
gen_data
echo -e "\n*** FileStorage" echo -e "\n*** FileStorage"
bench $fs1/data.fs bench $fs1/data.fs
...@@ -444,13 +452,42 @@ bench_local() { ...@@ -444,13 +452,42 @@ bench_local() {
X_NEOGO_SHA1_SKIP=y bench_go neo://$cluster@$Mbind X_NEOGO_SHA1_SKIP=y bench_go neo://$cluster@$Mbind
xneoctl set cluster stopping xneoctl set cluster stopping
wait wait
# all ok
trap - EXIT
exit
} }
# ---- main driver ---- # ---- main driver ----
header
gen_data
bench_local
# all ok usage() {
trap - EXIT cat 1>&2 << 'EOF'
exit Neotest is a tool to functionally test and benchmark NEO.
Usage:
neotest command [arguments]
The commands are:
bench-local run benchmarks when client and server are on the same host
deploy deploy NEO & needed software for tests to remote host
deploy-local deploy NEO & needed software for tests locally
EOF
}
case "$1" in
bench-local)
cmd_bench_local
;;
-h)
usage
exit 0
;;
*)
usage
exit 1
;;
esac
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment