@@ -6,7 +6,7 @@ cleanup() {
6
6
7
7
source " $root " /lib.bash
8
8
9
- " $ghfs " -l 3003 -r " $fs " /vhost2 --archive /a --archive-dir " $fs " /vhost2/b --archive /c --auth /c/sub &
9
+ " $ghfs " -l 3003 -r " $fs " /vhost2 --archive /a --archive-dir " $fs " /vhost2/b --archive /c --auth /c/sub -a :/hello: " $fs " /vhost1/hello -a :/world: " $fs " /vhost1/world --archive-user :/hello:alice --archive-dir-user : " $fs " /vhost1/world:bob --user alice:AliceSecret bob:BobSecret &
10
10
sleep 0.05 # wait server ready
11
11
cleanup
12
12
@@ -32,5 +32,21 @@ curl_get_body 'http://127.0.0.1:3003/c/?tar' > "$archive"
32
32
(tar -tf " $archive " | grep -q ' ^sub/sub1.txt$' ) && fail " sub/sub1.txt should not in $( basename $archive ) "
33
33
(tar -tf " $archive " | grep -q ' ^sub/sub2.txt$' ) && fail " sub/sub1.txt should not in $( basename $archive ) "
34
34
35
+ assert $( curl_head_status ' http://127.0.0.1:3003/hello/?tar' ) ' 400'
36
+ assert
$( curl_head_status ' http://eve:[email protected] :3003/hello/?tar' ) ' 400'
37
+ assert
$( curl_head_status ' http://alice:[email protected] :3003/hello/?tar' ) ' 400'
38
+ assert
$( curl_head_status ' http://alice:[email protected] :3003/hello/?tar' ) ' 200'
39
+ archive=" $fs " /downloaded/hello.tar.tmp
40
+ curl_get_body
' http://alice:[email protected] :3003/hello/?tar' > " $archive "
41
+ (tar -tf " $archive " | grep -q ' ^index.txt$' ) || fail " index.txt should in $( basename $archive ) "
42
+
43
+ assert $( curl_head_status ' http://127.0.0.1:3003/world/?tar' ) ' 400'
44
+ assert
$( curl_head_status ' http://eve:[email protected] :3003/world/?tar' ) ' 400'
45
+ assert
$( curl_head_status ' http://bob:[email protected] :3003/world/?tar' ) ' 400'
46
+ assert
$( curl_head_status ' http://bob:[email protected] :3003/world/?tar' ) ' 200'
47
+ archive=" $fs " /downloaded/world.tar.tmp
48
+ curl_get_body
' http://bob:[email protected] :3003/world/?tar' > " $archive "
49
+ (tar -tf " $archive " | grep -q ' ^index.txt$' ) || fail " index.txt should in $( basename $archive ) "
50
+
35
51
cleanup
36
52
jobs -p | xargs kill & > /dev/null
0 commit comments