~ubuntu-branches/ubuntu/raring/ibutils/raring-proposed

« back to all changes in this revision

Viewing changes to ibmgtsim/tests/osmStability.check.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Benoit Mortier
  • Date: 2010-01-11 22:22:00 UTC
  • Revision ID: james.westby@ubuntu.com-20100111222200-53kum2et5nh13rv3
Tags: upstream-1.2-OFED-1.4.2
ImportĀ upstreamĀ versionĀ 1.2-OFED-1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# This is the checker for for a simple 16 node test with opensm and osmtest
 
2
 
 
3
##############################################################################
 
4
#
 
5
# Start up the test applications
 
6
# This is the default flow that will start OpenSM only in 0x43 verbosity
 
7
# Return a list of process ids it started (to be killed on exit)
 
8
#
 
9
proc runner {simDir osmPath osmPortGuid} {
 
10
   set osmStdOutLog [file join $simDir osm.stdout.log]
 
11
   set osmLog [file join $simDir osm.log]
 
12
   puts "-I- Starting: $osmPath -R updn -V -g $osmPortGuid ..."
 
13
   set osmPid [exec $osmPath -R updn -d2 -V -f $osmLog -g $osmPortGuid > $osmStdOutLog &]
 
14
 
 
15
   # start a tracker on the log file and process:
 
16
   startOsmLogAnalyzer $osmLog
 
17
 
 
18
   return $osmPid
 
19
}
 
20
 
 
21
##############################################################################
 
22
#
 
23
# Check for the test results: make sure we got a "SUBNET UP"
 
24
# Return the exit code
 
25
proc checker {simDir osmPath osmPortGuid} {
 
26
   global env
 
27
   set osmLog [file join $simDir osm.log]
 
28
 
 
29
   puts "-I- Waiting max time of 1000sec...."
 
30
 
 
31
   if {[osmWaitForUpOrDeadWithTimeout $osmLog 1000000]} {
 
32
      return 1
 
33
   }
 
34
 
 
35
   after 5000
 
36
 
 
37
   set ibdmchkLog [file join $simDir ibdmchk.log]
 
38
   set subnetFile [file join $simDir opensm-subnet.lst]
 
39
   set fdbsFile [file join $simDir opensm.fdbs]
 
40
   set mcfdbsFile [file join $simDir opensm.mcfdbs]
 
41
   set cmd "ibdmchk -s $subnetFile -f $fdbsFile -m $mcfdbsFile"
 
42
 
 
43
   puts "-I- Invoking $cmd "
 
44
   if {[catch {set res [eval "exec $cmd > $ibdmchkLog"]} e]} {
 
45
      puts "-E- ibdmchk failed"
 
46
      return 1
 
47
   }
 
48
   # make sure directory is not remoevd
 
49
   return 0
 
50
}