-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: TestInterfaceAddrsWithNetsh fail on Windows 7 #14130
Comments
@vdobler can you, please, run TestInterfaceHardwareAddrWithGetmac alone and show its error message in full. I think your error message above is missing its end. Thank you. Alex |
@alexbrainman Now it is Blootooth... : $ go test -v -run TestInterfaceHardwareAddrWithGetmac net |
@vdobler I am confused now. Your last error messages says: But regardless of you changed the code. I don't see how TestInterfaceHardwareAddrWithGetmac is at fault here. The test has found "Bluetooth Network Connection" in the output of
to see if it makes TestInterfaceHardwareAddrWithGetmac PASS? If TestInterfaceHardwareAddrWithGetmac is still broken, show us output of Thank you. Alex |
@alexbrainman Thanks for the feedback. And please excuse the confusion I produced, I'll try to be more systematic. I think the Go code itself is okay and works properly. But the test code executes I verified the following on go1.6rc1 and go1.6rc2 with a clean Go source tree and a (halfway freshly booted Windows 7 Enterprise Service Pack 1 with VMware Player 7.1.2 build-2780323 installed). TestInterfaceAddrsWithNetsh
but the problem is not the Go code as "192.168.209.1/24" is fine as it is the proper address as can be seen by running:
Unfortunately the test code tries to get the address by executing
which returns 0 but prints just one blank line:
This is strange and clearly a Windows-only, maybe even a "my-computer-only" problem. The test code relies on the fact that Maybe parsing the whole output of TestInterfaceHardwareAddrWithGetmacIf I disable (through Control Panel\Network and Internet\Network Connections) "VMware Network Adapter VMnet8" and have the wireless network turned off via the hardware switch then:
Running getmac:
If I peek at TestInterfaceHardwareAddrWithGetmac around line 507 there is no code to test for the string "Disabled" or "N/A" as a value for "Physical Address" which explains the failed test. A simple fix would be (I could prepare a complete CL):
|
@vdobler thank you for investigation. I agree we have to adjust these tests.
I will try that.
for ipv4, and
for ipv6.
Your proposed change looks good to me. I will write a CL when I have some time. If you want to do it yourself (or even half of it), feel free to do it. Thanks again. Alex |
CL https://golang.org/cl/19411 mentions this issue. |
The Windows 7 getmac command may report the physical address of an adapter as "Disabled" or "N/A". Handle these two cases to make the tests more robust when building on Windows with manually disabled adapters or turned off hardware. Addresses issue #14130. Change-Id: I0c2f8554b4b6810568e4e60ed53857599401f296 Reviewed-on: https://go-review.googlesource.com/19411 Reviewed-by: Alex Brainman <[email protected]> Run-TryBot: Alex Brainman <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Russ Cox <[email protected]>
@vdobler please check if https://go-review.googlesource.com/#/c/19441/ fixes problem on your computer. Thank you. Alex |
CL https://golang.org/cl/19441 mentions this issue. |
Go1.6rc1 on Windows 7, CGO_ENABLE=0:
The underlying cause is that netsh doesn't print anything when queried for this interface:
But all information is output if not asked for this specific interface:
If the adapter is disabled this tests passes but then TestInterfaceHardwareAddrWithGetmac fails:
net_windows_test.go:528: getmac lists "VMware Network Adapter VMnet8", but it could not be found among Go interfaces
There might be some problem with this interface on Windows side.
The text was updated successfully, but these errors were encountered: