Skip to content

Commit 015c54a

Browse files
committed
Dev: run-functional-tests: "-S" option skips the cluster start right after the node creation
1 parent 82b1b4e commit 015c54a

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

test/run-functional-tests

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ OPTIONS:
120120
-d Cleanup the cluster containers
121121
-u Run test as a normal user like in Public Cloud, eg. Azure
122122
-q Create a qnetd node(with -n and -x option, and named 'qnetd-node')
123+
-S Not start cluster right after creating the cluster node
123124
124125
EXAMPLES:
125126
To launch 2 nodes with the running cluster with the very basic corosync.conf
@@ -335,11 +336,8 @@ config_cluster() {
335336
}
336337

337338

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

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

354352

353+
start_cluster() {
354+
if [ ${#hanode_list_current_cluster[@]} -ne 0 ] && [ ${#hanode_list_new_members[@]} -ne 0 ]; then
355+
podman_exec hanode1 "corosync-cfgtool -R > /dev/null"
356+
info On the existing cluster hanode{1..${#hanode_list_current_cluster[@]}}: reloading corosync.conf ... Done
357+
fi
358+
359+
start_cluster_on_new_nodes
360+
}
361+
362+
355363
search_running_container_by_name() {
356364
podman ps -a --format '{{.Names}}' | grep -q "^$1$"
357365
}
@@ -470,7 +478,8 @@ WITH_QNETD_NODE=0
470478
NORMAL_USER_FLAG=0
471479
CONFIG_COROSYNC_FLAG=1
472480
SETUP_N_NODES_CLUSTER=0
473-
options=$(getopt -l "help" -o "hldxuqn:" -- "$@")
481+
START_CLUSTER_NOW=1
482+
options=$(getopt -l "help" -o "hldxuqn:S" -- "$@")
474483
eval set -- "$options"
475484
while true;do
476485
case $1 in
@@ -501,6 +510,10 @@ case $1 in
501510
SETUP_N_NODES_CLUSTER=$1
502511
shift
503512
;;
513+
-S)
514+
START_CLUSTER_NOW=0
515+
shift
516+
;;
504517
--)
505518
shift
506519
break

0 commit comments

Comments
 (0)