Commit 962e1bbc authored by Łukasz Magiera's avatar Łukasz Magiera

Add test init profile

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent 0b481a3e
......@@ -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
......
......@@ -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
},
}
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment