Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / net / interface_bsd_test.go
blob947dde71e61b2935c062a0366bb5d1a73672a6a5
1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 // +build darwin dragonfly freebsd netbsd openbsd
7 package net
9 import (
10 "errors"
11 "fmt"
12 "os/exec"
13 "runtime"
16 func (ti *testInterface) setBroadcast(vid int) error {
17 if runtime.GOOS == "openbsd" {
18 ti.name = fmt.Sprintf("vether%d", vid)
19 } else {
20 ti.name = fmt.Sprintf("vlan%d", vid)
22 xname, err := exec.LookPath("ifconfig")
23 if err != nil {
24 return err
26 ti.setupCmds = append(ti.setupCmds, &exec.Cmd{
27 Path: xname,
28 Args: []string{"ifconfig", ti.name, "create"},
30 ti.teardownCmds = append(ti.teardownCmds, &exec.Cmd{
31 Path: xname,
32 Args: []string{"ifconfig", ti.name, "destroy"},
34 return nil
37 func (ti *testInterface) setPointToPoint(suffix int) error {
38 ti.name = fmt.Sprintf("gif%d", suffix)
39 xname, err := exec.LookPath("ifconfig")
40 if err != nil {
41 return err
43 ti.setupCmds = append(ti.setupCmds, &exec.Cmd{
44 Path: xname,
45 Args: []string{"ifconfig", ti.name, "create"},
47 ti.setupCmds = append(ti.setupCmds, &exec.Cmd{
48 Path: xname,
49 Args: []string{"ifconfig", ti.name, "inet", ti.local, ti.remote},
51 ti.teardownCmds = append(ti.teardownCmds, &exec.Cmd{
52 Path: xname,
53 Args: []string{"ifconfig", ti.name, "destroy"},
55 return nil
58 func (ti *testInterface) setLinkLocal(suffix int) error {
59 return errors.New("not yet implemented for BSD")