Skip to content

Commit 9231e35

Browse files
committed
make bash test compatible with Windows
1 parent 3b2b4a1 commit 9231e35

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

regress/scp.sh

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ for mode in scp sftp ; do
5858

5959
verbose "$tag: simple copy remote file to local file"
6060
scpclean
61-
$SCP "${scpopts[@]}" somehost:${DATA} ${COPY} || fail "copy failed"
61+
$SCP -vvv "${scpopts[@]}" somehost:${DATA} ${COPY} || fail "copy failed"
6262
cmp ${DATA} ${COPY} || fail "corrupted copy"
6363

6464
# In place tests will not work on Windows because of simultaneous read of/write to file
@@ -88,31 +88,6 @@ for mode in scp sftp ; do
8888
$SCP "${scpopts[@]}" somehost:${DATA} ${COPY} || fail "copy failed"
8989
cmp ${DATA} ${COPY} || fail "corrupted copy"
9090

91-
verbose "$tag: copy local file to remote file in place"
92-
scpclean
93-
cp ${DATA} ${COPY}
94-
$SCP $scpopts ${COPY} somehost:${COPY} || fail "copy failed"
95-
cmp ${DATA} ${COPY} || fail "corrupted copy"
96-
97-
verbose "$tag: copy remote file to local file in place"
98-
scpclean
99-
cp ${DATA} ${COPY}
100-
$SCP $scpopts somehost:${COPY} ${COPY} || fail "copy failed"
101-
cmp ${DATA} ${COPY} || fail "corrupted copy"
102-
103-
verbose "$tag: copy local file to remote file clobber"
104-
scpclean
105-
cat ${DATA} ${DATA} > ${COPY}
106-
$SCP $scpopts ${DATA} somehost:${COPY} || fail "copy failed"
107-
ls -l $DATA $COPY
108-
cmp ${DATA} ${COPY} || fail "corrupted copy"
109-
110-
verbose "$tag: copy remote file to local file clobber"
111-
scpclean
112-
cat ${DATA} ${DATA} > ${COPY}
113-
$SCP $scpopts somehost:${DATA} ${COPY} || fail "copy failed"
114-
cmp ${DATA} ${COPY} || fail "corrupted copy"
115-
11691
verbose "$tag: simple copy local file to remote dir"
11792
scpclean
11893
cp ${DATA} ${COPY}
@@ -154,26 +129,26 @@ for mode in scp sftp ; do
154129

155130
verbose "$tag: unmatched glob file local->remote"
156131
scpclean
157-
$SCP $scpopts ${DATA} somehost:${COPY3} || fail "copy failed"
132+
$SCP "${scpopts[@]}" ${DATA} somehost:${COPY3} || fail "copy failed"
158133
cmp ${DATA} ${COPY3} || fail "corrupted copy"
159134

160135
verbose "$tag: unmatched glob file remote->local"
161136
# NB. no clean
162-
$SCP $scpopts somehost:${COPY3} ${COPY2} || fail "copy failed"
137+
$SCP "${scpopts[@]}" somehost:${COPY3} ${COPY2} || fail "copy failed"
163138
cmp ${DATA} ${COPY2} || fail "corrupted copy"
164139

165140
verbose "$tag: unmatched glob dir recursive local->remote"
166141
scpclean
167142
rm -rf ${DIR3}
168143
cp ${DATA} ${DIR}/copy
169144
cp ${DATA} ${DIR}/copy.glob[1234]
170-
$SCP $scpopts -r ${DIR} somehost:${DIR3} || fail "copy failed"
145+
$SCP "${scpopts[@]}" -r ${DIR} somehost:${DIR3} || fail "copy failed"
171146
diff ${DIFFOPT} ${DIR} ${DIR3} || fail "corrupted copy"
172147

173148
verbose "$tag: unmatched glob dir recursive remote->local"
174149
# NB. no clean
175150
rm -rf ${DIR2}
176-
$SCP $scpopts -r somehost:${DIR3} ${DIR2} || fail "copy failed"
151+
$SCP "${scpopts[@]}" -r somehost:${DIR3} ${DIR2} || fail "copy failed"
177152
diff ${DIFFOPT} ${DIR} ${DIR2} || fail "corrupted copy"
178153

179154
verbose "$tag: shell metacharacters"
@@ -237,5 +212,5 @@ for mode in scp sftp ; do
237212
cmp ${COPY} ${COPY2} >/dev/null && fail "corrupt target"
238213
done
239214

240-
scpclean
215+
#scpclean
241216
rm -f ${OBJ}/scp-ssh-wrapper.scp

0 commit comments

Comments
 (0)