diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-09-06 00:09:12 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-09-06 00:49:31 +0900 |
commit | 9b20eb3111e0d742a11c7a5233d8b425801a6ca0 (patch) | |
tree | 09cab78cc240b6560ce29e82e1bbd09d3d7ac9cd /server | |
parent | c6caa73f1d6319dbe54a1ebe48922ac2a02a19f3 (diff) |
server: go fmt
Somehow bad formatted code was merged.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server')
-rw-r--r-- | server/zclient_test.go | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/server/zclient_test.go b/server/zclient_test.go index 257a1d06..dcb3cb5c 100644 --- a/server/zclient_test.go +++ b/server/zclient_test.go @@ -14,12 +14,13 @@ // limitations under the License. package server + import ( - "github.com/stretchr/testify/assert" - "github.com/osrg/gobgp/zebra" "github.com/osrg/gobgp/table" - "testing" + "github.com/osrg/gobgp/zebra" + "github.com/stretchr/testify/assert" "net" + "testing" ) func Test_createPathFromIPRouteMessage(t *testing.T) { @@ -27,24 +28,24 @@ func Test_createPathFromIPRouteMessage(t *testing.T) { m := &zebra.Message{} h := &zebra.Header{ - Len: zebra.HEADER_SIZE, - Marker: zebra.HEADER_MARKER, + Len: zebra.HEADER_SIZE, + Marker: zebra.HEADER_MARKER, Version: zebra.VERSION, Command: zebra.IPV4_ROUTE_ADD, } b := &zebra.IPRouteBody{ - Type: zebra.ROUTE_TYPE(zebra.ROUTE_STATIC), - Flags: zebra.FLAG(zebra.FLAG_SELECTED), - Message: zebra.MESSAGE_NEXTHOP | zebra.MESSAGE_DISTANCE | zebra.MESSAGE_METRIC, + Type: zebra.ROUTE_TYPE(zebra.ROUTE_STATIC), + Flags: zebra.FLAG(zebra.FLAG_SELECTED), + Message: zebra.MESSAGE_NEXTHOP | zebra.MESSAGE_DISTANCE | zebra.MESSAGE_METRIC, SAFI: zebra.SAFI(zebra.SAFI_UNICAST), Prefix: net.ParseIP("192.168.100.0"), - PrefixLength :uint8(24), - Nexthops : []net.IP{net.ParseIP("0.0.0.0")}, - Ifindexs : []uint32{1}, + PrefixLength: uint8(24), + Nexthops: []net.IP{net.ParseIP("0.0.0.0")}, + Ifindexs: []uint32{1}, Distance: uint8(0), - Metric : uint32(100), - Api : zebra.API_TYPE(zebra.IPV4_ROUTE_ADD), + Metric: uint32(100), + Api: zebra.API_TYPE(zebra.IPV4_ROUTE_ADD), } m.Header = *h @@ -57,7 +58,7 @@ func Test_createPathFromIPRouteMessage(t *testing.T) { p := createPathFromIPRouteMessage(m, pi) assert.NotEqual(nil, p) assert.Equal("0.0.0.0", p.GetNexthop().String()) - assert.Equal("192.168.100.0/24",p.GetNlri().String()) + assert.Equal("192.168.100.0/24", p.GetNlri().String()) assert.True(p.IsFromZebra) assert.False(p.IsWithdraw) @@ -67,25 +68,24 @@ func Test_createPathFromIPRouteMessage(t *testing.T) { p = createPathFromIPRouteMessage(m, pi) assert.NotEqual(nil, p) assert.Equal("0.0.0.0", p.GetNexthop().String()) - assert.Equal("192.168.100.0/24",p.GetNlri().String()) + assert.Equal("192.168.100.0/24", p.GetNlri().String()) med, _ := p.GetMed() assert.Equal(uint32(100), med) assert.True(p.IsFromZebra) assert.True(p.IsWithdraw) - // IPv6 h.Command = zebra.IPV6_ROUTE_ADD b.Prefix = net.ParseIP("2001:db8:0:f101::") b.PrefixLength = uint8(64) - b.Nexthops = []net.IP{net.ParseIP("::")} + b.Nexthops = []net.IP{net.ParseIP("::")} m.Header = *h m.Body = b p = createPathFromIPRouteMessage(m, pi) assert.NotEqual(nil, p) assert.Equal("::", p.GetNexthop().String()) - assert.Equal("2001:db8:0:f101::/64",p.GetNlri().String()) + assert.Equal("2001:db8:0:f101::/64", p.GetNlri().String()) med, _ = p.GetMed() assert.Equal(uint32(100), med) assert.True(p.IsFromZebra) @@ -97,8 +97,8 @@ func Test_createPathFromIPRouteMessage(t *testing.T) { p = createPathFromIPRouteMessage(m, pi) assert.NotEqual(nil, p) assert.Equal("::", p.GetNexthop().String()) - assert.Equal("2001:db8:0:f101::/64",p.GetNlri().String()) + assert.Equal("2001:db8:0:f101::/64", p.GetNlri().String()) assert.True(p.IsFromZebra) assert.True(p.IsWithdraw) -}
\ No newline at end of file +} |