diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-18 21:07:45 -0800 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-11-18 21:07:45 -0800 |
commit | f6897fd47f74abf4c33f003063d6cd201c6e4d05 (patch) | |
tree | 1c963c1cf74f6ee9def46d36a4035cdccd250241 /server/rpki_test.go | |
parent | e8bff5b3662713180518de6eb12b3c11bd0d7775 (diff) |
rpki: fix IPv4-mapped addresss handling
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/rpki_test.go')
-rw-r--r-- | server/rpki_test.go | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/server/rpki_test.go b/server/rpki_test.go index 3de06963..bb2cf088 100644 --- a/server/rpki_test.go +++ b/server/rpki_test.go @@ -60,8 +60,8 @@ func TestValidate0(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 100, net.ParseIP("192.168.0.0"), 24, 32) - addROA(tree, 200, net.ParseIP("192.168.0.0"), 24, 24) + addROA(tree, 100, net.ParseIP("192.168.0.0").To4(), 24, 32) + addROA(tree, 200, net.ParseIP("192.168.0.0").To4(), 24, 24) var r config.RpkiValidationResultType @@ -88,7 +88,7 @@ func TestValidate1(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 65000, net.ParseIP("10.0.0.0"), 16, 16) + addROA(tree, 65000, net.ParseIP("10.0.0.0").To4(), 16, 16) var r config.RpkiValidationResultType @@ -117,7 +117,7 @@ func TestValidate3(t *testing.T) { assert := assert.New(t) tree1 := radix.New() - addROA(tree1, 65000, net.ParseIP("10.0.0.0"), 16, 16) + addROA(tree1, 65000, net.ParseIP("10.0.0.0").To4(), 16, 16) var r config.RpkiValidationResultType @@ -128,7 +128,7 @@ func TestValidate3(t *testing.T) { assert.Equal(r, config.RPKI_VALIDATION_RESULT_TYPE_INVALID) tree2 := radix.New() - addROA(tree2, 65000, net.ParseIP("10.0.0.0"), 16, 24) + addROA(tree2, 65000, net.ParseIP("10.0.0.0").To4(), 16, 24) r = validateOne(tree2, "10.0.0.0/17", "65000") assert.Equal(r, config.RPKI_VALIDATION_RESULT_TYPE_VALID) @@ -138,8 +138,8 @@ func TestValidate4(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 65000, net.ParseIP("10.0.0.0"), 16, 16) - addROA(tree, 65001, net.ParseIP("10.0.0.0"), 16, 16) + addROA(tree, 65000, net.ParseIP("10.0.0.0").To4(), 16, 16) + addROA(tree, 65001, net.ParseIP("10.0.0.0").To4(), 16, 16) var r config.RpkiValidationResultType @@ -154,8 +154,8 @@ func TestValidate5(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 65000, net.ParseIP("10.0.0.0"), 17, 17) - addROA(tree, 65000, net.ParseIP("10.0.128.0"), 17, 17) + addROA(tree, 65000, net.ParseIP("10.0.0.0").To4(), 17, 17) + addROA(tree, 65000, net.ParseIP("10.0.128.0").To4(), 17, 17) var r config.RpkiValidationResultType @@ -167,7 +167,7 @@ func TestValidate6(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 0, net.ParseIP("10.0.0.0"), 8, 32) + addROA(tree, 0, net.ParseIP("10.0.0.0").To4(), 8, 32) var r config.RpkiValidationResultType @@ -185,7 +185,7 @@ func TestValidate7(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 65000, net.ParseIP("10.0.0.0"), 16, 24) + addROA(tree, 65000, net.ParseIP("10.0.0.0").To4(), 16, 24) var r config.RpkiValidationResultType @@ -203,8 +203,8 @@ func TestValidate8(t *testing.T) { assert := assert.New(t) tree := radix.New() - addROA(tree, 0, net.ParseIP("10.0.0.0"), 16, 24) - addROA(tree, 65000, net.ParseIP("10.0.0.0"), 16, 24) + addROA(tree, 0, net.ParseIP("10.0.0.0").To4(), 16, 24) + addROA(tree, 65000, net.ParseIP("10.0.0.0").To4(), 16, 24) var r config.RpkiValidationResultType |