Skip to content

Commit

Permalink
Added HV Socket tests
Browse files Browse the repository at this point in the history
Added tests for core Hyper-V socket functionality, including testing
CloseRead and CloseWrite, as well as checking addresses are appropriate
and timeouts work.

Added resources to support testing:
* Well-know Hyper-V VMIDs for parents, children, and loopback.
* VSock interop service GUID.
* `Dial()` and `DialContext()` to dial a specific Hyper-V socket at a
  known address (along with a corresponding `HvsockDialer` struct.

Bug fixes:
* Dial (and Listen) now properly initialize and set properties of their
  sockets after ConnectEx (and AcceptEx).
* The `socketError` used by `bind` was incorrect, it should be `int32(-1)`,
  not `uintptr(^0)`

Added functionality to register application (service GUID and name) in the
registry to enable Hyper-V sockets using that service GUID

Created a `sockets` package, currently only with syscalls to `Bind`,
`ConnectEx` and `GetSockName`, bypassing `syscall/windows` restrictions
on the types that can do so.

Upgraded to go v1.17 to use `unsafe.Slice()`.

Signed-off-by: Hamza El-Saawy <[email protected]>
  • Loading branch information
helsaawy committed May 5, 2022
1 parent df6977a commit dc12cd5
Showing 1 changed file with 681 additions and 0 deletions.
Loading

0 comments on commit dc12cd5

Please sign in to comment.