diff options
author | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2017-05-15 15:02:17 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-05-23 11:11:10 +0900 |
commit | 7497ce7eb7e19be757a5b46aeacf11c4271dc1f6 (patch) | |
tree | 31249b8a61928d84ac0c626c7fad94ca441325e5 /packet/bgp/bgp_test.go | |
parent | 4b3163278bcc8c1011b2422607e3f9d81d3537b0 (diff) |
packet/bgp: Redirect-IPv6 Flow Spec Traffic Filtering Action
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'packet/bgp/bgp_test.go')
-rw-r--r-- | packet/bgp/bgp_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packet/bgp/bgp_test.go b/packet/bgp/bgp_test.go index bb93cee5..362c8fb8 100644 --- a/packet/bgp/bgp_test.go +++ b/packet/bgp/bgp_test.go @@ -353,6 +353,26 @@ func Test_FlowSpecExtended(t *testing.T) { } } +func Test_IP6FlowSpecExtended(t *testing.T) { + assert := assert.New(t) + exts := make([]ExtendedCommunityInterface, 0) + exts = append(exts, NewRedirectIPv6AddressSpecificExtended("2001:db8::68", 1000)) + m1 := NewPathAttributeIP6ExtendedCommunities(exts) + buf1, err := m1.Serialize() + assert.Nil(err) + m2 := NewPathAttributeIP6ExtendedCommunities(nil) + err = m2.DecodeFromBytes(buf1) + assert.Nil(err) + buf2, _ := m2.Serialize() + if reflect.DeepEqual(m1, m2) == true { + t.Log("OK") + } else { + t.Error("Something wrong") + t.Error(len(buf1), m1, buf1) + t.Error(len(buf2), m2, buf2) + } +} + func Test_FlowSpecNlriv6(t *testing.T) { assert := assert.New(t) cmp := make([]FlowSpecComponentInterface, 0) |