diff options
author | Wolfy-J <[email protected]> | 2018-06-06 18:33:55 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-06 18:33:55 +0300 |
commit | 304b891eec532ca9d8c14f4c605493160a53370b (patch) | |
tree | 85256c64552e271a80b7cfe73eb49344f4cae607 /server_config_test.go | |
parent | acc86b65b75c26b0b3d730775acac44637b696b3 (diff) |
tests fixed for windows
Diffstat (limited to 'server_config_test.go')
-rw-r--r-- | server_config_test.go | 42 |
1 files changed, 8 insertions, 34 deletions
diff --git a/server_config_test.go b/server_config_test.go index 42d2fec4..e3ef6ec0 100644 --- a/server_config_test.go +++ b/server_config_test.go @@ -3,9 +3,7 @@ package roadrunner import ( "testing" "github.com/stretchr/testify/assert" - "os/user" "runtime" - "strconv" ) func Test_ServerConfig_PipeFactory(t *testing.T) { @@ -50,6 +48,10 @@ func Test_ServerConfig_SocketFactory(t *testing.T) { } func Test_ServerConfig_UnixSocketFactory(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("not supported on " + runtime.GOOS) + } + cfg := &ServerConfig{Relay: "unix://unix.sock"} f, err := cfg.makeFactory() defer f.Close() @@ -61,41 +63,13 @@ func Test_ServerConfig_UnixSocketFactory(t *testing.T) { } func Test_ServerConfig_ErrorFactory(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("not supported on " + runtime.GOOS) + } + cfg := &ServerConfig{Relay: "uni:unix.sock"} f, err := cfg.makeFactory() assert.Nil(t, f) assert.Error(t, err) assert.Equal(t, "invalid relay DSN (pipes, tcp://:6001, unix://rr.sock)", err.Error()) } - -func Test_ServerConfig_Cmd(t *testing.T) { - cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", - } - - cmd, err := cfg.makeCommand() - assert.NoError(t, err) - assert.NotNil(t, cmd) -} - -func Test_ServerConfig_Cmd_Credentials(t *testing.T) { - if runtime.GOOS == "windows" { - t.Skip("not supported on " + runtime.GOOS) - } - - u, err := user.Current() - assert.NoError(t, err) - - cfg := &ServerConfig{ - Command: "php php-src/tests/client.php pipes", - User: u.Username, - Group: u.Gid, - } - - cmd, err := cfg.makeCommand() - assert.NoError(t, err) - assert.NotNil(t, cmd) - - assert.Equal(t, u.Uid, strconv.Itoa(int(cmd().SysProcAttr.Credential.Uid))) - assert.Equal(t, u.Gid, strconv.Itoa(int(cmd().SysProcAttr.Credential.Gid))) -} |