@@ -31,6 +31,16 @@ test_dir="${script_dir}/test"
3131test_compose_config=" ${test_dir} /docker-compose.yaml"
3232test_compose_project=" ngt"
3333
34+ is_windows=" 0"
35+ if [ -z " ${OS} " ] && [ " ${OS} " == " Windows_NT" ]; then
36+ is_windows=" 1"
37+ elif command -v uname > /dev/null; then
38+ uname_output=" $( uname -s) "
39+ if [[ " ${uname_output} " == * " _NT-" * ]]; then
40+ is_windows=" 1"
41+ fi
42+ fi
43+
3444p () {
3545 printf " \033[34;1m▶\033[0m "
3646 echo " $1 "
@@ -164,6 +174,15 @@ integration_test() {
164174 printf " \033[34;1m▶\033[0m"
165175 printf " \e[1m Integration test suite with APPEND_SLASH_FOR_POSSIBLE_DIRECTORY=%s\e[22m\n" " $4 "
166176
177+
178+ # Write problematic files to disk if we are not on Windows. Originally,
179+ # these files were checked in, but that prevented the git repository from
180+ # being cloned on Windows machines.
181+ if [ " $is_windows " == " 0" ]; then
182+ echo " Writing weird filename: ${test_dir} /data/bucket-1/a/%@!*()=$# ^&|.txt"
183+ echo ' We are but selling water next to a river.' > " ${test_dir} " ' /data/bucket-1/a/%@!*()=$#^&|.txt'
184+ fi
185+
167186 # See if Minio is already running, if it isn't then we don't need to build it
168187 # COMPOSE_COMPATIBILITY=true Supports older style compose filenames with _ vs -
169188
@@ -285,7 +304,7 @@ runUnitTestWithOutSessionToken() {
285304 -e " S3_REGION=test-1" \
286305 -e " AWS_SIGS_VERSION=4" \
287306 --entrypoint /usr/bin/njs \
288- nginx-s3-gateway -t module -p ' /etc/nginx' /var/tmp/" ${test_code} "
307+ nginx-s3-gateway -t module -p ' /etc/nginx' /var/tmp/" ${test_code} "
289308}
290309
291310runUnitTestWithSessionToken () {
@@ -309,7 +328,7 @@ runUnitTestWithSessionToken() {
309328 -e " S3_REGION=test-1" \
310329 -e " AWS_SIGS_VERSION=4" \
311330 --entrypoint /usr/bin/njs \
312- nginx-s3-gateway -t module -p ' /etc/nginx' /var/tmp/" ${test_code} "
331+ nginx-s3-gateway -t module -p ' /etc/nginx' /var/tmp/" ${test_code} "
313332}
314333
315334p " Running unit tests for utils"
0 commit comments