Tests that IPC paths are correctly resolved to valid endpoints of different platforms.
(t *testing.T)
| 52 | // Tests that IPC paths are correctly resolved to valid endpoints of different |
| 53 | // platforms. |
| 54 | func TestIPCPathResolution(t *testing.T) { |
| 55 | var tests = []struct { |
| 56 | DataDir string |
| 57 | IPCPath string |
| 58 | Windows bool |
| 59 | Endpoint string |
| 60 | }{ |
| 61 | {"", "", false, ""}, |
| 62 | {"data", "", false, ""}, |
| 63 | {"", "cpchain.ipc", false, filepath.Join(os.TempDir(), "cpchain.ipc")}, |
| 64 | {"data", "cpchain.ipc", false, "data/cpchain.ipc"}, |
| 65 | {"data", "./cpchain.ipc", false, "./cpchain.ipc"}, |
| 66 | {"data", "/cpchain.ipc", false, "/cpchain.ipc"}, |
| 67 | {"", "", true, ``}, |
| 68 | {"data", "", true, ``}, |
| 69 | {"", "cpchain.ipc", true, `\\.\pipe\geth.ipc`}, |
| 70 | {"data", "cpchain.ipc", true, `\\.\pipe\geth.ipc`}, |
| 71 | {"data", `\\.\pipe\geth.ipc`, true, `\\.\pipe\geth.ipc`}, |
| 72 | } |
| 73 | for i, test := range tests { |
| 74 | // Only run when platform/test match |
| 75 | if (runtime.GOOS == "windows") == test.Windows { |
| 76 | if endpoint := (&Config{DataDir: test.DataDir, IPCPath: test.IPCPath}).IPCEndpoint(); endpoint != test.Endpoint { |
| 77 | t.Errorf("test %d: IPC endpoint mismatch: have %s, want %s", i, endpoint, test.Endpoint) |
| 78 | } |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | // Tests that node keys can be correctly created, persisted, loaded and/or made |
| 84 | // ephemeral. |
nothing calls this directly
no test coverage detected