File tree Expand file tree Collapse file tree 2 files changed +4
-44
lines changed
Expand file tree Collapse file tree 2 files changed +4
-44
lines changed Original file line number Diff line number Diff line change 146146echo " Starting restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT "
147147ghe_remote_logger " Starting restore from $( hostname) / snapshot $GHE_RESTORE_SNAPSHOT ..."
148148
149+ # Update remote restore state file and setup failure trap
150+ trap " update_restore_status failed" EXIT
151+ update_restore_status " restoring"
152+
149153# Verify the host has been fully configured at least once if when running
150154# against v11.10.x appliances and the -c option wasn't specified.
151155if [ " $GHE_VERSION_MAJOR " -le 1 ] && ! $restore_settings && ! $instance_configured ; then
@@ -172,16 +176,6 @@ if $instance_configured; then
172176 fi
173177fi
174178
175- # Make sure the appliance doesn't already have a restore underway
176- if [ " $GHE_VERSION_MAJOR " -ge 2 ] && ghe-ssh " $GHE_HOSTNAME " -- " sudo grep -q restoring $GHE_REMOTE_DATA_USER_DIR /common/ghe-restore-status 2>/dev/null" ; then
177- echo " Error: $GHE_HOSTNAME already has a restore underway. Aborting." 1>&2
178- exit 1
179- fi
180-
181- # Update remote restore state file and setup failure trap
182- trap " update_restore_status failed" EXIT
183- update_restore_status " restoring"
184-
185179# Restore settings and license if restoring to an unconfigured appliance or when
186180# specified manually.
187181if $restore_settings ; then
Original file line number Diff line number Diff line change @@ -410,37 +410,3 @@ begin_test "ghe-restore with tarball strategy"
410410 echo " $output " | grep -q ' fake ghe-export-repositories data'
411411)
412412end_test
413-
414- begin_test " ghe-restore aborts when another restore is underway"
415- (
416- set -e
417- # This test is only valid for version 2 and above
418- if [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
419- rm -rf " $GHE_REMOTE_ROOT_DIR "
420- setup_remote_metadata
421-
422- # create file used to determine if instance has been configured.
423- touch " $GHE_REMOTE_ROOT_DIR /etc/github/configured"
424-
425- # create file used to determine if instance is in maintenance mode.
426- mkdir -p " $GHE_REMOTE_DATA_DIR /github/current/public/system"
427- touch " $GHE_REMOTE_DATA_DIR /github/current/public/system/maintenance.html"
428-
429- # create file to indicate restore is underway
430- echo " restoring" > " $GHE_REMOTE_DATA_USER_DIR /common/ghe-restore-status"
431-
432- # set restore host environ var
433- GHE_RESTORE_HOST=127.0.0.1
434- export GHE_RESTORE_HOST
435-
436- # run ghe-restore and write output to file for asserting against
437- # this should fail due to the appliance being in an unconfigured state
438- ! ghe-restore -v > " $TRASHDIR /restore-out" 2>&1
439-
440- cat $TRASHDIR /restore-out
441-
442- # verify that ghe-restore failed due a restore already being underway
443- grep -q -e " already has a restore underway" " $TRASHDIR /restore-out"
444- fi
445- )
446- end_test
You can’t perform that action at this time.
0 commit comments