mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-02 07:07:33 -04:00
unix: enable TestPassFD on AIX 7.2 TL >= 2
Follow CL 171339 and enable TestPassFD for AIX 7.2 TL >= 2 Change-Id: Icf781798a6f9fe99a57c23bc7f7e7c1361bdcec2 Reviewed-on: https://go-review.googlesource.com/c/sys/+/171941 Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
16da32be82
commit
3fd5a3612c
@@ -15,6 +15,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strconv"
|
||||||
"syscall"
|
"syscall"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@@ -167,8 +168,26 @@ func TestPassFD(t *testing.T) {
|
|||||||
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") {
|
||||||
t.Skip("cannot exec subprocess on iOS, skipping test")
|
t.Skip("cannot exec subprocess on iOS, skipping test")
|
||||||
}
|
}
|
||||||
|
|
||||||
if runtime.GOOS == "aix" {
|
if runtime.GOOS == "aix" {
|
||||||
t.Skip("getsockname issue on AIX 7.2 tl1, skipping test")
|
// Unix network isn't properly working on AIX
|
||||||
|
// 7.2 with Technical Level < 2
|
||||||
|
out, err := exec.Command("oslevel", "-s").Output()
|
||||||
|
if err != nil {
|
||||||
|
t.Skipf("skipping on AIX because oslevel -s failed: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(out) < len("7200-XX-ZZ-YYMM") { // AIX 7.2, Tech Level XX, Service Pack ZZ, date YYMM
|
||||||
|
t.Skip("skipping on AIX because oslevel -s hasn't the right length")
|
||||||
|
}
|
||||||
|
aixVer := string(out[:4])
|
||||||
|
tl, err := strconv.Atoi(string(out[5:7]))
|
||||||
|
if err != nil {
|
||||||
|
t.Skipf("skipping on AIX because oslevel -s output cannot be parsed: %v", err)
|
||||||
|
}
|
||||||
|
if aixVer < "7200" || (aixVer == "7200" && tl < 2) {
|
||||||
|
t.Skip("skipped on AIX versions previous to 7.2 TL 2")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
|
if os.Getenv("GO_WANT_HELPER_PROCESS") == "1" {
|
||||||
|
|||||||
Reference in New Issue
Block a user