File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,9 @@ if [ $rc -ne 0 ]; then
85
85
exit $rc
86
86
fi
87
87
88
- CLUSTER=false
88
+ if [ -z " $CLUSTER " ]; then
89
+ CLUSTER=false
90
+ fi
89
91
if ghe-ssh " $host " -- \
90
92
" [ -f '$GHE_REMOTE_ROOT_DIR /etc/github/cluster' ]" ; then
91
93
CLUSTER=true
117
119
118
120
NON_WRITABLE=" "
119
121
# ensure all nodes are writable
120
- if " $CLUSTER " ; then
122
+ if [ " $CLUSTER " == " true " ] ; then
121
123
if [ -z " $FILE_TO_TEST " ]; then
122
124
if [ -d " /data/user/tmp" ]; then
123
125
FILE_TO_TEST=" /data/user/tmp/test-ro-file.txt"
@@ -164,7 +166,7 @@ if [ -n "$GHE_RESTORE_SNAPSHOT_PATH" ]; then
164
166
fi
165
167
166
168
if [ -z " $GHE_ALLOW_REPLICA_BACKUP " ]; then
167
- if [ " $( ghe-ssh $host -- cat $GHE_REMOTE_ROOT_DIR /etc/github/repl-state 2> /dev/null || true) " = " replica" ]; then
169
+ if [ " $( ghe-ssh $host -- cat $GHE_REMOTE_ROOT_DIR /etc/github/repl-state1 2> /dev/null || true) " = " replica" ]; then
168
170
echo " Error: high availability replica detected." 1>&2
169
171
echo " Backup Utilities should be used to backup from the primary node in" 1>&2
170
172
echo " high availability environments to ensure consistent and reliable backups." 1>&2
Original file line number Diff line number Diff line change @@ -129,7 +129,12 @@ begin_test "ghe-host-check fails when encountering RO file-system"
129
129
(
130
130
set -e
131
131
132
- enable_ro_fs
133
- ! FILE_TO_TEST=/run/user/501/test ghe-host-check
132
+ ghe-ssh " $GHE_HOSTNAME " -- ' mkdir -p "~/tmp"'
133
+ # Remove write access in ~/tmp
134
+ ghe-ssh " $GHE_HOSTNAME " -- ' chmod a-w -R "~/tmp"'
135
+
136
+ # File creation fails for CLUSTER
137
+ ! FILE_TO_TEST=" ~/tmp/test" CLUSTER=true ghe-host-check
138
+ FILE_TO_TEST=" ~/tmp/test" CLUSTER=false ghe-host-check
134
139
)
135
140
end_test
You can’t perform that action at this time.
0 commit comments