mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-27 07:20:19 +00:00
TUN-814: Handle error in CreateTLSListener before closing listener
This commit is contained in:
@@ -6,10 +6,10 @@ import (
|
||||
|
||||
func TestCreateTLSListenerHostAndPortSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener("localhost:1234")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer listener.Close()
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
@@ -17,10 +17,10 @@ func TestCreateTLSListenerHostAndPortSuccess(t *testing.T) {
|
||||
|
||||
func TestCreateTLSListenerOnlyHostSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener("localhost:")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer listener.Close()
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
@@ -28,10 +28,10 @@ func TestCreateTLSListenerOnlyHostSuccess(t *testing.T) {
|
||||
|
||||
func TestCreateTLSListenerOnlyPortSuccess(t *testing.T) {
|
||||
listener, err := CreateTLSListener(":8888")
|
||||
defer listener.Close()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer listener.Close()
|
||||
if listener.Addr().String() == "" {
|
||||
t.Fatal("Fail to find available port")
|
||||
}
|
||||
|
Reference in New Issue
Block a user