]> Cypherpunks repositories - gostls13.git/commitdiff
os/user: simplify skipping listGroups test
authorKir Kolyshkin <kolyshkin@gmail.com>
Thu, 24 Jun 2021 03:01:33 +0000 (20:01 -0700)
committerTobias Klauser <tobias.klauser@gmail.com>
Sat, 28 Aug 2021 18:48:37 +0000 (18:48 +0000)
This is not implemented on AIX and Illumos, and we already have a
mechanism to skip the test case -- let's use it.

Change-Id: Idb1cc2d716cf6d0731e93dfc3aa7853b9edec41f
Reviewed-on: https://go-review.googlesource.com/c/go/+/330752
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/os/user/listgroups_aix.go
src/os/user/listgroups_illumos.go
src/os/user/user_test.go

index d2fdfdc6b1e3b7bf8624659d874b1dfcf9928e2c..fbc1deb03fd13dd9a7273546ea988808be01f6f6 100644 (file)
@@ -9,6 +9,12 @@ package user
 
 import "fmt"
 
+// Not implemented on AIX, see golang.org/issue/30563.
+
+func init() {
+       groupListImplemented = false
+}
+
 func listGroups(u *User) ([]string, error) {
        return nil, fmt.Errorf("user: list groups for %s: not supported on AIX", u.Username)
 }
index d25e0339b99593d909c012cbdc274de242f68dad..e783b260808cc4d6571fee6816ac6fa915faa5d9 100644 (file)
@@ -13,6 +13,12 @@ package user
 
 import "fmt"
 
+// Not implemented on illumos, see golang.org/issue/14709.
+
+func init() {
+       groupListImplemented = false
+}
+
 func listGroups(u *User) ([]string, error) {
        return nil, fmt.Errorf("user: list groups for %s: not supported on illumos", u.Username)
 }
index d8a465edac67a246b31a4e09dff06c09209ae2a6..80251749a7d670e4306aa60abce77583b728cdba 100644 (file)
@@ -5,7 +5,6 @@
 package user
 
 import (
-       "runtime"
        "testing"
 )
 
@@ -128,12 +127,6 @@ func checkGroupList(t *testing.T) {
 
 func TestGroupIds(t *testing.T) {
        checkGroupList(t)
-       if runtime.GOOS == "aix" {
-               t.Skip("skipping GroupIds, see golang.org/issue/30563")
-       }
-       if runtime.GOOS == "illumos" {
-               t.Skip("skipping GroupIds, see golang.org/issue/14709")
-       }
        user, err := Current()
        if err != nil {
                t.Fatalf("Current(): %v", err)