test/version-mismatch.tcl
changeset 0 2b3e5ec03512
equal deleted inserted replaced
-1:000000000000 0:2b3e5ec03512
       
     1 #
       
     2 #    Copyright 2005-2006 Intel Corporation
       
     3 # 
       
     4 #    Licensed under the Apache License, Version 2.0 (the "License");
       
     5 #    you may not use this file except in compliance with the License.
       
     6 #    You may obtain a copy of the License at
       
     7 # 
       
     8 #        http://www.apache.org/licenses/LICENSE-2.0
       
     9 # 
       
    10 #    Unless required by applicable law or agreed to in writing, software
       
    11 #    distributed under the License is distributed on an "AS IS" BASIS,
       
    12 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
       
    13 #    See the License for the specific language governing permissions and
       
    14 #    limitations under the License.
       
    15 #
       
    16 
       
    17 test::name version-mismatch
       
    18 net::num_nodes 2
       
    19 
       
    20 set cl tcp
       
    21 
       
    22 for {set i 0} {$i < [llength $opt(opts)]} {incr i} {
       
    23     set var [lindex $opt(opts) $i]
       
    24     if {$var == "-cl" || $var == "cl"} {
       
    25 	set val [lindex $opt(opts) [incr i]]
       
    26 	set cl $val
       
    27     } else {
       
    28 	testlog error "ERROR: unrecognized test option '$var'"
       
    29 	exit 1
       
    30     }
       
    31 }
       
    32 
       
    33 dtn::config
       
    34 dtn::config_interface $cl
       
    35 dtn::config_linear_topology OPPORTUNISTIC $cl true
       
    36 
       
    37 test::script {
       
    38     testlog "Running dtnds"
       
    39     dtn::run_dtnd *
       
    40 
       
    41     testlog "Waiting for dtnds to start up"
       
    42     dtn::wait_for_dtnd *
       
    43 
       
    44     testlog "Setting up flamebox ignore"
       
    45     tell_dtnd 1 log /test always \
       
    46 	    "flamebox-ignore ign1 remote sent version .*, expected version 99"
       
    47 
       
    48     testlog "Changing the CL version on one of the nodes"
       
    49     tell_dtnd 1 link reconfigure $cl-link:1-0 cl_version=99
       
    50 
       
    51     testlog "Opening the link"
       
    52     tell_dtnd 1 link open $cl-link:1-0
       
    53 
       
    54     testlog "Checking that the links are still closed"
       
    55     dtn::wait_for_link_state 0 tcp-link:0-1 UNAVAILABLE
       
    56     dtn::wait_for_link_state 1 tcp-link:1-0 UNAVAILABLE
       
    57     
       
    58     testlog "Test success!"
       
    59 }
       
    60 
       
    61 test::exit_script {
       
    62     tell_dtnd 1 log /test always \
       
    63 	    "flamebox-ignore-cancel ign1"
       
    64     
       
    65     testlog "Stopping all dtnds"
       
    66     dtn::stop_dtnd *
       
    67 }