mdlayher / vsock

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vsock: net.Conn compliance with x/net/nettest

mdlayher opened this issue · comments

We should basically mimic what net's TCP sockets do, rather than returning random bare syscall errors.

I'm pretty close to getting this all working locally. Once x/net/nettest can validate this package's net.Conn compliance, I'll report back.

As of yesterday:

matt@vmkube01:~$ VSOCK_NETTEST_ADDR=1 ./vsock.test -test.v -test.run=TestIntegrationNettest .
=== RUN   TestIntegrationNettest
=== RUN   TestIntegrationNettest/BasicIO
=== RUN   TestIntegrationNettest/PingPong
=== RUN   TestIntegrationNettest/RacyRead
=== RUN   TestIntegrationNettest/RacyWrite
=== RUN   TestIntegrationNettest/ReadTimeout
=== RUN   TestIntegrationNettest/WriteTimeout
=== RUN   TestIntegrationNettest/PastTimeout
=== RUN   TestIntegrationNettest/PresentTimeout
=== RUN   TestIntegrationNettest/FutureTimeout
=== RUN   TestIntegrationNettest/CloseTimeout
=== RUN   TestIntegrationNettest/ConcurrentMethods
--- FAIL: TestIntegrationNettest (0.83s)
    --- FAIL: TestIntegrationNettest/BasicIO (0.17s)
        conntest.go:80: unexpected c2.Read error: read vsock vm(3):3000->vm(3):3001: EOF
    --- PASS: TestIntegrationNettest/PingPong (0.02s)
    --- PASS: TestIntegrationNettest/RacyRead (0.18s)
    --- PASS: TestIntegrationNettest/RacyWrite (0.02s)
    --- PASS: TestIntegrationNettest/ReadTimeout (0.00s)
    --- PASS: TestIntegrationNettest/WriteTimeout (0.02s)
    --- PASS: TestIntegrationNettest/PastTimeout (0.00s)
    --- PASS: TestIntegrationNettest/PresentTimeout (0.10s)
    --- PASS: TestIntegrationNettest/FutureTimeout (0.11s)
    --- PASS: TestIntegrationNettest/CloseTimeout (0.11s)
    --- PASS: TestIntegrationNettest/ConcurrentMethods (0.07s)
FAIL
coverage: 70.5% of statements