Skip to content

Commit bf9332e

Browse files
committed
added back test changes
1 parent bb9a449 commit bf9332e

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

test/test-ghe-restore.sh

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ setup_test_data "$GHE_DATA_DIR/1"
535535
# Make the current symlink
536536
ln -s 1 "$GHE_DATA_DIR/current"
537537

538-
begin_test "ghe-restore cluster"
538+
begin_test "ghe-restore cluster with matching node versions"
539539
(
540540
set -e
541541
rm -rf "$GHE_REMOTE_ROOT_DIR"
@@ -598,6 +598,32 @@ begin_test "ghe-restore cluster"
598598
)
599599
end_test
600600

601+
begin_test "ghe-restore cluster with different node versions should fail at ghe-host-check"
602+
(
603+
set -e
604+
rm -rf "$GHE_REMOTE_ROOT_DIR"
605+
setup_moreutils_parallel
606+
setup_remote_metadata
607+
setup_remote_cluster
608+
echo "cluster" > "$GHE_DATA_DIR/current/strategy"
609+
610+
# set that versions should not match for this test
611+
DIFFERENT_VERSIONS=1
612+
export DIFFERENT_VERSIONS
613+
614+
# set as configured, enable maintenance mode and create required directories
615+
setup_maintenance_mode "configured"
616+
617+
# set restore host environ var
618+
GHE_RESTORE_HOST=127.0.0.1
619+
export GHE_RESTORE_HOST
620+
621+
! output=$(ghe-restore -v -f 2>&1)
622+
623+
echo "$output" | grep -q "Error: Not all nodes are running the same version! Please ensure all nodes are running the same version before using backup-utils."
624+
)
625+
end_test
626+
601627
begin_test "ghe-restore missing directories or files from source snapshot displays warning"
602628
(
603629
# Tests the scenario where something exists in the database, but not on disk.

0 commit comments

Comments
 (0)