Skip to content

Commit

Permalink
Dev: run-functional-tests: "-S" option skips the cluster start right …
Browse files Browse the repository at this point in the history
…after the node creation
  • Loading branch information
zzhou1 committed Nov 25, 2024
1 parent 82b1b4e commit 015c54a
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions test/run-functional-tests
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ OPTIONS:
-d Cleanup the cluster containers
-u Run test as a normal user like in Public Cloud, eg. Azure
-q Create a qnetd node(with -n and -x option, and named 'qnetd-node')
-S Not start cluster right after creating the cluster node
EXAMPLES:
To launch 2 nodes with the running cluster with the very basic corosync.conf
Expand Down Expand Up @@ -335,11 +336,8 @@ config_cluster() {
}


start_cluster() {
if [ ${#hanode_list_current_cluster[@]} -ne 0 ] && [ ${#hanode_list_new_members[@]} -ne 0 ]; then
podman_exec hanode1 "corosync-cfgtool -R > /dev/null"
info On the existing cluster hanode{1..${#hanode_list_current_cluster[@]}}: reloading corosync.conf ... Done
fi
start_cluster_on_new_nodes() {
[ "$START_CLUSTER_NOW" -eq 0 ] && return

for node in ${hanode_list_new_members[@]};do
podman_exec $node "crm cluster enable && crm cluster start" 1> /dev/null
Expand All @@ -352,6 +350,16 @@ start_cluster() {
}


start_cluster() {
if [ ${#hanode_list_current_cluster[@]} -ne 0 ] && [ ${#hanode_list_new_members[@]} -ne 0 ]; then
podman_exec hanode1 "corosync-cfgtool -R > /dev/null"
info On the existing cluster hanode{1..${#hanode_list_current_cluster[@]}}: reloading corosync.conf ... Done
fi

start_cluster_on_new_nodes
}


search_running_container_by_name() {
podman ps -a --format '{{.Names}}' | grep -q "^$1$"
}
Expand Down Expand Up @@ -470,7 +478,8 @@ WITH_QNETD_NODE=0
NORMAL_USER_FLAG=0
CONFIG_COROSYNC_FLAG=1
SETUP_N_NODES_CLUSTER=0
options=$(getopt -l "help" -o "hldxuqn:" -- "$@")
START_CLUSTER_NOW=1
options=$(getopt -l "help" -o "hldxuqn:S" -- "$@")
eval set -- "$options"
while true;do
case $1 in
Expand Down Expand Up @@ -501,6 +510,10 @@ case $1 in
SETUP_N_NODES_CLUSTER=$1
shift
;;
-S)
START_CLUSTER_NOW=0
shift
;;
--)
shift
break
Expand Down

0 comments on commit 015c54a

Please sign in to comment.