Skip to content

Commit 0e6e12b

Browse files
committed
Add integration tests for symbols/unicode
Signed-off-by: Elijah Zupancic <[email protected]>
1 parent 836f014 commit 0e6e12b

File tree

5 files changed

+47
-0
lines changed

5 files changed

+47
-0
lines changed

test/data/bucket-1/a/%@!*()=$#^&|.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
We are but selling water next to a river.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"Where the is not one thing, what then?"
2+
"Throw it away!"
3+
"With not one thing, what there is to throw away?"
4+
"Then carry it off!"

test/data/bucket-1/a/plus+plus.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
代悲白頭翁   Lament for the White-Haired Old Man
2+
洛陽城東桃李花 In the east of Luoyang City, Peach blossoms abound
3+
飛來飛去落誰家 Their petals float around, coming and going, to whose house will they fall?
4+
洛陽女児惜顔色 Girls in Luoyang cherish their complexion
5+
行逢落花長歎息 They breathe a deep sigh upon seeing the petals fall
6+
今年花落顔色改 This year the petals fall and their complexion changes
7+
明年花開復誰在 Who will be there when the flowers bloom next year?
8+
已見松柏摧為薪 I've seen the pines and cypresses destroyed and turned into firewood
9+
更聞桑田変成海 I hear that the mulberry fields have fallen into the sea
10+
古人無復洛城東 The people of old never came back to the east of Luoyang City
11+
今人還對落花風 The people of today likewise face the falling flowers in the wind
12+
年年歳歳花相似 Year after year, flowers look alike
13+
歳歳年年人不同 Year after year, the people are not the same
14+
寄言全盛紅顔子 I want you to get this message, my child, you are in your prime, with a rosy complexion
15+
應憐半死白頭翁 Take pity on the half-dead white-haired old man
16+
此翁白頭真可憐 You really must take pity on this white-haired old man
17+
伊昔紅顔美少年 For once upon a time, I used to be a red-faced handsome young man
18+
公子王孫芳樹下 A child of noble birth under a fragrant tree
19+
清歌妙舞落花前 Singing and dancing in front of the falling petals
20+
光禄池臺開錦繍 At the platform before the mirror pond, beautiful autumn leaves opening all around
21+
将軍楼閣畫神仙 The general’s pavilion is painted with gods and goddesses
22+
一朝臥病無相識 Once I was sick and no one knew me
23+
三春行楽在誰邉 Who will be at the shore for the spring outing?
24+
宛轉蛾眉能幾時 For how long will the moths gracefully turn about?
25+
須臾鶴髪亂如絲 The crane’s feathers are like tangled threads for just a moment
26+
但看古来歌舞地 Yet, look at the ancient places of song and dance
27+
惟有黄昏鳥雀悲 Only in twilight, do the birds lament
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
What name do you use to call out to the emptiness?

test/integration/test_api.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,24 @@ assertHttpRequestEquals "HEAD" "b/c/d.txt" "200"
154154
assertHttpRequestEquals "HEAD" "b/c/../e.txt" "200"
155155
assertHttpRequestEquals "HEAD" "b/e.txt" "200"
156156
assertHttpRequestEquals "HEAD" "b//e.txt" "200"
157+
assertHttpRequestEquals "HEAD" "a/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.txt" "200"
157158

158159
# Weird filenames
159160
assertHttpRequestEquals "HEAD" "b/c/=" "200"
160161
assertHttpRequestEquals "HEAD" "b/c/@" "200"
161162
assertHttpRequestEquals "HEAD" "b/c/'(1).txt" "200"
162163
assertHttpRequestEquals "HEAD" "%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D1%8B/%25bad%25file%25name%25" "200"
164+
assertHttpRequestEquals "HEAD" 'a/plus+plus.txt' "200"
163165
if [ ${is_windows} == "0" ]; then
164166
assertHttpRequestEquals "HEAD" "a/c/あ" "200"
165167
assertHttpRequestEquals "HEAD" "b/クズ箱/ゴミ.txt" "200"
166168
assertHttpRequestEquals "HEAD" "системы/system.txt" "200"
167169
assertHttpRequestEquals "HEAD" "b/ブツブツ.txt" "200"
170+
# The following two objects do not get encoded correctly by curl when requested using their
171+
# unicode names. The are provided as URL encoded as below. This is the same type of encoding
172+
# expected by S3 and divergence from it will not work with nginx either.
173+
assertHttpRequestEquals "HEAD" 'a/%25%40%21%2A%28%29%3D%24%23%5E%26%7C.txt' "200"
174+
assertHttpRequestEquals "HEAD" 'a/%E3%81%93%E3%82%8C%E3%81%AF%E3%80%80This%20is%20ASCII%20%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D1%8B%20%20%D7%97%D7%9F%20.txt' "200"
168175
fi
169176

170177
# Expected 400s
@@ -219,18 +226,25 @@ fi
219226

220227
# Verify GET is working
221228
assertHttpRequestEquals "GET" "a.txt" "data/bucket-1/a.txt"
229+
assertHttpRequestEquals "GET" "a/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.txt" "data/bucket-1/a/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.txt"
222230
assertHttpRequestEquals "GET" "a.txt?some=param&that=should&be=stripped#aaah" "data/bucket-1/a.txt"
223231
assertHttpRequestEquals "GET" "b/c/d.txt" "data/bucket-1/b/c/d.txt"
224232
assertHttpRequestEquals "GET" "b/c/=" "data/bucket-1/b/c/="
225233
assertHttpRequestEquals "GET" "b/c/'(1).txt" "data/bucket-1/b/c/'(1).txt"
226234
assertHttpRequestEquals "GET" "b/e.txt" "data/bucket-1/b/e.txt"
227235
assertHttpRequestEquals "GET" "%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D1%8B/%25bad%25file%25name%25" "data/bucket-1/системы/%bad%file%name%"
236+
assertHttpRequestEquals "GET" 'a/plus+plus.txt' "data/bucket-1/a/plus+plus.txt"
228237

229238
if [ ${is_windows} == "0" ]; then
230239
assertHttpRequestEquals "GET" "a/c/あ" "data/bucket-1/a/c/あ"
231240
assertHttpRequestEquals "GET" "b/ブツブツ.txt" "data/bucket-1/b/ブツブツ.txt"
232241
assertHttpRequestEquals "GET" "b/クズ箱/ゴミ.txt" "data/bucket-1/b/クズ箱/ゴミ.txt"
233242
assertHttpRequestEquals "GET" "системы/system.txt" "data/bucket-1/системы/system.txt"
243+
# The following two objects do not get encoded correctly by curl when requested using their
244+
# unicode names. The are provided as URL encoded as below. This is the same type of encoding
245+
# expected by S3 and divergence from it will not work with nginx either.
246+
assertHttpRequestEquals "GET" 'a/%25%40%21%2A%28%29%3D%24%23%5E%26%7C.txt' 'data/bucket-1/a/%@!*()=$#^&|.txt'
247+
assertHttpRequestEquals "GET" 'a/%E3%81%93%E3%82%8C%E3%81%AF%E3%80%80This%20is%20ASCII%20%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D1%8B%20%20%D7%97%D7%9F%20.txt' "data/bucket-1/a/これは This is ASCII системы חן .txt"
234248
fi
235249

236250
if [ "${index_page}" == "1" ]; then

0 commit comments

Comments
 (0)