Skip to content

Commit 494aa49

Browse files
mengzhuogopherbot
authored andcommitted
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>
1 parent c7a1bf9 commit 494aa49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

unix/creds_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ func TestPktInfo(t *testing.T) {
132132
for _, test := range testcases {
133133
t.Run(test.network, func(t *testing.T) {
134134
conn, err := net.ListenUDP(test.network, test.address)
135-
if errors.Is(err, unix.EADDRNOTAVAIL) {
135+
if errors.Is(err, unix.EADDRNOTAVAIL) || errors.Is(err, unix.EAFNOSUPPORT) {
136136
t.Skipf("%v is not available", test.address)
137137
}
138138
if err != nil {
@@ -208,7 +208,7 @@ func TestParseOrigDstAddr(t *testing.T) {
208208
for _, test := range testcases {
209209
t.Run(test.network, func(t *testing.T) {
210210
conn, err := net.ListenUDP(test.network, test.address)
211-
if errors.Is(err, unix.EADDRNOTAVAIL) {
211+
if errors.Is(err, unix.EADDRNOTAVAIL) || errors.Is(err, unix.EAFNOSUPPORT) {
212212
t.Skipf("%v is not available", test.address)
213213
}
214214
if err != nil {

0 commit comments

Comments
 (0)