Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(test): remove useless upgrade_test #1171

Merged
merged 2 commits into from
Sep 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 0 additions & 246 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1372,236 +1372,6 @@ function run_clear_kill_test()
rm -rf kill_history.txt *.data config-*.ini &>/dev/null
}

#####################
## start_upgrade_test
#####################
function usage_start_upgrade_test()
{
echo "Options for subcommand 'start_upgrade_test':"
echo " -h|--help print the help info"
echo " -m|--meta_count <num>"
echo " meta server count, default is 3"
echo " -r|--replica_count <num>"
echo " replica server count, default is 5"
echo " -a|--app_name <str>"
echo " app name, default is temp"
echo " -p|--partition_count <num>"
echo " app partition count, default is 16"
echo " --upgrade_type <str>"
echo " upgrade type: meta | replica | all, default is all"
echo " -o|--old_version_path <str>"
echo " old server binary and library path"
echo " -n|--new_version_path <str>"
echo " new server binary and library path"
echo " -s|--sleep_time <num>"
echo " max sleep time before next update, default is 10"
echo " actual sleep time will be a random value in range of [1, sleep_time]"
echo " -w|--worker_count <num>"
echo " worker count for concurrently setting value, default is 10"
}

function run_start_upgrade_test()
{
META_COUNT=3
REPLICA_COUNT=5
APP_NAME=temp
PARTITION_COUNT=16
UPGRADE_TYPE=replica
OLD_VERSION_PATH=
NEW_VERSION_PATH=
SLEEP_TIME=10
THREAD_COUNT=10
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_start_upgrade_test
exit 0
;;
-m|--meta_count)
META_COUNT="$2"
shift
;;
-r|--replica_count)
REPLICA_COUNT="$2"
shift
;;
-a|--app_name)
APP_NAME="$2"
shift
;;
-p|--partition_count)
PARTITION_COUNT="$2"
shift
;;
-t|--upgrade_type)
UPGRADE_TYPE="$2"
shift
;;
-o|--old_version_path)
OLD_VERSION_PATH="${ROOT}/$2"
shift
;;
-n|--new_version_path)
NEW_VERSION_PATH="${ROOT}/$2"
shift
;;
-s|--sleep_time)
SLEEP_TIME="$2"
shift
;;
-w|--worker_count)
THREAD_COUNT="$2"
shift
;;
*)
echo "ERROR: unknown option \"$key\""
echo
usage_start_upgrade_test
exit 1
;;
esac
shift
done

run_start_onebox -m $META_COUNT -r $REPLICA_COUNT -a $APP_NAME -p $PARTITION_COUNT -s $OLD_VERSION_PATH
echo

cd $ROOT
CONFIG=config-upgrade-test.ini

sed "s/@LOCAL_HOSTNAME@/${LOCAL_HOSTNAME}/g;\
s/@META_COUNT@/${META_COUNT}/g;\
s/@REPLICA_COUNT@/${REPLICA_COUNT}/g;\
s/@ZK_COUNT@/1/g;s/@APP_NAME@/${APP_NAME}/g;\
s/@SET_THREAD_COUNT@/${THREAD_COUNT}/g;\
s/@GET_THREAD_COUNT@/${THREAD_COUNT}/g;\
s+@ONEBOX_RUN_PATH@+`pwd`+g; \
s+@OLD_VERSION_PATH@+${OLD_VERSION_PATH}+g;\
s+@NEW_VERSION_PATH@+${NEW_VERSION_PATH}+g " ${ROOT}/src/test/upgrade_test/config.ini >$CONFIG

# start verifier
mkdir -p onebox/verifier && cd onebox/verifier
ln -s -f ${DSN_ROOT}/bin/pegasus_upgrade_test/pegasus_upgrade_test
ln -s -f ${ROOT}/$CONFIG config.ini
echo "./pegasus_upgrade_test config.ini verifier &>/dev/null &"
./pegasus_upgrade_test config.ini verifier &>/dev/null &
sleep 0.2
echo
cd ${ROOT}

#start upgrader
mkdir -p onebox/upgrader && cd onebox/upgrader
ln -s -f ${DSN_ROOT}/bin/pegasus_upgrade_test/pegasus_upgrade_test
ln -s -f ${ROOT}/$CONFIG config.ini
echo "./pegasus_upgrade_test config.ini upgrader &>/dev/null &"
./pegasus_upgrade_test config.ini upgrader &>/dev/null &
sleep 0.2
echo
cd ${ROOT}

run_list_upgrade_test
}

#####################
## stop_upgrade_test
#####################
function usage_stop_upgrade_test()
{
echo "Options for subcommand 'stop_upgrade_test':"
echo " -h|--help print the help info"
}

function run_stop_upgrade_test()
{
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_stop_upgrade_test
exit 0
;;
*)
echo "ERROR: unknown option \"$key\""
echo
usage_stop_upgrade_test
exit 1
;;
esac
shift
done

ps -ef | grep ' \./pegasus_upgrade_test ' | awk '{print $2}' | xargs kill &>/dev/null || true
run_stop_onebox
}

#####################
## list_upgrade_test
#####################
function usage_list_upgrade_test()
{
echo "Options for subcommand 'list_upgrade_test':"
echo " -h|--help print the help info"
}

function run_list_upgrade_test()
{
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_list_upgrade_test
exit 0
;;
*)
echo "ERROR: unknown option \"$key\""
echo
usage_list_upgrade_test
exit 1
;;
esac
shift
done
echo "------------------------------"
run_list_onebox
ps -ef | grep ' \./pegasus_upgrade_test ' | grep -v grep
echo "------------------------------"
echo "Server dir: ./onebox"
echo "------------------------------"
}

#####################
## clear_upgrade_test
#####################
function usage_clear_upgrade_test()
{
echo "Options for subcommand 'clear_upgrade_test':"
echo " -h|--help print the help info"
}

function run_clear_upgrade_test()
{
while [[ $# > 0 ]]; do
key="$1"
case $key in
-h|--help)
usage_clear_upgrade_test
exit 0
;;
*)
echo "ERROR: unknown option \"$key\""
echo
usage_clear_upgrade_test
exit 1
;;
esac
shift
done
run_stop_upgrade_test
run_clear_onebox
rm -rf upgrade_history.txt *.data config-*.ini &>/dev/null
}

#####################
## bench
#####################
Expand Down Expand Up @@ -2103,22 +1873,6 @@ case $cmd in
shift
run_clear_kill_test $*
;;
start_upgrade_test)
shift
run_start_upgrade_test $*
;;
stop_upgrade_test)
shift
run_stop_upgrade_test $*
;;
list_upgrade_test)
shift
run_list_upgrade_test $*
;;
clear_upgrade_test)
shift
run_clear_upgrade_test $*
;;
bench)
shift
run_bench $*
Expand Down
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ add_subdirectory(geo)
add_subdirectory(redis_protocol)
add_subdirectory(test/function_test)
add_subdirectory(test/kill_test)
add_subdirectory(test/upgrade_test)
add_subdirectory(test/pressure_test)
add_subdirectory(test/bench_test)
51 changes: 0 additions & 51 deletions src/test/upgrade_test/CMakeLists.txt

This file was deleted.

Loading