File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ #
3
+ # Copyright (c) Protocol Labs
4
+
5
+ test_description=" Test symlink support on the HTTP gateway"
6
+
7
+ . lib/test-lib.sh
8
+
9
+ test_init_ipfs
10
+ test_launch_ipfs_daemon
11
+
12
+
13
+ test_expect_success " Create a test directory with symlinks" '
14
+ mkdir testfiles &&
15
+ echo "content" > testfiles/foo &&
16
+ ln -s foo testfiles/bar &&
17
+ test_cmp testfiles/foo testfiles/bar
18
+ '
19
+
20
+ test_expect_success " Add the test directory" '
21
+ HASH=$(ipfs add -Qr testfiles)
22
+ '
23
+
24
+ test_expect_success " Test the directory listing" '
25
+ curl "$GWAY_ADDR/ipfs/$HASH" > list_response &&
26
+ test_should_contain ">foo<" list_response &&
27
+ test_should_contain ">bar<" list_response
28
+ '
29
+
30
+ test_expect_success " Test the symlink" '
31
+ curl "$GWAY_ADDR/ipfs/$HASH/bar" > bar_actual &&
32
+ echo -n "foo" > bar_expected &&
33
+ test_cmp bar_expected bar_actual
34
+ '
35
+
36
+ test_kill_ipfs_daemon
37
+
38
+ test_done
You can’t perform that action at this time.
0 commit comments