Commit 345deb3 1 parent 845c8da commit 345deb3 Copy full SHA for 345deb3
File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 15
15
# under the License.
16
16
17
17
source ./tests/rest_scripts/rest.sh
18
+ source ./tests/util/util_file.sh
18
19
19
20
# Fields
20
21
@@ -113,7 +114,7 @@ Content-Length: 66824
113
114
}
114
115
115
116
get_file_size_and_content_length () {
116
- if ! file_size=$( stat -f %z " $data_file " 2>&1 ) ; then
117
+ if ! file_size=$( get_file_size " $data_file " ) ; then
117
118
log_rest 2 " error getting file size: $file_size "
118
119
return 1
119
120
fi
Original file line number Diff line number Diff line change @@ -102,6 +102,26 @@ delete_test_files() {
102
102
return 0
103
103
}
104
104
105
+ get_file_size () {
106
+ if [ $# -ne 1 ]; then
107
+ log 2 " 'get_file_size' requires file location"
108
+ return 1
109
+ fi
110
+ local file_size=" "
111
+ if [[ " $OSTYPE " == " darwin" * ]]; then
112
+ if ! file_size=$( stat -f %z " $1 " 2>&1 ) ; then
113
+ log 2 " error getting file size: $file_size "
114
+ return 1
115
+ fi
116
+ else
117
+ if ! file_size=$( stat -c %s " $1 " 2>&1 ) ; then
118
+ log 2 " error getting file size: $file_size "
119
+ return 1
120
+ fi
121
+ fi
122
+ echo " $file_size "
123
+ }
124
+
105
125
# split file into pieces to test multipart upload
106
126
# param: file location
107
127
# return 0 for success, 1 for error
You can’t perform that action at this time.
0 commit comments