test-utils/run-tcl-tests.tcl
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 #!/usr/bin/tclsh
       
     2 
       
     3 #
       
     4 #    Copyright 2005-2006 Intel Corporation
       
     5 # 
       
     6 #    Licensed under the Apache License, Version 2.0 (the "License");
       
     7 #    you may not use this file except in compliance with the License.
       
     8 #    You may obtain a copy of the License at
       
     9 # 
       
    10 #        http://www.apache.org/licenses/LICENSE-2.0
       
    11 # 
       
    12 #    Unless required by applicable law or agreed to in writing, software
       
    13 #    distributed under the License is distributed on an "AS IS" BASIS,
       
    14 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    15 #    See the License for the specific language governing permissions and
       
    16 #    limitations under the License.
       
    17 #
       
    18 
       
    19 
       
    20 
       
    21 # usage: test-utils/run-tcl-tests.tcl <test group> <run-dtn.tcl options?>
       
    22 if {[llength $argv] < 1} {
       
    23     puts "test-utils/run-tcl-tests.tcl <test group> options..."
       
    24     puts ""
       
    25     puts "Required:"
       
    26     puts "    <test group> Test group to run"
       
    27     puts ""
       
    28     exit
       
    29 }
       
    30 
       
    31 # the basic test group
       
    32 set tests(basic) {
       
    33     "alwayson-links.tcl"	""
       
    34     "api-poll.tcl"		""
       
    35     "bundle-status-reports.tcl"	""
       
    36     "custody-transfer.tcl"      ""
       
    37     "discovery.tcl"             ""
       
    38     "dtlsr.tcl"			""
       
    39     "dtlsr-areas.tcl"		""
       
    40     "dtnsendrecv.tcl"           ""
       
    41     "dtn-cp.tcl"		""
       
    42     "dtn-ping.tcl"		""
       
    43     "dtn-tunnel.tcl"		""
       
    44     "dtnsendrecv.tcl"           ""
       
    45     "dtnsim.tcl"		"-c two-node.conf"
       
    46     "dtnsim.tcl"		"-c bandwidth-test.conf"
       
    47     "dtnsim.tcl"		"-c storage-limit-test.conf"
       
    48     "dtnsim.tcl"		"-c conn-test.conf"
       
    49     "dtnsim.tcl"		"-c dtlsr.conf"
       
    50     "extension-block.tcl"       ""
       
    51     "flood-router.tcl"		""
       
    52     "inflight-expiration.tcl"	""
       
    53     "inflight-interrupt.tcl"	""
       
    54     "is-singleton.tcl"		""
       
    55     "ipc-version-test.tcl"	""
       
    56     "loopback-link.tcl"		""
       
    57     "multipath-forwarding.tcl"	""
       
    58     "multiple-registrations.tcl" ""
       
    59     "ondemand-links.tcl"	""
       
    60     "prophet.tcl"               ""
       
    61     "no-duplicate-send.tcl"	""
       
    62     "reactive-fragmentation.tcl" ""
       
    63     "reroute-from-down-link.tcl" ""
       
    64     "sequence-id.tcl"		""
       
    65     "send-one-bundle.tcl"	"-cl tcp"
       
    66     "send-one-bundle.tcl"	"-cl tcp -length 0"
       
    67     "send-one-bundle.tcl"	"-cl tcp -length 5 -segment_length 1"
       
    68     "send-one-bundle.tcl"	"-cl tcp -test_read_limit 1"
       
    69     "send-one-bundle.tcl"	"-cl udp -length 0"
       
    70     "send-one-bundle.tcl"	"-cl udp"
       
    71     "storage.tcl"		""
       
    72     "storage.tcl"		"-storage_type filesysdb"
       
    73     "tcp-bogus-link.tcl"	""
       
    74     "unknown-scheme.tcl"	""
       
    75     "version-mismatch.tcl"	""
       
    76 }
       
    77 
       
    78 
       
    79 # BlueZ utils test group
       
    80 set tests(bluez) {
       
    81     "bluez-rfcomm.tcl"   ""
       
    82     "bluez-sdp.tcl"    ""
       
    83     "bluez-inq.tcl"    ""
       
    84     "bluez-links.tcl"    ""
       
    85 }
       
    86 
       
    87 # the stress test group
       
    88 set tests(stress) {
       
    89     "bidirectional.tcl"         ""
       
    90     "many-bundles.tcl"		""
       
    91     "many-bundles.tcl"		"-storage_type berkeleydb-no-txn"
       
    92     "many-bundles.tcl"		"-storage_type filesysdb"
       
    93     "dtn-perf.tcl"		""
       
    94     "dtn-perf.tcl"		"-payload_len 50B"
       
    95     "dtn-perf.tcl"		"-payload_len 5MB  -file_payload"
       
    96     "dtn-perf.tcl"		"-payload_len 50MB -file_payload"
       
    97     "dtn-perf.tcl"		"-storage_type filesysdb"
       
    98     "dtn-perf.tcl"		"-payload_len 50B -storage_type filesysdb"
       
    99     "dtn-perf.tcl"		"-payload_len 5MB  -file_payload -storage_type filesysdb"
       
   100     "dtn-perf.tcl"		"-payload_len 50MB -file_payload -storage_type filesysdb"
       
   101 }
       
   102 
       
   103 # LTP CL utils test group
       
   104 set tests(ltp) {
       
   105     "dtn-ping.tcl"		"-cl ltp"
       
   106     "dtn-ping.tcl"              "-n 1 -cl ltp -s ltp.sched"
       
   107     "send-one-bundle.tcl"       "-cl ltp -length 0"
       
   108     "send-one-bundle.tcl"       "-cl ltp -length 10"
       
   109     "send-one-bundle.tcl"       "-cl ltp -length 100"
       
   110     "send-one-bundle.tcl"       "-cl ltp -length 1000"
       
   111     "dtn-perf.tcl"              "-cl ltp -payload_len 1024B -perftime 30 -storage_type filesysdb"
       
   112     "dtn-perf.tcl"              "-cl ltp -payload_len 10240B -perftime 30 -storage_type filesysdb"
       
   113     "dtn-perf.tcl"              "-cl ltp -payload_len 1MB -perftime 30 -storage_type filesysdb"
       
   114     "custody-transfer.tcl"      "-cl ltp"
       
   115 }
       
   116 
       
   117 
       
   118 set tests(other) {
       
   119     "api-leak-test.tcl"		""
       
   120 }
       
   121 
       
   122 
       
   123 # check test group
       
   124 set group [lindex $argv 0]
       
   125 set common_options [lrange $argv 1 end]
       
   126 
       
   127 if {![info exists tests($group)]} {
       
   128     puts "Error: test group \"$group\" not defined"
       
   129     exit -1
       
   130 }
       
   131 
       
   132 # print a "Table of Contents" first before running the tests
       
   133 puts "***"
       
   134 puts "*** The following tests will be run:"
       
   135 puts "***"
       
   136 foreach {test testopts} $tests($group) {
       
   137     puts "***   $test $testopts"
       
   138 }
       
   139 puts "***\n"
       
   140 
       
   141 # run the tests
       
   142 foreach {test testopts} $tests($group) {
       
   143     puts "***"
       
   144     puts "*** Running Test: $test $testopts"
       
   145     puts "***"
       
   146 
       
   147     if {$testopts != ""} {
       
   148 	set options "$common_options --opts \"$testopts\""
       
   149     } else {
       
   150 	set options $common_options
       
   151     }
       
   152     
       
   153     if [catch {
       
   154 	eval exec [file dirname $argv0]/run-dtn.tcl test/$test -d $options \
       
   155 		< /dev/null >&@ stdout
       
   156     } err ] {
       
   157 	puts "unexpected error: $err"
       
   158     }
       
   159 
       
   160     # give the last test an extra couple seconds to quit
       
   161    after 500
       
   162 }
       
   163 
       
   164