|
@@ -26,14 +26,14 @@ import (
|
|
|
"testing"
|
|
"testing"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
|
|
+ "github.com/docker/docker/pkg/reexec"
|
|
|
|
|
+ "github.com/ethereum/go-ethereum/cmd/utils"
|
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
"github.com/ethereum/go-ethereum/rpc"
|
|
|
"github.com/ethereum/go-ethereum/swarm"
|
|
"github.com/ethereum/go-ethereum/swarm"
|
|
|
"github.com/ethereum/go-ethereum/swarm/api"
|
|
"github.com/ethereum/go-ethereum/swarm/api"
|
|
|
-
|
|
|
|
|
- "github.com/docker/docker/pkg/reexec"
|
|
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-func TestDumpConfig(t *testing.T) {
|
|
|
|
|
|
|
+func TestConfigDump(t *testing.T) {
|
|
|
swarm := runSwarm(t, "dumpconfig")
|
|
swarm := runSwarm(t, "dumpconfig")
|
|
|
defaultConf := api.NewConfig()
|
|
defaultConf := api.NewConfig()
|
|
|
out, err := tomlSettings.Marshal(&defaultConf)
|
|
out, err := tomlSettings.Marshal(&defaultConf)
|
|
@@ -91,8 +91,8 @@ func TestConfigCmdLineOverrides(t *testing.T) {
|
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
|
fmt.Sprintf("--%s", SwarmDeliverySkipCheckFlag.Name),
|
|
fmt.Sprintf("--%s", SwarmDeliverySkipCheckFlag.Name),
|
|
|
fmt.Sprintf("--%s", EnsAPIFlag.Name), "",
|
|
fmt.Sprintf("--%s", EnsAPIFlag.Name), "",
|
|
|
- "--datadir", dir,
|
|
|
|
|
- "--ipcpath", conf.IPCPath,
|
|
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.DataDirFlag.Name), dir,
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), conf.IPCPath,
|
|
|
}
|
|
}
|
|
|
node.Cmd = runSwarm(t, flags...)
|
|
node.Cmd = runSwarm(t, flags...)
|
|
|
node.Cmd.InputLine(testPassphrase)
|
|
node.Cmd.InputLine(testPassphrase)
|
|
@@ -189,9 +189,9 @@ func TestConfigFileOverrides(t *testing.T) {
|
|
|
flags := []string{
|
|
flags := []string{
|
|
|
fmt.Sprintf("--%s", SwarmTomlConfigPathFlag.Name), f.Name(),
|
|
fmt.Sprintf("--%s", SwarmTomlConfigPathFlag.Name), f.Name(),
|
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
|
- "--ens-api", "",
|
|
|
|
|
- "--ipcpath", conf.IPCPath,
|
|
|
|
|
- "--datadir", dir,
|
|
|
|
|
|
|
+ fmt.Sprintf("--%s", EnsAPIFlag.Name), "",
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.DataDirFlag.Name), dir,
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), conf.IPCPath,
|
|
|
}
|
|
}
|
|
|
node.Cmd = runSwarm(t, flags...)
|
|
node.Cmd = runSwarm(t, flags...)
|
|
|
node.Cmd.InputLine(testPassphrase)
|
|
node.Cmd.InputLine(testPassphrase)
|
|
@@ -407,9 +407,9 @@ func TestConfigCmdLineOverridesFile(t *testing.T) {
|
|
|
fmt.Sprintf("--%s", SwarmSyncDisabledFlag.Name),
|
|
fmt.Sprintf("--%s", SwarmSyncDisabledFlag.Name),
|
|
|
fmt.Sprintf("--%s", SwarmTomlConfigPathFlag.Name), f.Name(),
|
|
fmt.Sprintf("--%s", SwarmTomlConfigPathFlag.Name), f.Name(),
|
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
fmt.Sprintf("--%s", SwarmAccountFlag.Name), account.Address.String(),
|
|
|
- "--ens-api", "",
|
|
|
|
|
- "--datadir", dir,
|
|
|
|
|
- "--ipcpath", conf.IPCPath,
|
|
|
|
|
|
|
+ fmt.Sprintf("--%s", EnsAPIFlag.Name), "",
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.DataDirFlag.Name), dir,
|
|
|
|
|
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), conf.IPCPath,
|
|
|
}
|
|
}
|
|
|
node.Cmd = runSwarm(t, flags...)
|
|
node.Cmd = runSwarm(t, flags...)
|
|
|
node.Cmd.InputLine(testPassphrase)
|
|
node.Cmd.InputLine(testPassphrase)
|
|
@@ -466,7 +466,7 @@ func TestConfigCmdLineOverridesFile(t *testing.T) {
|
|
|
node.Shutdown()
|
|
node.Shutdown()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-func TestValidateConfig(t *testing.T) {
|
|
|
|
|
|
|
+func TestConfigValidate(t *testing.T) {
|
|
|
for _, c := range []struct {
|
|
for _, c := range []struct {
|
|
|
cfg *api.Config
|
|
cfg *api.Config
|
|
|
err string
|
|
err string
|