mirror of
https://github.com/golang/sys.git
synced 2026-02-08 11:46:04 +03:00
unix: skip ip related tests if EAFNOSUPPORT raised
Skipping EADDRNOTAVAIL is not enough for system doesn't support ipv4/ipv6 family. This CL skips TestPktInfo and TestParseOrigDstAddr if EAFNOSUPPORT raised. Fixes golang/go#58832 Change-Id: Icf74749f9cc0f9a6d60646f92f7ddf53ae2de8ab Reviewed-on: https://go-review.googlesource.com/c/sys/+/473257 Run-TryBot: M Zhuo <mzh@golangcn.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
@@ -132,7 +132,7 @@ func TestPktInfo(t *testing.T) {
|
||||
for _, test := range testcases {
|
||||
t.Run(test.network, func(t *testing.T) {
|
||||
conn, err := net.ListenUDP(test.network, test.address)
|
||||
if errors.Is(err, unix.EADDRNOTAVAIL) {
|
||||
if errors.Is(err, unix.EADDRNOTAVAIL) || errors.Is(err, unix.EAFNOSUPPORT) {
|
||||
t.Skipf("%v is not available", test.address)
|
||||
}
|
||||
if err != nil {
|
||||
@@ -208,7 +208,7 @@ func TestParseOrigDstAddr(t *testing.T) {
|
||||
for _, test := range testcases {
|
||||
t.Run(test.network, func(t *testing.T) {
|
||||
conn, err := net.ListenUDP(test.network, test.address)
|
||||
if errors.Is(err, unix.EADDRNOTAVAIL) {
|
||||
if errors.Is(err, unix.EADDRNOTAVAIL) || errors.Is(err, unix.EAFNOSUPPORT) {
|
||||
t.Skipf("%v is not available", test.address)
|
||||
}
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user