From 068aff8a5e29cc13661b0f5a16cc347614c2bc7d Mon Sep 17 00:00:00 2001 From: zhsj Date: Wed, 23 Aug 2023 21:17:21 +0800 Subject: [PATCH] vsock: check for ENETUNREACH and ETIMEDOUT as well in failed Dial test (#54) This happens on Ubuntu focal kernel (5.4). Signed-off-by: Shengjing Zhu --- integration_linux_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/integration_linux_test.go b/integration_linux_test.go index 49bb45f..b8809e3 100644 --- a/integration_linux_test.go +++ b/integration_linux_test.go @@ -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)