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: TestSysctlUint64 fails on freebsd/arm #21375

Closed
bradfitz opened this issue Aug 9, 2017 · 2 comments
Closed

x/sys/unix: TestSysctlUint64 fails on freebsd/arm #21375

bradfitz opened this issue Aug 9, 2017 · 2 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Aug 9, 2017

TestSysctlUint64 fails on freebsd/arm:

https://build.golang.org/log/d2619c8b0011d695de308cf3e1fbe159d858d69c

--- FAIL: TestSysctlUint64 (0.00s)
	syscall_freebsd_test.go:26: no such file or directory
FAIL
FAIL	golang.org/x/sys/unix	0.075s

Test is just:

func TestSysctlUint64(t *testing.T) {
        _, err := unix.SysctlUint64("security.mac.labeled")
        if err != nil {
                t.Fatal(err)
        }
}               

It was changed to security.mac.labeled in golang/sys@7a6e564 by @stevenh.

Maybe we need a different one for arm? Or does that FreeBSD kernel not have some kernel options compiled in?

/cc @paulzhol

@gopherbot gopherbot added this to the Unreleased milestone Aug 9, 2017
@bradfitz bradfitz added NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure. help wanted labels Aug 9, 2017
@paulzhol
Copy link
Member

paulzhol commented Aug 9, 2017

Yes I don't have MAC support compiled in.
It appears only in 3 ARM boards, and it's commented out:

$ egrep -rn 'options[[:space:]]*MAC' /usr/src/sys/arm
/usr/src/sys/arm/conf/ATMEL:70:#options 	MAC			# TrustedBSD MAC Framework
/usr/src/sys/arm/conf/ETHERNUT5:66:#options 	MAC			# TrustedBSD MAC Framework
/usr/src/sys/arm/conf/SAM9260EK:78:#options 	MAC			# TrustedBSD MAC Framework

So maybe it's not a good idea to turn it on just for the test.

How about we use vm.swap_total instead? It's a SYSCTL_QUAD instead of SYSCTL_UQUAD used for security.mac.labeled, but it's still a 64-bit value on all platforms.

@gopherbot
Copy link

Change https://golang.org/cl/54390 mentions this issue: unix: Use vm.swap_total for FreeBSD TestSysctlUint64

micanzhang pushed a commit to micanzhang/sys that referenced this issue Sep 12, 2017
Fixes golang/go#21375

Change-Id: Ibb33df9d71eb3a935a1f8f9f0ad1f180211e8ce4
Reviewed-on: https://go-review.googlesource.com/54390
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@golang golang locked and limited conversation to collaborators Aug 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done. 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

3 participants