mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
Add test init profile
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
parent
0b481a3e08
commit
962e1bbc45
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user