فهرست منبع

ipv6: disable multicast packet delivery tests on darwin 12 or below

Fixes golang/go#17015.

Change-Id: Icfb7a689667e0f1df345d63558f2956596da9fb9
Reviewed-on: https://go-review.googlesource.com/28999
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Mikio Hara 9 سال پیش
والد
کامیت
67a4d4ecbc
2فایلهای تغییر یافته به همراه6 افزوده شده و 33 حذف شده
  1. 0 27
      ipv6/main_test.go
  2. 6 6
      ipv6/multicast_test.go

+ 0 - 27
ipv6/main_test.go

@@ -1,27 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ipv6_test
-
-import (
-	"flag"
-	"fmt"
-	"os"
-	"os/exec"
-	"runtime"
-	"strings"
-	"testing"
-)
-
-func TestMain(m *testing.M) {
-	flag.Parse()
-	if runtime.GOOS == "darwin" {
-		vers, _ := exec.Command("sw_vers", "-productVersion").Output()
-		if string(vers) == "10.8" || strings.HasPrefix(string(vers), "10.8.") {
-			fmt.Fprintf(os.Stderr, "# skipping tests on OS X 10.8 to avoid kernel panics; golang.org/issue/17015\n")
-			os.Exit(0)
-		}
-	}
-	os.Exit(m.Run())
-}

+ 6 - 6
ipv6/multicast_test.go

@@ -29,15 +29,15 @@ var packetConnReadWriteMulticastUDPTests = []struct {
 
 
 func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 func TestPacketConnReadWriteMulticastUDP(t *testing.T) {
 	switch runtime.GOOS {
 	switch runtime.GOOS {
-	case "freebsd": // due to a bug on loopback marking
-		// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.
-		t.Skipf("not supported on %s", runtime.GOOS)
 	case "nacl", "plan9", "windows":
 	case "nacl", "plan9", "windows":
 		t.Skipf("not supported on %s", runtime.GOOS)
 		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	}
 	if !supportsIPv6 {
 	if !supportsIPv6 {
 		t.Skip("ipv6 is not supported")
 		t.Skip("ipv6 is not supported")
 	}
 	}
+	if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
+		t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
+	}
 	ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	ifi := nettest.RoutedInterface("ip6", net.FlagUp|net.FlagMulticast|net.FlagLoopback)
 	if ifi == nil {
 	if ifi == nil {
 		t.Skipf("not available on %s", runtime.GOOS)
 		t.Skipf("not available on %s", runtime.GOOS)
@@ -129,15 +129,15 @@ var packetConnReadWriteMulticastICMPTests = []struct {
 
 
 func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 func TestPacketConnReadWriteMulticastICMP(t *testing.T) {
 	switch runtime.GOOS {
 	switch runtime.GOOS {
-	case "freebsd": // due to a bug on loopback marking
-		// See http://www.freebsd.org/cgi/query-pr.cgi?pr=180065.
-		t.Skipf("not supported on %s", runtime.GOOS)
 	case "nacl", "plan9", "windows":
 	case "nacl", "plan9", "windows":
 		t.Skipf("not supported on %s", runtime.GOOS)
 		t.Skipf("not supported on %s", runtime.GOOS)
 	}
 	}
 	if !supportsIPv6 {
 	if !supportsIPv6 {
 		t.Skip("ipv6 is not supported")
 		t.Skip("ipv6 is not supported")
 	}
 	}
+	if !nettest.SupportsIPv6MulticastDeliveryOnLoopback() {
+		t.Skipf("multicast delivery doesn't work correctly on %s", runtime.GOOS)
+	}
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 	if m, ok := nettest.SupportsRawIPSocket(); !ok {
 		t.Skip(m)
 		t.Skip(m)
 	}
 	}