Skip to content
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: Windows test use PowerShell "getmac", not always available #20073

Open
bradfitz opened this issue Apr 21, 2017 · 14 comments
Open

net: Windows test use PowerShell "getmac", not always available #20073

bradfitz opened this issue Apr 21, 2017 · 14 comments
Labels
OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bradfitz
Copy link
Contributor

The Windows tests use PowerShell "getmac", which only works in Windows Server 2008.

In 2012 and 2016, it fails.

Maybe the replacement is now "Get-NetAdapter | select Name,MacAddress" ?

/cc @alexbrainman @mikioh

@bradfitz bradfitz added OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure. labels Apr 21, 2017
@bradfitz bradfitz added this to the Unplanned milestone Apr 21, 2017
gopherbot pushed a commit that referenced this issue Apr 21, 2017
This doesn't appear to be present on Windows Server 2012 or 2016:

https://build.golang.org/log/6ea21b99c9b8a2be20f9aeaec6c425b84faf1af7
https://build.golang.org/log/2bcf04f1df003577352f4f987a39a59a081094ee

Updates #17513
Updates #20073

Change-Id: I72820704b4cb16bb1720b7f6a9f2e10028c71334
Reviewed-on: https://go-review.googlesource.com/41395
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
@gopherbot
Copy link

CL https://golang.org/cl/41395 mentions this issue.

@as
Copy link
Contributor

as commented Apr 22, 2017

Wouldn't wmic nic get Name,MACAddress be easier? Almost every version of Windows since XP supports it.

@bradfitz
Copy link
Contributor Author

@as, feel free to fix things up. I don't know Windows well so I just disabled the test.

@siennathesane
Copy link

@bradfitz what is getmac used for in the larger scope?

@alexbrainman
Copy link
Member

@bradfitz what is getmac used for in the larger scope?

Perhaps I do not understand your question. But getmac command is used in TestInterfaceHardwareAddrWithGetmac in net package.

Alex

@siennathesane
Copy link

siennathesane commented Jun 4, 2017

Sorry, I meant what is the reason for shelling out getmac instead of just making the syscall? Is there a specific reason for doing so?

@alexbrainman
Copy link
Member

I meant what is the reason for shelling out getmac instead of just making the syscall?

TestInterfaceHardwareAddrWithGetmac tests the syscall. How do you propose to test syscall by calling syscall?

Alex

@siennathesane
Copy link

I misunderstood why getmac was needed, sorry! Still new to contributing.

@alexbrainman
Copy link
Member

I misunderstood why getmac was needed, sorry! Still new to contributing.

No worries.

Alex

@gopherbot
Copy link

Change https://golang.org/cl/70845 mentions this issue: [release-branch.go1.8] net: skip Windows test using getmac if getmac cmdlet not available

gopherbot pushed a commit that referenced this issue Oct 25, 2017
…cmdlet not available

This doesn't appear to be present on Windows Server 2012 or 2016:

https://build.golang.org/log/6ea21b99c9b8a2be20f9aeaec6c425b84faf1af7
https://build.golang.org/log/2bcf04f1df003577352f4f987a39a59a081094ee

Updates #17513
Updates #20073

Change-Id: I72820704b4cb16bb1720b7f6a9f2e10028c71334
Reviewed-on: https://go-review.googlesource.com/41395
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-on: https://go-review.googlesource.com/70845
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/82975 mentions this issue: net: enable TestInterfaceHardwareAddrWithGetmac on all windows versions

@gopherbot
Copy link

Change https://golang.org/cl/85315 mentions this issue: Revert "net: enable TestInterfaceHardwareAddrWithGetmac on all windows versions"

gopherbot pushed a commit that referenced this issue Dec 25, 2017
this solution as it stands doesn't work with
non-english device names (#23191 (which has a fix))
and names some devices differently (#23153) probably due to the
fact that this test previously only ran on Server 2008.

Re-opens #20073

Change-Id: I5c36774ddd85ac07620b4015372d564acbb169ad
Reviewed-on: https://go-review.googlesource.com/85315
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
@gopherbot
Copy link

Change https://golang.org/cl/84935 mentions this issue: net: redirect output out of wmic command to file on Windows

@alexbrainman
Copy link
Member

CL 85315 was meant to reopen this issue, but the issue is still closed. Reopening manually.

Alex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-Windows Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

7 participants