diff options
Diffstat (limited to 'table/policy_test.go')
-rw-r--r-- | table/policy_test.go | 210 |
1 files changed, 105 insertions, 105 deletions
diff --git a/table/policy_test.go b/table/policy_test.go index d7cc0254..38b55794 100644 --- a/table/policy_test.go +++ b/table/policy_test.go @@ -241,7 +241,7 @@ func TestPolicyNotMatch(t *testing.T) { r := NewRoutingPolicy() err := r.Reload(pl) assert.Nil(t, err) - pType, newPath := r.PolicyMap["pd1"].Apply(path) + pType, newPath := r.PolicyMap["pd1"].Apply(path, nil) assert.Equal(t, ROUTE_TYPE_NONE, pType) assert.Equal(t, newPath, path) } @@ -272,7 +272,7 @@ func TestPolicyMatchAndReject(t *testing.T) { r := NewRoutingPolicy() err := r.Reload(pl) assert.Nil(t, err) - pType, newPath := r.PolicyMap["pd1"].Apply(path) + pType, newPath := r.PolicyMap["pd1"].Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) } @@ -304,7 +304,7 @@ func TestPolicyMatchAndAccept(t *testing.T) { r := NewRoutingPolicy() err := r.Reload(pl) assert.Nil(t, err) - pType, newPath := r.PolicyMap["pd1"].Apply(path) + pType, newPath := r.PolicyMap["pd1"].Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.Equal(t, path, newPath) } @@ -347,11 +347,11 @@ func TestPolicyRejectOnlyPrefixSet(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path1) + pType, newPath := p.Apply(path1, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path1) - pType2, newPath2 := p.Apply(path2) + pType2, newPath2 := p.Apply(path2, nil) assert.Equal(t, ROUTE_TYPE_NONE, pType2) assert.Equal(t, newPath2, path2) } @@ -393,11 +393,11 @@ func TestPolicyRejectOnlyNeighborSet(t *testing.T) { r := NewRoutingPolicy() err := r.Reload(pl) assert.Nil(t, err) - pType, newPath := r.PolicyMap["pd1"].Apply(path1) + pType, newPath := r.PolicyMap["pd1"].Apply(path1, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path1) - pType2, newPath2 := r.PolicyMap["pd1"].Apply(path2) + pType2, newPath2 := r.PolicyMap["pd1"].Apply(path2, nil) assert.Equal(t, ROUTE_TYPE_NONE, pType2) assert.Equal(t, newPath2, path2) } @@ -447,11 +447,11 @@ func TestPolicyDifferentRoutefamilyOfPathAndPolicy(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType1, newPath1 := p.Apply(pathIPv4) + pType1, newPath1 := p.Apply(pathIPv4, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType1) assert.Equal(t, newPath1, pathIPv4) - pType2, newPath2 := p.Apply(pathIPv6) + pType2, newPath2 := p.Apply(pathIPv6, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType2) assert.Equal(t, newPath2, pathIPv6) } @@ -482,7 +482,7 @@ func TestAsPathLengthConditionEvaluate(t *testing.T) { c, _ := NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, true, c.Evaluate(path)) + assert.Equal(t, true, c.Evaluate(path, nil)) // create match condition asPathLength = config.AsPathLength{ @@ -492,7 +492,7 @@ func TestAsPathLengthConditionEvaluate(t *testing.T) { c, _ = NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, true, c.Evaluate(path)) + assert.Equal(t, true, c.Evaluate(path, nil)) // create match condition asPathLength = config.AsPathLength{ @@ -502,7 +502,7 @@ func TestAsPathLengthConditionEvaluate(t *testing.T) { c, _ = NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, false, c.Evaluate(path)) + assert.Equal(t, false, c.Evaluate(path, nil)) } func TestAsPathLengthConditionWithOtherCondition(t *testing.T) { @@ -547,7 +547,7 @@ func TestAsPathLengthConditionWithOtherCondition(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) @@ -589,7 +589,7 @@ func TestAs4PathLengthConditionEvaluate(t *testing.T) { c, _ := NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, true, c.Evaluate(path)) + assert.Equal(t, true, c.Evaluate(path, nil)) // create match condition asPathLength = config.AsPathLength{ @@ -599,7 +599,7 @@ func TestAs4PathLengthConditionEvaluate(t *testing.T) { c, _ = NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, true, c.Evaluate(path)) + assert.Equal(t, true, c.Evaluate(path, nil)) // create match condition asPathLength = config.AsPathLength{ @@ -609,7 +609,7 @@ func TestAs4PathLengthConditionEvaluate(t *testing.T) { c, _ = NewAsPathLengthCondition(asPathLength) // test - assert.Equal(t, false, c.Evaluate(path)) + assert.Equal(t, false, c.Evaluate(path, nil)) } func TestAs4PathLengthConditionWithOtherCondition(t *testing.T) { @@ -664,7 +664,7 @@ func TestAs4PathLengthConditionWithOtherCondition(t *testing.T) { r := NewRoutingPolicy() r.Reload(pl) p, _ := NewPolicy(pl.PolicyDefinitions[0], r.DefinedSetMap) - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) @@ -753,15 +753,15 @@ func TestAsPathConditionEvaluate(t *testing.T) { p8 := createAspathC("asset3", config.MATCH_SET_OPTIONS_TYPE_INVERT) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, false, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, false, p6.Evaluate(path1)) - assert.Equal(t, true, p6.Evaluate(path2)) - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path2)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, false, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, false, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p6.Evaluate(path2, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path2, nil)) } func TestMultipleAsPathConditionEvaluate(t *testing.T) { @@ -854,15 +854,15 @@ func TestMultipleAsPathConditionEvaluate(t *testing.T) { p9 := createAspathC("asset9", config.MATCH_SET_OPTIONS_TYPE_ANY) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, true, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, true, p6.Evaluate(path1)) - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path1)) - assert.Equal(t, false, p9.Evaluate(path1)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, true, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, true, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path1, nil)) + assert.Equal(t, false, p9.Evaluate(path1, nil)) } func TestAsPathCondition(t *testing.T) { @@ -921,7 +921,7 @@ func TestAsPathCondition(t *testing.T) { MatchSetOptions: config.MATCH_SET_OPTIONS_TYPE_ANY, }, map[string]DefinedSet{k: s}) for _, a := range v { - result := c.Evaluate(a.path) + result := c.Evaluate(a.path, nil) if a.result != result { log.WithFields(log.Fields{ "EXP": k, @@ -978,7 +978,7 @@ func TestAsPathConditionWithOtherCondition(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) @@ -1085,16 +1085,16 @@ func TestAs4PathConditionEvaluate(t *testing.T) { p8 := createAspathC("asset3", config.MATCH_SET_OPTIONS_TYPE_INVERT) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, false, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, false, p6.Evaluate(path1)) - assert.Equal(t, true, p6.Evaluate(path2)) - - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path2)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, false, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, false, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p6.Evaluate(path2, nil)) + + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path2, nil)) } func TestMultipleAs4PathConditionEvaluate(t *testing.T) { @@ -1206,15 +1206,15 @@ func TestMultipleAs4PathConditionEvaluate(t *testing.T) { p9 := createAspathC("asset9", config.MATCH_SET_OPTIONS_TYPE_ANY) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, true, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, true, p6.Evaluate(path1)) - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path1)) - assert.Equal(t, false, p9.Evaluate(path1)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, true, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, true, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path1, nil)) + assert.Equal(t, false, p9.Evaluate(path1, nil)) } func TestAs4PathConditionWithOtherCondition(t *testing.T) { @@ -1271,7 +1271,7 @@ func TestAs4PathConditionWithOtherCondition(t *testing.T) { r := NewRoutingPolicy() r.Reload(pl) p, _ := NewPolicy(pl.PolicyDefinitions[0], r.DefinedSetMap) - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) @@ -1365,13 +1365,13 @@ func TestAs4PathConditionEvaluateMixedWith2byteAS(t *testing.T) { p7 := createAspathC("asset7", config.MATCH_SET_OPTIONS_TYPE_ANY) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, true, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, false, p6.Evaluate(path1)) - assert.Equal(t, true, p7.Evaluate(path1)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, true, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, false, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) } @@ -1508,16 +1508,16 @@ func TestCommunityConditionEvaluate(t *testing.T) { p10 := createCommunityC("comset10", config.MATCH_SET_OPTIONS_TYPE_INVERT) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, true, p4.Evaluate(path1)) - assert.Equal(t, true, p5.Evaluate(path1)) - assert.Equal(t, true, p6.Evaluate(path1)) - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path1)) - assert.Equal(t, true, p9.Evaluate(path2)) - assert.Equal(t, true, p10.Evaluate(path1)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, true, p4.Evaluate(path1, nil)) + assert.Equal(t, true, p5.Evaluate(path1, nil)) + assert.Equal(t, true, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path1, nil)) + assert.Equal(t, true, p9.Evaluate(path2, nil)) + assert.Equal(t, true, p10.Evaluate(path1, nil)) } @@ -1591,12 +1591,12 @@ func TestCommunityConditionEvaluateWithOtherCondition(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) p = r.PolicyMap["pd2"] - pType, newPath = p.Apply(path) + pType, newPath = p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_NONE, pType) assert.Equal(t, newPath, path) @@ -1637,7 +1637,7 @@ func TestPolicyMatchAndAddCommunities(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) log.Debug(newPath) @@ -1682,7 +1682,7 @@ func TestPolicyMatchAndReplaceCommunities(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) assert.Equal(t, []uint32{stringToCommunityValue(community)}, newPath.GetCommunities()) @@ -1726,7 +1726,7 @@ func TestPolicyMatchAndRemoveCommunities(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) assert.Equal(t, []uint32{stringToCommunityValue(community2)}, newPath.GetCommunities()) @@ -1772,7 +1772,7 @@ func TestPolicyMatchAndRemoveCommunitiesRegexp(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) assert.Equal(t, []uint32{stringToCommunityValue(community2)}, newPath.GetCommunities()) @@ -1818,7 +1818,7 @@ func TestPolicyMatchAndRemoveCommunitiesRegexp2(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) assert.Equal(t, []uint32{stringToCommunityValue(community2)}, newPath.GetCommunities()) @@ -1865,7 +1865,7 @@ func TestPolicyMatchAndClearCommunities(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) //assert.Equal(t, []uint32{}, newPath.GetCommunities()) @@ -2036,17 +2036,17 @@ func TestExtCommunityConditionEvaluate(t *testing.T) { p11 := createExtCommunityC("ecomSet11", config.MATCH_SET_OPTIONS_TYPE_INVERT) // test - assert.Equal(t, true, p1.Evaluate(path1)) - assert.Equal(t, true, p2.Evaluate(path1)) - assert.Equal(t, true, p3.Evaluate(path1)) - assert.Equal(t, false, p4.Evaluate(path1)) - assert.Equal(t, false, p5.Evaluate(path1)) - assert.Equal(t, false, p6.Evaluate(path1)) - assert.Equal(t, true, p7.Evaluate(path1)) - assert.Equal(t, true, p8.Evaluate(path1)) - assert.Equal(t, true, p9.Evaluate(path1)) - assert.Equal(t, true, p10.Evaluate(path1)) - assert.Equal(t, true, p11.Evaluate(path1)) + assert.Equal(t, true, p1.Evaluate(path1, nil)) + assert.Equal(t, true, p2.Evaluate(path1, nil)) + assert.Equal(t, true, p3.Evaluate(path1, nil)) + assert.Equal(t, false, p4.Evaluate(path1, nil)) + assert.Equal(t, false, p5.Evaluate(path1, nil)) + assert.Equal(t, false, p6.Evaluate(path1, nil)) + assert.Equal(t, true, p7.Evaluate(path1, nil)) + assert.Equal(t, true, p8.Evaluate(path1, nil)) + assert.Equal(t, true, p9.Evaluate(path1, nil)) + assert.Equal(t, true, p10.Evaluate(path1, nil)) + assert.Equal(t, true, p11.Evaluate(path1, nil)) } @@ -2169,12 +2169,12 @@ func TestExtCommunityConditionEvaluateWithOtherCondition(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_NONE, pType) assert.Equal(t, newPath, path) p = r.PolicyMap["pd2"] - pType, newPath = p.Apply(path) + pType, newPath = p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_REJECT, pType) assert.Equal(t, newPath, path) @@ -2215,7 +2215,7 @@ func TestPolicyMatchAndReplaceMed(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) v, err := newPath.GetMed() @@ -2258,7 +2258,7 @@ func TestPolicyMatchAndAddingMed(t *testing.T) { err := r.Reload(pl) assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) @@ -2304,7 +2304,7 @@ func TestPolicyMatchAndAddingMedOverFlow(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) @@ -2350,7 +2350,7 @@ func TestPolicyMatchAndSubtractMed(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) @@ -2396,7 +2396,7 @@ func TestPolicyMatchAndSubtractMedUnderFlow(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) @@ -2439,7 +2439,7 @@ func TestPolicyMatchWhenPathHaveNotMed(t *testing.T) { assert.Nil(t, err) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(t, ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(t, nil, newPath) @@ -2486,7 +2486,7 @@ func TestPolicyAsPathPrepend(t *testing.T) { r.Reload(pl) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(nil, newPath) assert.Equal([]uint32{65002, 65002, 65002, 65002, 65002, 65002, 65002, 65002, 65002, 65002, 65001, 65000}, newPath.GetAsSeqList()) @@ -2530,7 +2530,7 @@ func TestPolicyAsPathPrependLastAs(t *testing.T) { r.Reload(pl) p := r.PolicyMap["pd1"] - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(nil, newPath) assert.Equal([]uint32{65002, 65002, 65002, 65002, 65002, 65002, 65001, 65000}, newPath.GetAsSeqList()) @@ -2580,7 +2580,7 @@ func TestPolicyAs4PathPrepend(t *testing.T) { r.Reload(pl) p, _ := NewPolicy(pl.PolicyDefinitions[0], r.DefinedSetMap) - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(nil, newPath) asn := createAs4Value("65002.1") @@ -2635,7 +2635,7 @@ func TestPolicyAs4PathPrependLastAs(t *testing.T) { r.Reload(pl) p, _ := NewPolicy(pl.PolicyDefinitions[0], r.DefinedSetMap) - pType, newPath := p.Apply(path) + pType, newPath := p.Apply(path, nil) assert.Equal(ROUTE_TYPE_ACCEPT, pType) assert.NotEqual(nil, newPath) asn := createAs4Value("65002.1") |