aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm/fs_test.go
diff options
context:
space:
mode:
authorFerenc Szabo <frncmx@gmail.com>2018-11-23 08:32:34 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2018-11-23 08:32:34 +0800
commit76f5f662ccaf5190eb283ab8b5d607587e1ab8f9 (patch)
treeb7416f8c64df1ec82bc879cf15fe102410fc7037 /cmd/swarm/fs_test.go
parent6b2cc8950e55b1d93afb3c82bb1081cf931d62cf (diff)
downloaddexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.gz
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.bz2
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.lz
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.xz
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.tar.zst
dexon-76f5f662ccaf5190eb283ab8b5d607587e1ab8f9.zip
cmd/swarm: FUSE do not require --ipcpath (#18112)
- Have `${DataDir}/bzzd.ipc` as IPC path default. - Respect the `--datadir` flag. - Keep only the global `--ipcpath` flag and drop the local `--ipcpath` flag as flags might overwrite each other. (Note: before global `--ipcpath` was ignored even if it was set) fixes ethersphere#795
Diffstat (limited to 'cmd/swarm/fs_test.go')
-rw-r--r--cmd/swarm/fs_test.go30
1 files changed, 26 insertions, 4 deletions
diff --git a/cmd/swarm/fs_test.go b/cmd/swarm/fs_test.go
index ac4223b66..5f58d6c0d 100644
--- a/cmd/swarm/fs_test.go
+++ b/cmd/swarm/fs_test.go
@@ -20,6 +20,7 @@ package main
import (
"bytes"
+ "fmt"
"io"
"io/ioutil"
"os"
@@ -28,6 +29,7 @@ import (
"testing"
"time"
+ "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/log"
)
@@ -36,6 +38,26 @@ type testFile struct {
content string
}
+// TestCLISwarmFsDefaultIPCPath tests if the most basic fs command, i.e., list
+// can find and correctly connect to a running Swarm node on the default
+// IPCPath.
+func TestCLISwarmFsDefaultIPCPath(t *testing.T) {
+ cluster := newTestCluster(t, 1)
+ defer cluster.Shutdown()
+
+ handlingNode := cluster.Nodes[0]
+ list := runSwarm(t, []string{
+ "--datadir", handlingNode.Dir,
+ "fs",
+ "list",
+ }...)
+
+ list.WaitExit()
+ if list.Err != nil {
+ t.Fatal(list.Err)
+ }
+}
+
// TestCLISwarmFs is a high-level test of swarmfs
//
// This test fails on travis for macOS as this executable exits with code 1
@@ -59,9 +81,9 @@ func TestCLISwarmFs(t *testing.T) {
log.Debug("swarmfs cli test: mounting first run", "ipc path", filepath.Join(handlingNode.Dir, handlingNode.IpcPath))
mount := runSwarm(t, []string{
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
"fs",
"mount",
- "--ipcpath", filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
mhash,
mountPoint,
}...)
@@ -101,9 +123,9 @@ func TestCLISwarmFs(t *testing.T) {
log.Debug("swarmfs cli test: unmounting first run...", "ipc path", filepath.Join(handlingNode.Dir, handlingNode.IpcPath))
unmount := runSwarm(t, []string{
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
"fs",
"unmount",
- "--ipcpath", filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
mountPoint,
}...)
_, matches := unmount.ExpectRegexp(hashRegexp)
@@ -136,9 +158,9 @@ func TestCLISwarmFs(t *testing.T) {
//remount, check files
newMount := runSwarm(t, []string{
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
"fs",
"mount",
- "--ipcpath", filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
hash, // the latest hash
secondMountPoint,
}...)
@@ -172,9 +194,9 @@ func TestCLISwarmFs(t *testing.T) {
log.Debug("swarmfs cli test: unmounting second run", "ipc path", filepath.Join(handlingNode.Dir, handlingNode.IpcPath))
unmountSec := runSwarm(t, []string{
+ fmt.Sprintf("--%s", utils.IPCPathFlag.Name), filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
"fs",
"unmount",
- "--ipcpath", filepath.Join(handlingNode.Dir, handlingNode.IpcPath),
secondMountPoint,
}...)