-
Notifications
You must be signed in to change notification settings - Fork 18k
net: TestInterfacesWithNetsh and TestInterfaceHardwareAddrWithGetmac fail #13606
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
Comments
Calling GetAdaptersAddresses with GAA_FLAG_INCLUDE_ALL_INTERFACES for listing all network interfaces including virtual/logical/pseudo stuff, or just checking the results contained in scraping stuff. It's all your call. Because unlike BSD variants and Linux, Windows has not only common virtual interfaces such as ISATAP/6to4/Teredo/L2TP/PPPoE tunnel interfaces but pseudo-application helper network interfaces such as IKE blah blah. |
FYI, GetAdaptersAddresses is not provided wide function. So it need to convert character-set using MultiByteToWideChar. |
@mikioh I have plan for fixing TestInterfacesWithNetsh (CL 17850), but looking for suggestions on how to modify TestInterfaceHardwareAddrWithGetmac to make it PASS here. Thank you. Alex |
CL https://golang.org/cl/17850 mentions this issue. |
Also include test for interface state (up or down). Updates #13606 Change-Id: I03538d65525ddd9c2d0254761861c2df7fc5bd5a Reviewed-on: https://go-review.googlesource.com/17850 Reviewed-by: Russ Cox <[email protected]> Reviewed-by: Mikio Hara <[email protected]> Run-TryBot: Russ Cox <[email protected]>
@mikioh TestInterfacesWithNetsh is fixed now. But TestInterfaceHardwareAddrWithGetmac is still broken. Do you have any suggestions of changing the test so it PASSes? Thank you. Alex |
Sorry, I'm not a windows user and have no windows box. I'd recommend you to drop or disable TestInterfaceHardwareAddrWithGetmac unless you are sure getmac command uses information from where and how. It's fine because they are auxiliary test cases and we already have other test cases in interface_test.go and interface_windows_test.go. |
I have created CL 17993 to test your theory - just to see what tests will fail if I leave Interface.HardwareAddr blank. It appears (https://storage.googleapis.com/go-build-log/74b9c8ae/windows-amd64-gce_e2dcba01.log) only TestInterfaceHardwareAddrWithGetmac fails:
so if we disable this test, then we can easily regress just like I did in CL 17993. I think we need to keep as much of TestInterfaceHardwareAddrWithGetmac as we can. Alex |
Sorry, I don't understand why it's related to. If you want to have a unit test which verifies payload for some reason, please do it. I don't think TestInterfaceHardwareAddrWithGetmac is a unit or integration test case. It looks an end-to-end test case. For standard library, there's no reason to prefer end-to-end test to unit/integration test. |
CL https://golang.org/cl/17994 mentions this issue. |
This
c:\dev\go\src\net>go test -short net
--- FAIL: TestInterfacesWithNetsh (0.34s)
net_windows_test.go:253: unexpected interface list ["Local Area Connection" "Loopback Pseudo-Interface 1" "isatap.sge.local"], want ["Local Area Connection" "Loopback Pseudo-Interface 1"]
--- FAIL: TestInterfaceHardwareAddrWithGetmac (0.67s)
net_windows_test.go:449: unexpected MAC addresses ["Local Area Connection=00:82:34:95:45:11" "isatap.sge.local=00:00:00:00:00:00:00:e0"], want ["Local Area Connection=00:82:34:95:45:11"]
FAIL
FAIL net 13.452s
fails on one of my computers. We would have to rearrange tests a little bit.
/cc @mikioh
Alex
The text was updated successfully, but these errors were encountered: