icmp: don't run diagnostic tests by default, even in long mode
Change-Id: I4eec45705348437ec2ee7eae8d0d98db0f28152d
Reviewed-on: https://go-review.googlesource.com/c/155858
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/icmp/diag_test.go b/icmp/diag_test.go
index 2ecd465..176db1d 100644
--- a/icmp/diag_test.go
+++ b/icmp/diag_test.go
@@ -6,6 +6,7 @@
import (
"errors"
+ "flag"
"fmt"
"net"
"os"
@@ -21,6 +22,8 @@
"golang.org/x/net/ipv6"
)
+var testDiag = flag.Bool("diag", false, "whether to test ICMP message exchange with external network")
+
type diagTest struct {
network, address string
protocol int
@@ -28,7 +31,7 @@
}
func TestDiag(t *testing.T) {
- if testing.Short() {
+ if !*testDiag {
t.Skip("avoid external network")
}