File: OsmTest.check.tcl

package info (click to toggle)
ibutils 1.2-OFED-1.4.2-1.3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 23,616 kB
  • sloc: cpp: 153,349; ansic: 77,237; tcl: 13,447; sh: 11,852; makefile: 494; yacc: 333; lex: 169; awk: 53
file content (73 lines) | stat: -rw-r--r-- 2,583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This is the checker for for a simple 16 node test with opensm and osmtest

##############################################################################
#
# Start up the test applications
# This is the default flow that will start OpenSM only in 0x43 verbosity
# Return a list of process ids it started (to be killed on exit)
#
proc runner {simDir osmPath osmPortGuid} {
   set osmStdOutLog [file join $simDir osm.stdout.log]
   set osmLog [file join $simDir osm.log]

   # prevent long transactions return BUSY signal
   exec echo max_msg_fifo_timeout 0 > $simDir/opensm.opts

   puts "-I- Starting: $osmPath -g $osmPortGuid  ..."
   set osmPid [exec $osmPath -d2 -s 0 -t 1000 -f $osmLog -g $osmPortGuid > $osmStdOutLog &]

   # start a tracker on the log file and process:
   startOsmLogAnalyzer $osmLog

   return $osmPid
}

##############################################################################
#
# Check for the test results
# Return the exit code
proc checker {simDir osmPath osmPortGuid} {
   global simCtrlSock

   set osmTestPath      [file join [file dirname $osmPath] osmtest]
   set osmTestLog       [file join $simDir osmtest.log]
   set osmTestStdOutLog [file join $simDir osmtest.stdout.log]
   set osmTestInventory [file join $simDir osmtest.dat]

   # wait for the SM up or dead
   set osmLog [file join $simDir osm.log]
   if {[osmWaitForUpOrDead $osmLog]} {
      return 1
   }

   # update node proc file
   puts $simCtrlSock "updateProcFSForNode \$fabric $simDir H-1/U1 H-1/U1 1"
   set res [gets $simCtrlSock]
   puts "SIM: Updated H-1 proc file:$res"

   # if we did get a subnet up:
   set osmTestCmd1 "$osmTestPath -v -t 1000 -g $osmPortGuid -l $osmTestLog -f c -i $osmTestInventory"
   puts "-I- Invoking: $osmTestCmd1 ..."
   # HACK: we currently ignore osmtest craches on exit flow:
   catch {set res [eval "exec $osmTestCmd1 >& $osmTestStdOutLog"]}

   if {[catch {exec grep "OSMTEST: TEST \"Create Inventory\" PASS" $osmTestStdOutLog}]} {
      puts "-E- osmtest Create Inventory failed"
      return 1
   }

   after 2000

   # now do the actual test...
   set osmTestCmd2 "$osmTestPath -v -t 1000 -g $osmPortGuid -l $osmTestLog -f a -i $osmTestInventory"
   puts "-I- Invoking: $osmTestCmd2 ..."
   # HACK: we currently ignore osmtest craches on exit flow:
   catch {set res [eval "exec $osmTestCmd2 >& $osmTestStdOutLog"]}
   if {[catch {exec grep "OSMTEST: TEST \"All Validations\" PASS" $osmTestStdOutLog}]} {
      puts "-E- osmtest All Validations failed"
      return 1
   }

   puts "-I- osmtest completed successfuly"
   return 0
}