From 0dba69d996cb80e996ab6957e3b505e3619d8bf5 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Tue, 18 Oct 2016 15:27:49 -0700 Subject: [PATCH] unix socket tests --- redcon_test.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/redcon_test.go b/redcon_test.go index 6c4e250..c93d511 100644 --- a/redcon_test.go +++ b/redcon_test.go @@ -212,8 +212,9 @@ func TestServerTCP(t *testing.T) { testServerNetwork(t, "tcp", ":12345") } func TestServerUnix(t *testing.T) { - defer os.RemoveAll("unix.net") - testServerNetwork(t, "unix", "unix.net") + os.RemoveAll("/tmp/redcon-unix.sock") + defer os.RemoveAll("/tmp/redcon-unix.sock") + testServerNetwork(t, "unix", "/tmp/redcon-unix.sock") } func testServerNetwork(t *testing.T, network, laddr string) { @@ -257,10 +258,6 @@ func testServerNetwork(t *testing.T, network, laddr string) { t.Fatalf("expected an error, should not be able to close before serving") } go func() { - - if network == "unix" { - os.RemoveAll(laddr) - } time.Sleep(time.Second / 4) if err := ListenAndServeNetwork(network, laddr, func(conn Conn, cmd Command) {}, nil, nil); err == nil { t.Fatalf("expected an error, should not be able to listen on the same port")