Skip to content

Commit b33efa3

Browse files
committed
test: add case for upload to aliased path
1 parent ee252a4 commit b33efa3

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

test/case/004.alias.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "$root"/lib.bash
44

5-
"$ghfs" -l 3003 -r "$fs"/vhost1 -a :world:"$fs"/vhost1/go :/not/exist/name:"$fs"/vhost1/yes -E '' &
5+
"$ghfs" -l 3003 -r "$fs"/vhost1 -a :world/go:"$fs"/vhost1/go :/not/exist/name:"$fs"/vhost1/yes -E '' &
66
sleep 0.05 # wait server ready
77

88
file1=$(curl_get_body http://127.0.0.1:3003/file1.txt)
@@ -11,7 +11,7 @@ assert "$file1" 'vhost1/file1.txt'
1111
hello=$(curl_get_body http://127.0.0.1:3003/hello/index.txt)
1212
assert "$hello" 'vhost1/hello/index.txt'
1313

14-
go=$(curl_get_body http://127.0.0.1:3003/world/index.txt)
14+
go=$(curl_get_body http://127.0.0.1:3003/world/go/index.txt)
1515
assert "$go" 'vhost1/go/index.txt'
1616

1717
status=$(curl_get_status http://127.0.0.1:3003/not)

test/case/011.alias.upload.bash

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
cleanup() {
4+
rm -f "$fs"/uploaded/2/*.tmp
5+
}
6+
7+
source "$root"/lib.bash
8+
9+
"$ghfs" -l 3003 -r "$fs"/vhost1 --alias :/my/upload:"$fs"/uploaded/2 --upload /my/upload &
10+
sleep 0.05 # wait server ready
11+
cleanup
12+
13+
content='my/upload/uploaded.tmp'
14+
curl_upload_content 'http://127.0.0.1:3003/my/upload?upload' files "$content" uploaded.tmp
15+
uploaded=$(cat "$fs"/uploaded/2/uploaded.tmp)
16+
assert "$uploaded" "$content"
17+
18+
cleanup
19+
kill %1
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)