diff --git a/unix/syscall_unix_test.go b/unix/syscall_unix_test.go index 14d25ca7..0e6f1c7b 100644 --- a/unix/syscall_unix_test.go +++ b/unix/syscall_unix_test.go @@ -15,6 +15,7 @@ import ( "os/exec" "path/filepath" "runtime" + "strconv" "syscall" "testing" "time" @@ -167,8 +168,26 @@ func TestPassFD(t *testing.T) { if runtime.GOOS == "darwin" && (runtime.GOARCH == "arm" || runtime.GOARCH == "arm64") { t.Skip("cannot exec subprocess on iOS, skipping test") } + 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" {