Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bio-rd
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
danet
bio-rd
Commits
95a94384
Commit
95a94384
authored
6 years ago
by
Oliver Herms
Browse files
Options
Downloads
Patches
Plain Diff
moar tests
parent
229c3b43
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
protocols/bgp/server/bmp_server_test.go
+242
-0
242 additions, 0 deletions
protocols/bgp/server/bmp_server_test.go
with
242 additions
and
0 deletions
protocols/bgp/server/bmp_server_test.go
+
242
−
0
View file @
95a94384
...
...
@@ -1449,6 +1449,8 @@ func TestIntegrationPeerUpRouteMonitorIPv6WithClientBeforeBMPPeer(t *testing.T)
name
string
afi
uint8
unregister
bool
doubleSubscribe
bool
doubleUnsubscribe
bool
input
[]
byte
expectedRouteCount
int
}{
...
...
@@ -1684,6 +1686,240 @@ func TestIntegrationPeerUpRouteMonitorIPv6WithClientBeforeBMPPeer(t *testing.T)
},
expectedRouteCount
:
1
,
},
{
name
:
"IPv4 with double unregister"
,
afi
:
packet
.
IPv4AFI
,
doubleUnsubscribe
:
true
,
unregister
:
true
,
input
:
[]
byte
{
// Common Header
3
,
// Version
0
,
0
,
0
,
142
,
// Message Length
3
,
// Msg Type = Peer Up Notification
// Per Peer Header
0
,
// Peer Type
0
,
// Peer Flags
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// Peer Distinguisher
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
40
,
// 10.20.30.40 peer address
0
,
0
,
0
,
100
,
// Peer AS
0
,
0
,
0
,
255
,
// Peer BGP ID
0
,
0
,
0
,
0
,
// Timestamp s
0
,
0
,
0
,
0
,
// Timestamp µs
// Peer Up Notification
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
41
,
// 10.20.30.41 local address
0
,
123
,
// Local Port
0
,
234
,
// Remote Port
// Sent OPEN message
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
37
,
// Length
1
,
// Open message type
4
,
// BGP Version
0
,
200
,
// AS
0
,
180
,
// Hold Time
1
,
0
,
0
,
1
,
// BGP Identifier
8
,
// Opt param length
2
,
6
,
1
,
4
,
// MP BGP
0
,
2
,
// IPv6
0
,
1
,
// Unicast
// Received OPEN message
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
37
,
// Length
1
,
// Open message type
4
,
// BGP Version
0
,
100
,
// AS
0
,
180
,
// Hold Time
1
,
0
,
0
,
255
,
// BGP Identifier
8
,
// Opt param length
2
,
6
,
1
,
4
,
// MP BGP
0
,
2
,
// IPv6
0
,
1
,
// Unicast
// SECOND MESSAGE:
// Common Header
3
,
// Version
0
,
0
,
0
,
116
,
// Message Length
0
,
// Msg Type = Route Monitoring Message
// Per Peer Header
0
,
// Peer Type
0
,
// Peer Flags
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// Peer Distinguisher
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
40
,
// 10.20.30.40 peer address
0
,
0
,
0
,
100
,
// Peer AS
0
,
0
,
0
,
255
,
// Peer BGP ID
0
,
0
,
0
,
0
,
// Timestamp s
0
,
0
,
0
,
0
,
// Timestamp µs
// BGP Update
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
68
,
// Length
2
,
// Update
0
,
0
,
// Withdrawn Routes Length
0
,
41
,
// Total Path Attribute Length
255
,
// Attribute flags
1
,
// Attribute Type code (ORIGIN)
0
,
1
,
// Length
2
,
// INCOMPLETE
0
,
// Attribute flags
2
,
// Attribute Type code (AS Path)
12
,
// Length
2
,
// Type = AS_SEQUENCE
2
,
// Path Segment Length
59
,
65
,
// AS15169
12
,
248
,
// AS3320
1
,
// Type = AS_SET
2
,
// Path Segment Length
59
,
65
,
// AS15169
12
,
248
,
// AS3320
0
,
// Attribute flags
3
,
// Attribute Type code (Next Hop)
4
,
// Length
10
,
11
,
12
,
13
,
// Next Hop
0
,
// Attribute flags
4
,
// Attribute Type code (MED)
4
,
// Length
0
,
0
,
1
,
0
,
// MED 256
0
,
// Attribute flags
5
,
// Attribute Type code (Local Pref)
4
,
// Length
0
,
0
,
1
,
0
,
// Local Pref 256
// NLRI
24
,
192
,
168
,
0
,
},
expectedRouteCount
:
1
,
},
{
name
:
"IPv4 with double register"
,
afi
:
packet
.
IPv4AFI
,
doubleSubscribe
:
true
,
unregister
:
true
,
input
:
[]
byte
{
// Common Header
3
,
// Version
0
,
0
,
0
,
142
,
// Message Length
3
,
// Msg Type = Peer Up Notification
// Per Peer Header
0
,
// Peer Type
0
,
// Peer Flags
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// Peer Distinguisher
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
40
,
// 10.20.30.40 peer address
0
,
0
,
0
,
100
,
// Peer AS
0
,
0
,
0
,
255
,
// Peer BGP ID
0
,
0
,
0
,
0
,
// Timestamp s
0
,
0
,
0
,
0
,
// Timestamp µs
// Peer Up Notification
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
41
,
// 10.20.30.41 local address
0
,
123
,
// Local Port
0
,
234
,
// Remote Port
// Sent OPEN message
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
37
,
// Length
1
,
// Open message type
4
,
// BGP Version
0
,
200
,
// AS
0
,
180
,
// Hold Time
1
,
0
,
0
,
1
,
// BGP Identifier
8
,
// Opt param length
2
,
6
,
1
,
4
,
// MP BGP
0
,
2
,
// IPv6
0
,
1
,
// Unicast
// Received OPEN message
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
37
,
// Length
1
,
// Open message type
4
,
// BGP Version
0
,
100
,
// AS
0
,
180
,
// Hold Time
1
,
0
,
0
,
255
,
// BGP Identifier
8
,
// Opt param length
2
,
6
,
1
,
4
,
// MP BGP
0
,
2
,
// IPv6
0
,
1
,
// Unicast
// SECOND MESSAGE:
// Common Header
3
,
// Version
0
,
0
,
0
,
116
,
// Message Length
0
,
// Msg Type = Route Monitoring Message
// Per Peer Header
0
,
// Peer Type
0
,
// Peer Flags
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
// Peer Distinguisher
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
10
,
20
,
30
,
40
,
// 10.20.30.40 peer address
0
,
0
,
0
,
100
,
// Peer AS
0
,
0
,
0
,
255
,
// Peer BGP ID
0
,
0
,
0
,
0
,
// Timestamp s
0
,
0
,
0
,
0
,
// Timestamp µs
// BGP Update
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
0
,
68
,
// Length
2
,
// Update
0
,
0
,
// Withdrawn Routes Length
0
,
41
,
// Total Path Attribute Length
255
,
// Attribute flags
1
,
// Attribute Type code (ORIGIN)
0
,
1
,
// Length
2
,
// INCOMPLETE
0
,
// Attribute flags
2
,
// Attribute Type code (AS Path)
12
,
// Length
2
,
// Type = AS_SEQUENCE
2
,
// Path Segment Length
59
,
65
,
// AS15169
12
,
248
,
// AS3320
1
,
// Type = AS_SET
2
,
// Path Segment Length
59
,
65
,
// AS15169
12
,
248
,
// AS3320
0
,
// Attribute flags
3
,
// Attribute Type code (Next Hop)
4
,
// Length
10
,
11
,
12
,
13
,
// Next Hop
0
,
// Attribute flags
4
,
// Attribute Type code (MED)
4
,
// Length
0
,
0
,
1
,
0
,
// MED 256
0
,
// Attribute flags
5
,
// Attribute Type code (Local Pref)
4
,
// Length
0
,
0
,
1
,
0
,
// Local Pref 256
// NLRI
24
,
192
,
168
,
0
,
},
expectedRouteCount
:
1
,
},
{
name
:
"IPv6 without unregister"
,
afi
:
packet
.
IPv6AFI
,
...
...
@@ -1820,9 +2056,15 @@ func TestIntegrationPeerUpRouteMonitorIPv6WithClientBeforeBMPPeer(t *testing.T)
client
:=
locRIB
.
New
()
r
.
subscribeRIBs
(
client
,
test
.
afi
)
if
test
.
doubleSubscribe
{
r
.
subscribeRIBs
(
client
,
test
.
afi
)
}
if
test
.
unregister
{
r
.
unsubscribeRIBs
(
client
,
test
.
afi
)
if
test
.
doubleUnsubscribe
{
r
.
unsubscribeRIBs
(
client
,
test
.
afi
)
}
}
go
r
.
serve
(
conB
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment