File tree 3 files changed +34
-0
lines changed 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ initialize it using 'server' profile.
34
34
Available profiles:
35
35
'server' - Disables local host discovery, recommended when
36
36
running IPFS on machines with public IPv4 addresses.
37
+ 'test' - Reduces external interference of IPFS daemon, this
38
+ is useful when using the daemon in test environments.
37
39
38
40
ipfs uses a repository in the local file system. By default, the repo is
39
41
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
Original file line number Diff line number Diff line change @@ -28,4 +28,17 @@ var ConfigProfiles = map[string]func(*Config) error{
28
28
c .Discovery .MDNS .Enabled = false
29
29
return nil
30
30
},
31
+ "test" : func (c * Config ) error {
32
+ c .Addresses .API = "/ip4/127.0.0.1/tcp/0"
33
+ c .Addresses .Gateway = "/ip4/127.0.0.1/tcp/0"
34
+
35
+ c .Swarm .DisableNatPortMap = true
36
+ c .Addresses .Swarm = []string {
37
+ "/ip4/127.0.0.1/tcp/0" ,
38
+ }
39
+
40
+ c .Bootstrap = []string {}
41
+ c .Discovery .MDNS .Enabled = false
42
+ return nil
43
+ },
31
44
}
Original file line number Diff line number Diff line change @@ -148,6 +148,25 @@ test_expect_success "clean up ipfs dir" '
148
148
rm -rf "$IPFS_PATH"
149
149
'
150
150
151
+ test_expect_success " 'ipfs init --profile=test' succeeds" '
152
+ BITS="1024" &&
153
+ ipfs init --bits="$BITS" --profile=test
154
+ '
155
+
156
+ test_expect_success " 'ipfs config Bootstrap' looks good" '
157
+ ipfs config Bootstrap > actual_config &&
158
+ test $(cat actual_config) = "[]"
159
+ '
160
+
161
+ test_expect_success " 'ipfs config Addresses.API' looks good" '
162
+ ipfs config Addresses.API > actual_config &&
163
+ test $(cat actual_config) = "/ip4/127.0.0.1/tcp/0"
164
+ '
165
+
166
+ test_expect_success " clean up ipfs dir" '
167
+ rm -rf "$IPFS_PATH"
168
+ '
169
+
151
170
test_init_ipfs
152
171
153
172
test_launch_ipfs_daemon
You can’t perform that action at this time.
0 commit comments