diff options
author | Alexander Morozov <lk4d4math@gmail.com> | 2015-08-31 09:40:25 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2015-08-31 17:07:16 +0000 |
commit | 5483761c130dcd7e985c01dd82af93758732b3a7 (patch) | |
tree | 87ed772041ded70ab5f05603e554f9c9d51df29b /src/syscall/exec_linux_test.go | |
parent | ae82315b82672ca95c2b5365d7d18283981a40af (diff) | |
download | go-git-5483761c130dcd7e985c01dd82af93758732b3a7.tar.gz |
syscall: remove unused kernelVersion function from tests
Change-Id: If0d00999c58f7421e4da06e1822ba5abccf72cac
Reviewed-on: https://go-review.googlesource.com/14111
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/syscall/exec_linux_test.go')
-rw-r--r-- | src/syscall/exec_linux_test.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/syscall/exec_linux_test.go b/src/syscall/exec_linux_test.go index bbfd6d03df..e4ed6adff9 100644 --- a/src/syscall/exec_linux_test.go +++ b/src/syscall/exec_linux_test.go @@ -10,8 +10,6 @@ import ( "io/ioutil" "os" "os/exec" - "regexp" - "strconv" "strings" "syscall" "testing" @@ -72,22 +70,6 @@ func TestCloneNEWUSERAndRemapRootEnableSetgroups(t *testing.T) { testNEWUSERRemap(t, 0, 0, false) } -// kernelVersion returns the major and minor versions of the Linux -// kernel version. It calls t.Skip if it can't figure it out. -func kernelVersion(t *testing.T) (int, int) { - bytes, err := ioutil.ReadFile("/proc/version") - if err != nil { - t.Skipf("can't get kernel version: %v", err) - } - matches := regexp.MustCompile("([0-9]+).([0-9]+)").FindSubmatch(bytes) - if len(matches) < 3 { - t.Skipf("can't get kernel version from %s", bytes) - } - major, _ := strconv.Atoi(string(matches[1])) - minor, _ := strconv.Atoi(string(matches[2])) - return major, minor -} - func TestCloneNEWUSERAndRemapNoRootDisableSetgroups(t *testing.T) { if os.Getuid() == 0 { t.Skip("skipping unprivileged user only test") |