diff options
author | Felix Lange <fjl@twurst.com> | 2016-08-18 19:28:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-09-16 21:24:31 +0800 |
commit | eeb322ae649c4a1a32430cdddfffed70f509181e (patch) | |
tree | 35622201208afb98665743d9bcf88883058e772a /node/service_test.go | |
parent | 52ede09b172094f8fd85f8b10e7d0578059353fb (diff) | |
download | go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.gz go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.bz2 go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.lz go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.xz go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.tar.zst go-tangerine-eeb322ae649c4a1a32430cdddfffed70f509181e.zip |
node: ensure datadir can be co-inhabited by different instances
This change ensures that nodes started with different Name but same
DataDir values don't use the same nodekey and IPC socket.
Diffstat (limited to 'node/service_test.go')
-rw-r--r-- | node/service_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/node/service_test.go b/node/service_test.go index 7bd94a52e..a7ae439e0 100644 --- a/node/service_test.go +++ b/node/service_test.go @@ -38,18 +38,18 @@ func TestContextDatabases(t *testing.T) { t.Fatalf("non-created database already exists") } // Request the opening/creation of a database and ensure it persists to disk - ctx := &ServiceContext{datadir: dir} + ctx := &ServiceContext{config: &Config{Name: "unit-test", DataDir: dir}} db, err := ctx.OpenDatabase("persistent", 0, 0) if err != nil { t.Fatalf("failed to open persistent database: %v", err) } db.Close() - if _, err := os.Stat(filepath.Join(dir, "persistent")); err != nil { + if _, err := os.Stat(filepath.Join(dir, "unit-test", "persistent")); err != nil { t.Fatalf("persistent database doesn't exists: %v", err) } // Request th opening/creation of an ephemeral database and ensure it's not persisted - ctx = &ServiceContext{datadir: ""} + ctx = &ServiceContext{config: &Config{DataDir: ""}} db, err = ctx.OpenDatabase("ephemeral", 0, 0) if err != nil { t.Fatalf("failed to open ephemeral database: %v", err) |