mirror of https://github.com/vishvananda/netlink
Run gofmt -s -w on the project
This commit is contained in:
parent
5f5d5cddcf
commit
c27b7f7359
|
@ -569,7 +569,7 @@ func TestRouteMultiPath(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
idx := link.Attrs().Index
|
idx := link.Attrs().Index
|
||||||
route := Route{Dst: dst, MultiPath: []*NexthopInfo{&NexthopInfo{LinkIndex: idx}, &NexthopInfo{LinkIndex: idx}}}
|
route := Route{Dst: dst, MultiPath: []*NexthopInfo{{LinkIndex: idx}, {LinkIndex: idx}}}
|
||||||
if err := RouteAdd(&route); err != nil {
|
if err := RouteAdd(&route); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -719,58 +719,58 @@ func TestRouteEqual(t *testing.T) {
|
||||||
seg6encap := &SEG6Encap{Mode: nl.SEG6_IPTUN_MODE_ENCAP}
|
seg6encap := &SEG6Encap{Mode: nl.SEG6_IPTUN_MODE_ENCAP}
|
||||||
seg6encap.Segments = []net.IP{net.ParseIP("fc00:a000::11")}
|
seg6encap.Segments = []net.IP{net.ParseIP("fc00:a000::11")}
|
||||||
cases := []Route{
|
cases := []Route{
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
ILinkIndex: 21,
|
ILinkIndex: 21,
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Protocol: 20,
|
Protocol: 20,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Priority: 20,
|
Priority: 20,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Type: 20,
|
Type: 20,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Table: 200,
|
Table: 200,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Tos: 1,
|
Tos: 1,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 20,
|
LinkIndex: 20,
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Flags: int(FLAG_ONLINK),
|
Flags: int(FLAG_ONLINK),
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Dst: &net.IPNet{
|
Dst: &net.IPNet{
|
||||||
IP: net.IPv4(192, 168, 0, 0),
|
IP: net.IPv4(192, 168, 0, 0),
|
||||||
|
@ -778,7 +778,7 @@ func TestRouteEqual(t *testing.T) {
|
||||||
},
|
},
|
||||||
Src: net.IPv4(127, 1, 1, 1),
|
Src: net.IPv4(127, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Scope: unix.RT_SCOPE_LINK,
|
Scope: unix.RT_SCOPE_LINK,
|
||||||
Dst: &net.IPNet{
|
Dst: &net.IPNet{
|
||||||
|
@ -787,7 +787,7 @@ func TestRouteEqual(t *testing.T) {
|
||||||
},
|
},
|
||||||
Src: net.IPv4(127, 1, 1, 1),
|
Src: net.IPv4(127, 1, 1, 1),
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 3,
|
LinkIndex: 3,
|
||||||
Dst: &net.IPNet{
|
Dst: &net.IPNet{
|
||||||
IP: net.IPv4(1, 1, 1, 1),
|
IP: net.IPv4(1, 1, 1, 1),
|
||||||
|
@ -800,21 +800,21 @@ func TestRouteEqual(t *testing.T) {
|
||||||
Type: unix.RTN_UNICAST,
|
Type: unix.RTN_UNICAST,
|
||||||
Tos: 14,
|
Tos: 14,
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
MPLSDst: &mplsDst,
|
MPLSDst: &mplsDst,
|
||||||
NewDst: &MPLSDestination{
|
NewDst: &MPLSDestination{
|
||||||
Labels: []int{200, 300},
|
Labels: []int{200, 300},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
Encap: &MPLSEncap{
|
Encap: &MPLSEncap{
|
||||||
Labels: []int{100},
|
Labels: []int{100},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Dst: &net.IPNet{
|
Dst: &net.IPNet{
|
||||||
IP: net.IPv4(10, 0, 0, 102),
|
IP: net.IPv4(10, 0, 0, 102),
|
||||||
|
@ -822,42 +822,42 @@ func TestRouteEqual(t *testing.T) {
|
||||||
},
|
},
|
||||||
Encap: seg6encap,
|
Encap: seg6encap,
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
MultiPath: []*NexthopInfo{&NexthopInfo{LinkIndex: 10}, &NexthopInfo{LinkIndex: 20}},
|
MultiPath: []*NexthopInfo{{LinkIndex: 10}, {LinkIndex: 20}},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
MultiPath: []*NexthopInfo{&NexthopInfo{
|
MultiPath: []*NexthopInfo{{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
}, &NexthopInfo{LinkIndex: 20}},
|
}, {LinkIndex: 20}},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
MultiPath: []*NexthopInfo{&NexthopInfo{
|
MultiPath: []*NexthopInfo{{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Gw: net.IPv4(1, 1, 1, 1),
|
Gw: net.IPv4(1, 1, 1, 1),
|
||||||
Encap: &MPLSEncap{
|
Encap: &MPLSEncap{
|
||||||
Labels: []int{100},
|
Labels: []int{100},
|
||||||
},
|
},
|
||||||
}, &NexthopInfo{LinkIndex: 20}},
|
}, {LinkIndex: 20}},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
MultiPath: []*NexthopInfo{&NexthopInfo{
|
MultiPath: []*NexthopInfo{{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
NewDst: &MPLSDestination{
|
NewDst: &MPLSDestination{
|
||||||
Labels: []int{200, 300},
|
Labels: []int{200, 300},
|
||||||
},
|
},
|
||||||
}, &NexthopInfo{LinkIndex: 20}},
|
}, {LinkIndex: 20}},
|
||||||
},
|
},
|
||||||
Route{
|
{
|
||||||
Dst: nil,
|
Dst: nil,
|
||||||
MultiPath: []*NexthopInfo{&NexthopInfo{
|
MultiPath: []*NexthopInfo{{
|
||||||
LinkIndex: 10,
|
LinkIndex: 10,
|
||||||
Encap: seg6encap,
|
Encap: seg6encap,
|
||||||
}, &NexthopInfo{LinkIndex: 20}},
|
}, {LinkIndex: 20}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for i1 := range cases {
|
for i1 := range cases {
|
||||||
|
|
Loading…
Reference in New Issue