Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/net-sanity.exp

raw
1 # Testcase for various embedded-C functions in tcp.stp and netfilter.stp.
2
3 set test "net-sanity"
4 if {![installtest_p]} {untested $test; return}
5
6 set file $srcdir/$subdir/net-sanity.stp
7 foreach value {0 0xffffffff 0xffffffffffffffff} {
8 foreach ix {0 1 2 3 4} {
9 set test "net-sanity $value $ix"
10 if {![installtest_p]} {untested $test; continue}
11
12 # s390x machines don't error when reading address 0 (or when
13 # reading offsets from 0xffffffffffffffff)
14 if {[istarget s390x-*-*]} {
15 if {$value == 0 || ($value == 0xffffffffffffffff && $ix > 0)} {
16 setup_kfail S390X [istarget]
17 }
18 }
19
20 # The systemtap.stress/tapset_functions.exp covers this scenario too.
21 # The --compatible=2.9 option makes 'private' tapset functions accessible
22 # from user script.
23 spawn stap --compatible=2.9 $file $value $ix
24 set errs 0
25 verbose -log "exp $test $errs"
26 expect {
27 -timeout 180
28 -re {(ERROR)[^\r\n]*\r\n} { incr errs; exp_continue }
29 eof { }
30 timeout { fail "$test (timeout)" }
31 }
32 verbose -log "done exp $test $errs"
33 catch {close}; catch {wait}
34 if {$errs == 1} { pass $test } else { fail "$test ($errs)" }
35 verbose -log "done $test $errs"
36 }
37 }