Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
962e1bbc
Commit
962e1bbc
authored
Jul 06, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test init profile
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
0b481a3e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
+34
-0
cmd/ipfs/init.go
cmd/ipfs/init.go
+2
-0
repo/config/profile.go
repo/config/profile.go
+13
-0
test/sharness/t0020-init.sh
test/sharness/t0020-init.sh
+19
-0
No files found.
cmd/ipfs/init.go
View file @
962e1bbc
...
...
@@ -34,6 +34,8 @@ initialize it using 'server' profile.
Available profiles:
'server' - Disables local host discovery, recommended when
running IPFS on machines with public IPv4 addresses.
'test' - Reduces external interference of IPFS daemon, this
is useful when using the daemon in test environments.
ipfs uses a repository in the local file system. By default, the repo is
located at ~/.ipfs. To change the repo location, set the $IPFS_PATH
...
...
repo/config/profile.go
View file @
962e1bbc
...
...
@@ -28,4 +28,17 @@ var ConfigProfiles = map[string]func(*Config) error{
c
.
Discovery
.
MDNS
.
Enabled
=
false
return
nil
},
"test"
:
func
(
c
*
Config
)
error
{
c
.
Addresses
.
API
=
"/ip4/127.0.0.1/tcp/0"
c
.
Addresses
.
Gateway
=
"/ip4/127.0.0.1/tcp/0"
c
.
Swarm
.
DisableNatPortMap
=
true
c
.
Addresses
.
Swarm
=
[]
string
{
"/ip4/127.0.0.1/tcp/0"
,
}
c
.
Bootstrap
=
[]
string
{}
c
.
Discovery
.
MDNS
.
Enabled
=
false
return
nil
},
}
test/sharness/t0020-init.sh
View file @
962e1bbc
...
...
@@ -148,6 +148,25 @@ test_expect_success "clean up ipfs dir" '
rm -rf "$IPFS_PATH"
'
test_expect_success
"'ipfs init --profile=test' succeeds"
'
BITS="1024" &&
ipfs init --bits="$BITS" --profile=test
'
test_expect_success
"'ipfs config Bootstrap' looks good"
'
ipfs config Bootstrap > actual_config &&
test $(cat actual_config) = "[]"
'
test_expect_success
"'ipfs config Addresses.API' looks good"
'
ipfs config Addresses.API > actual_config &&
test $(cat actual_config) = "/ip4/127.0.0.1/tcp/0"
'
test_expect_success
"clean up ipfs dir"
'
rm -rf "$IPFS_PATH"
'
test_init_ipfs
test_launch_ipfs_daemon
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment