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

x/sys/unix: TestDevices test fails on Solaris #25528

Closed
hyangah opened this issue May 23, 2018 · 10 comments
Closed

x/sys/unix: TestDevices test fails on Solaris #25528

hyangah opened this issue May 23, 2018 · 10 comments

Comments

@hyangah
Copy link
Contributor

hyangah commented May 23, 2018

Discovered when the package was vendored and tested by builders.
This broke both Solaris builders.

https://build.golang.org/log/7c8e4f372950715426cac40c9a124602804df843

--- FAIL: TestDevices (0.00s)
--- FAIL: TestDevices//dev/zero_134:12 (0.00s)
dev_solaris_test.go:41: for /dev/zero Major(0x840000000c) == 132, want 134
dev_solaris_test.go:47: for /dev/zero Mkdev(134, 12) == 0x860000000c, want 0x840000000c
--- FAIL: TestDevices//dev/null_134:2 (0.00s)
dev_solaris_test.go:41: for /dev/null Major(0x8400000002) == 132, want 134
dev_solaris_test.go:47: for /dev/null Mkdev(134, 2) == 0x8600000002, want 0x8400000002
--- FAIL: TestDevices//dev/ptyp0_172:0 (0.00s)
dev_solaris_test.go:41: for /dev/ptyp0 Major(0xa900000000) == 169, want 172
dev_solaris_test.go:47: for /dev/ptyp0 Mkdev(172, 0) == 0xac00000000, want 0xa900000000
--- FAIL: TestDevices//dev/ttyp0_175:0 (0.00s)
dev_solaris_test.go:41: for /dev/ttyp0 Major(0xac00000000) == 172, want 175
dev_solaris_test.go:47: for /dev/ttyp0 Mkdev(175, 0) == 0xaf00000000, want 0xac00000000
--- FAIL: TestDevices//dev/ttyp1_175:1 (0.00s)
dev_solaris_test.go:41: for /dev/ttyp1 Major(0xac00000001) == 172, want 175
dev_solaris_test.go:47: for /dev/ttyp1 Mkdev(175, 1) == 0xaf00000001, want 0xac00000001

@hyangah hyangah changed the title golang.org/x/crypto/ssh/terminal: TestDevices test fails on Solaris golang.org/x/sys/unix: TestDevices test fails on Solaris May 23, 2018
@hyangah hyangah changed the title golang.org/x/sys/unix: TestDevices test fails on Solaris x/sys/unix: TestDevices test fails on Solaris May 23, 2018
@gopherbot gopherbot added this to the Unreleased milestone May 23, 2018
@bradfitz
Copy link
Contributor

/cc @tklauser, @4ad

@bradfitz
Copy link
Contributor

I think we can just skip or delete those tests. They seem specific to one Solaris variant or version and I suspect it's not guaranteed that those device numbers are guaranteed stable over time.

@4ad
Copy link
Member

4ad commented May 23, 2018

Yes, let's drop this, the only way to do this is by parsing /etc/name_to_major, which is harder and more work (so more error prone) than the thing being tested.

@hyangah
Copy link
Contributor Author

hyangah commented May 23, 2018

Ok. I also noticed the same test with hardcoded numbers for other OSes (dev_*_test.go). What about them?

@4ad
Copy link
Member

4ad commented May 23, 2018

I don't know how other operating systems are supposed to work.

@gopherbot
Copy link

Change https://golang.org/cl/114092 mentions this issue: unix: delete TestDevices test for Solaris

@gopherbot
Copy link

Change https://golang.org/cl/114094 mentions this issue: cmd/vendor/.../unix: pick up upstream fixes for broken tests

gopherbot pushed a commit that referenced this issue May 23, 2018
Update #25528
Update #25529

Change-Id: I47ec282e76eb7740547e220ac00d6a7992e17b9e
Reviewed-on: https://go-review.googlesource.com/114094
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@tklauser
Copy link
Member

Ok. I also noticed the same test with hardcoded numbers for other OSes (dev_*_test.go). What about them?

At least on Linux, these numbers are guaranteed to be stable between releases. I'm not sure about the BSDs. On Darwin most of the major/minor numbers are generated dynamically and the few static ones (which are used in the test) might change as well in future releases.

I'll send a CL removing these tests on *BSD and Darwin as well.

@gopherbot
Copy link

Change https://golang.org/cl/114396 mentions this issue: unix: delete TestDevices for *BSD and Darwin

gopherbot pushed a commit to golang/sys that referenced this issue May 24, 2018
Instead, add a small test verify Major, Minor and Mkdev using arbitrary
numbers.

Leave TestDevices on Linux as its major/minor numbers are guaranteed
stable.

Updates golang/go#25528
Updates golang/go#25535

Change-Id: Ic105211660d80f9b3508ca9d518e9fac3b7e3beb
Reviewed-on: https://go-review.googlesource.com/114396
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/114416 mentions this issue: cmd/vendor/golang/x: pick up upstream fixes for broken android and iOS tests

gopherbot pushed a commit that referenced this issue May 24, 2018
…d iOS tests

Pick up the changes from CL 114395, CL 114396 and CL 114415.

By re-running govendor in the latest version, some files from
golang.org/x/sys/unix which are ignored for the build also got removed
from the vendored copy.

Updates #25528
Updates #25535

Change-Id: I5c0002fc3a37d6abaafed2e15cc3e2ade803ad7b
Reviewed-on: https://go-review.googlesource.com/114416
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants