blob: dfecec78012f0c0b606bd54461953fef7b351390 [file] [log] [blame]
David Lamparter5bb7e4d2013-02-26 17:53:30 +01001set timeout 10
2set testprefix "aspathtest "
3set aborted 0
4set color 1
5
6spawn "./aspathtest"
7
8# proc onetest { test_name note start } {
9# proc headerline { line } {
10
11set parserno 0
12proc parsertest { test_name } {
13 global parserno
14 headerline "test $parserno"
15 onetest "parse $test_name" " ($parserno)" "$test_name:"
16 onetest "parse $test_name +empty_prepend" " (#$parserno)" "empty prepend $test_name:"
17 incr parserno 1
18}
19set attrno 0
20proc attrtest { test_name } {
21 global attrno
22 headerline "aspath_attr test $attrno"
23 onetest "attr $test_name" " (#$attrno)" "$test_name"
24 incr attrno 1
25}
26
27
28parsertest "seq1"
29parsertest "seq2"
30parsertest "seq3"
31parsertest "seqset"
32parsertest "seqset2"
33parsertest "multi"
34parsertest "confed"
35parsertest "confed2"
36parsertest "confset"
37parsertest "confmulti"
38parsertest "seq4"
39parsertest "tripleseq1"
40parsertest "someprivate"
41parsertest "allprivate"
42parsertest "long"
43parsertest "seq1extra"
44parsertest "empty"
45parsertest "redundantset"
46parsertest "reconcile_lead_asp"
47parsertest "reconcile_new_asp"
48parsertest "reconcile_confed"
49parsertest "reconcile_start_trans"
50parsertest "reconcile_start_trans4"
51parsertest "reconcile_start_trans_error"
52parsertest "redundantset2"
53parsertest "zero-size overflow"
54parsertest "zero-size overflow + valid segment"
55parsertest "invalid segment type"
56
57for {set i 0} {$i < 10} {incr i 1} { onetest "prepend $i" "" "prepend test $i"; }
58for {set i 0} {$i < 5} {incr i 1} { onetest "aggregate $i" "" "aggregate test $i"; }
59for {set i 0} {$i < 5} {incr i 1} { onetest "reconcile $i" "" "reconcile test $i"; }
60for {set i 0} {$i < 22} {incr i 1} { onetest "compare $i" "" "left cmp "; }
61
62onetest "empty_get" "" "empty_get_test"
63attrtest "basic test"
64attrtest "length too short"
65attrtest "length too long"
66attrtest "incorrect flag"
67attrtest "as4_path, with as2 format data"
68attrtest "as4, with incorrect attr length"
69attrtest "basic 4-byte as-path"
70attrtest "4b AS_PATH: too short"
71attrtest "4b AS_PATH: too long"
72attrtest "4b AS_PATH: too long2"
73attrtest "4b AS_PATH: bad flags"
74attrtest "4b AS4_PATH w/o AS_PATH"
75attrtest "4b AS4_PATH: confed"
76