🩹 Update IPv6 test

pull/633/head
Fenny 2020-07-18 01:11:16 +02:00
parent 2893c13718
commit 29c9a97556
1 changed files with 8 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import (
"crypto/tls" "crypto/tls"
"io/ioutil" "io/ioutil"
"os" "os"
"strings"
"testing" "testing"
"time" "time"
@ -67,11 +68,14 @@ func Test_App_Prefork_TCP6_Addr(t *testing.T) {
app.Settings.DisableStartupMessage = true app.Settings.DisableStartupMessage = true
app.init() app.init()
utils.AssertEqual(t, "listen: tcp6 is not supported when prefork is enabled", app.Listen("[::1]:3000").Error())
app.Settings.Network = "tcp6" go func() {
app.init() time.Sleep(1000 * time.Millisecond)
utils.AssertEqual(t, "listen: tcp6 is not supported when prefork is enabled", app.Listen(":3000").Error()) utils.AssertEqual(t, nil, app.Shutdown())
}()
err := app.Listen("[::1]:3200")
utils.AssertEqual(t, true, strings.Contains(err.Error(), "exit status"))
} }
func Test_App_Prefork_Child_Process_Never_Show_Startup_Message(t *testing.T) { func Test_App_Prefork_Child_Process_Never_Show_Startup_Message(t *testing.T) {