Use unprivileged port for ports test

This commit is contained in:
Torjus Håkestad 2022-08-26 12:21:35 +02:00
parent 329d93a759
commit 4c77b5ef9b
No known key found for this signature in database
GPG Key ID: C6FD38B820D295FC

View File

@ -18,11 +18,12 @@ func TestServer(t *testing.T) {
server := ports.New(store)
server.IP = "127.0.0.1"
server.AddTCPPort("25")
server.AddTCPPort("2555")
go server.Start(ctx)
time.Sleep(1 * time.Second)
rAddr, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(server.IP, "25"))
rAddr, err := net.ResolveTCPAddr("tcp", net.JoinHostPort(server.IP, "2555"))
if err != nil {
t.Fatalf("Error resolving remote address: %s", err)
}