diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-05-27 21:48:32 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-05-27 21:48:32 +0900 |
commit | 95e538791934a1a6226f4e6bdcc09453a77903a6 (patch) | |
tree | bc8256c5f732a2172b532d4551278c4ab1d3630b | |
parent | 497412e120d80844e55c79fbe47ce62fbec26edc (diff) |
policy: fix wrong reference to the modified path
-rw-r--r-- | policy/policy_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/policy/policy_test.go b/policy/policy_test.go index 054d4d9f..e3951584 100644 --- a/policy/policy_test.go +++ b/policy/policy_test.go @@ -1216,7 +1216,8 @@ func TestPolicyMatchAndAddCommunities(t *testing.T) { assert.Equal(t, true, match) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) - assert.Equal(t, []uint32{stringToCommunityValue(community)}, path.GetCommunities()) + log.Debug(newPath) + assert.Equal(t, []uint32{stringToCommunityValue(community)}, newPath.GetCommunities()) } @@ -1288,7 +1289,7 @@ func TestPolicyMatchAndReplaceCommunities(t *testing.T) { assert.Equal(t, true, match) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) - assert.Equal(t, []uint32{stringToCommunityValue(community)}, path.GetCommunities()) + assert.Equal(t, []uint32{stringToCommunityValue(community)}, newPath.GetCommunities()) } func TestPolicyMatchAndRemoveCommunities(t *testing.T) { @@ -1360,7 +1361,7 @@ func TestPolicyMatchAndRemoveCommunities(t *testing.T) { assert.Equal(t, true, match) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) - assert.Equal(t, []uint32{stringToCommunityValue(community2)}, path.GetCommunities()) + assert.Equal(t, []uint32{stringToCommunityValue(community2)}, newPath.GetCommunities()) } func TestPolicyMatchAndClearCommunities(t *testing.T) { @@ -1432,7 +1433,7 @@ func TestPolicyMatchAndClearCommunities(t *testing.T) { assert.Equal(t, true, match) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) - assert.Equal(t, []uint32{}, path.GetCommunities()) + assert.Equal(t, []uint32{}, newPath.GetCommunities()) } func stringToCommunityValue(comStr string) uint32 { |