Skip to content

Commit

Permalink
Creation of test folder with tools to test ptoa
Browse files Browse the repository at this point in the history
  • Loading branch information
spale75 committed Oct 22, 2017
1 parent 5b2db5c commit 72f4576
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 0 deletions.
Binary file added test/ipv4.input
Binary file not shown.
11 changes: 11 additions & 0 deletions test/ipv4.output.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
2017-10-21 21:31:52 peer ip 185.66.192.5 AS 201701
2017-10-21 21:31:52 prefix announce 103.41.110.0/24 origin IGP aspath 201701 13030 7713 63511 community 5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421
2017-10-21 21:31:52 prefix announce 103.41.110.0/24 origin IGP aspath 201701 50629 2914 7713 63511 community 2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
2017-10-21 21:31:52 prefix announce 177.104.21.0/24 origin IGP aspath 201701 50629 2914 3356 3549 21574 262624 community 2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
2017-10-21 21:31:52 prefix announce 177.104.23.0/24 origin IGP aspath 201701 50629 2914 3356 3549 21574 262624 community 2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
2017-10-21 21:31:52 prefix announce 177.104.30.0/24 origin IGP aspath 201701 50629 2914 3356 3549 21574 262624 community 2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
2017-10-21 21:31:52 prefix announce 193.0.132.0/22 origin IGP aspath 201701 49009 9002 12389 3203 community 5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933 9189:9445
2017-10-21 21:31:52 prefix announce 193.0.132.0/22 origin IGP aspath 201701 13030 2914 12389 3203 community 5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933
2017-10-21 21:31:52 prefix announce 193.0.132.0/22 origin IGP aspath 201701 13030 2914 12389 3203 community 5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933
2017-10-21 21:31:52 prefix announce 193.0.132.0/22 origin IGP aspath 201701 50629 2914 1273 12389 3203 community 2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
2017-10-21 21:31:53 eof
11 changes: 11 additions & 0 deletions test/ipv4.output.j
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{ "timestamp": 1508621512, "type": "peer", "msg": { "peer": { "proto": "ipv4", "ip": "185.66.192.5", "asn": 201701 } } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "103.41.110.0/24", "origin": "IGP", "aspath": [ 201701, 13030, 7713, 63511 ], "community": [ "5093:5349", "5605:5861", "6117:6373", "6629:6885", "7141:7397", "7653:7909", "8165:8421" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "103.41.110.0/24", "origin": "IGP", "aspath": [ 201701, 50629, 2914, 7713, 63511 ], "community": [ "2914:3170", "3426:3682", "3938:4194", "4450:4706", "4962:5218", "5474:5730", "5986:6242", "6498:6754" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "177.104.21.0/24", "origin": "IGP", "aspath": [ 201701, 50629, 2914, 3356, 3549, 21574, 262624 ], "community": [ "2914:3170", "3426:3682", "3938:4194", "4450:4706", "4962:5218", "5474:5730", "5986:6242", "6498:6754" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "177.104.23.0/24", "origin": "IGP", "aspath": [ 201701, 50629, 2914, 3356, 3549, 21574, 262624 ], "community": [ "2914:3170", "3426:3682", "3938:4194", "4450:4706", "4962:5218", "5474:5730", "5986:6242", "6498:6754" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "177.104.30.0/24", "origin": "IGP", "aspath": [ 201701, 50629, 2914, 3356, 3549, 21574, 262624 ], "community": [ "2914:3170", "3426:3682", "3938:4194", "4450:4706", "4962:5218", "5474:5730", "5986:6242", "6498:6754" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "193.0.132.0/22", "origin": "IGP", "aspath": [ 201701, 49009, 9002, 12389, 3203 ], "community": [ "5093:5349", "5605:5861", "6117:6373", "6629:6885", "7141:7397", "7653:7909", "8165:8421", "8677:8933", "9189:9445" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "193.0.132.0/22", "origin": "IGP", "aspath": [ 201701, 13030, 2914, 12389, 3203 ], "community": [ "5093:5349", "5605:5861", "6117:6373", "6629:6885", "7141:7397", "7653:7909", "8165:8421", "8677:8933" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "193.0.132.0/22", "origin": "IGP", "aspath": [ 201701, 13030, 2914, 12389, 3203 ], "community": [ "5093:5349", "5605:5861", "6117:6373", "6629:6885", "7141:7397", "7653:7909", "8165:8421", "8677:8933" ] } }
{ "timestamp": 1508621512, "type": "announce", "msg": { "prefix": "193.0.132.0/22", "origin": "IGP", "aspath": [ 201701, 50629, 2914, 1273, 12389, 3203 ], "community": [ "2914:3170", "3426:3682", "3938:4194", "4450:4706", "4962:5218", "5474:5730", "5986:6242", "6498:6754" ] } }
{ "timestamp": 1508621513, "type": "footer" }
11 changes: 11 additions & 0 deletions test/ipv4.output.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
1508621512|P|3108159493|201701
1508621512|A|1730768384|24|O|I|AP|201701 13030 7713 63511|C|5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421
1508621512|A|1730768384|24|O|I|AP|201701 50629 2914 7713 63511|C|2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
1508621512|A|2976388352|24|O|I|AP|201701 50629 2914 3356 3549 21574 262624|C|2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
1508621512|A|2976388864|24|O|I|AP|201701 50629 2914 3356 3549 21574 262624|C|2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
1508621512|A|2976390656|24|O|I|AP|201701 50629 2914 3356 3549 21574 262624|C|2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
1508621512|A|3238036480|22|O|I|AP|201701 49009 9002 12389 3203|C|5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933 9189:9445
1508621512|A|3238036480|22|O|I|AP|201701 13030 2914 12389 3203|C|5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933
1508621512|A|3238036480|22|O|I|AP|201701 13030 2914 12389 3203|C|5093:5349 5605:5861 6117:6373 6629:6885 7141:7397 7653:7909 8165:8421 8677:8933
1508621512|A|3238036480|22|O|I|AP|201701 50629 2914 1273 12389 3203|C|2914:3170 3426:3682 3938:4194 4450:4706 4962:5218 5474:5730 5986:6242 6498:6754
1508621513|E
Binary file added test/ipv6.input
Binary file not shown.
3 changes: 3 additions & 0 deletions test/ipv6.output.H
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
2017-10-21 21:31:54 peer ip 2a03:2260::5 AS 201701
2017-10-21 21:31:54 prefix announce 2a06:dac0::/29 origin IGP aspath 201701 13030 25180 202939 community 5093:5349 5605:5861 6117:6373 6629:6885 7141:7397
2017-10-21 21:31:55 eof
3 changes: 3 additions & 0 deletions test/ipv6.output.j
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{ "timestamp": 1508621514, "type": "peer", "msg": { "peer": { "proto": "ipv6", "ip": "2a03:2260::5", "asn": 201701 } } }
{ "timestamp": 1508621514, "type": "announce", "msg": { "prefix": "2a06:dac0::/29", "origin": "IGP", "aspath": [ 201701, 13030, 25180, 202939 ], "community": [ "5093:5349", "5605:5861", "6117:6373", "6629:6885", "7141:7397" ] } }
{ "timestamp": 1508621515, "type": "footer" }
3 changes: 3 additions & 0 deletions test/ipv6.output.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1508621514|P|2a03:2260::5|201701
1508621514|A|2a06:dac0::|29|O|I|AP|201701 13030 25180 202939|C|5093:5349 5605:5861 6117:6373 6629:6885 7141:7397
1508621515|E
20 changes: 20 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh -e

for proto in ipv4 ipv6
do
for mode in H m j
do
printf "Testing ${proto} in mode ${mode}: "
../bin/ptoa -${mode} ${proto}.input > test.out
diff test.out ${proto}.output.${mode} > /dev/null && \
{
printf "OK\n";
} || { \
printf "ERROR\n";
printf "NOTE: ouput of ../bin/ptoa -${mode} ${proto}.input differs from ${proto}.output.${mode}\n";
diff test.out ${proto}.output.${mode} | sed "s/^/DIFF: /";
printf "\n";
}
rm -f test.out
done
done

0 comments on commit 72f4576

Please sign in to comment.