Skip to content

Commit

Permalink
vsock: check for ENETUNREACH and ETIMEDOUT as well in failed Dial test (
Browse files Browse the repository at this point in the history
#54)

This happens on Ubuntu focal kernel (5.4).

Signed-off-by: Shengjing Zhu <zhsj@debian.org>
  • Loading branch information
zhsj committed Aug 23, 2023
1 parent 76b624c commit 068aff8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions integration_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,10 @@ func TestIntegrationConnDialNoListener(t *testing.T) {
t.Fatalf("expected *net.OpError, but got %T", err)
}

// Expect one of ECONNRESET or ENODEV depending on the kernel.
// Expect one of ECONNRESET, ENODEV, ENETUNREACH, ETIMEDOUT depending on the kernel.
switch {
case errors.Is(got.Err, unix.ECONNRESET), errors.Is(got.Err, unix.ENODEV):
case errors.Is(got.Err, unix.ECONNRESET), errors.Is(got.Err, unix.ENODEV),
errors.Is(got.Err, unix.ENETUNREACH), errors.Is(got.Err, unix.ETIMEDOUT):
// OK.
default:
t.Fatalf("unexpected syscall error: %v", got.Err)
Expand Down

0 comments on commit 068aff8

Please sign in to comment.