summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/bz6850.exp
blob: b96ed95cca46899bd73dd457cd432fc9e0e0a219 (plain)
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
set test bz6850

catch {exec gcc -g -o bz6850 $srcdir/$subdir/bz6850.c} err
if {$err == "" && [file exists bz6850]} then { pass "$test compile" } else { fail "$test compile" }

# Try to find utrace_attach symbol in /proc/kallsyms
# copy from utrace_p5.exp
set utrace_support_found 0
set path "/proc/kallsyms"
if {! [catch {exec grep -q utrace_attach $path} dummy]} {
    set utrace_support_found 1
}
if {$utrace_support_found == 0} {
    catch {exec rm -f $test}
    untested "$test -p4"
    untested "$test -p5"
    return
}

set rc [stap_run_batch $srcdir/$subdir/bz6850.stp]
if {$rc == 0} then { pass "$test -p4" } else { fail "$test -p4" }

if {! [installtest_p]} {
    catch {exec rm -f $test}
    untested "$test -p5"
    return
}

# Pick up the stap being tested.
set stapexe [exec /usr/bin/which stap]
spawn sudo $stapexe $srcdir/$subdir/bz6850.stp -c ./bz6850
expect {
	-timeout 60
	-re {[^\r\n]*called\r\n} { exp_continue }
	-re {[^\r\n]*returns\r\n} { exp_continue }
	timeout { fail "$test (timeout)" }
	eof { }
}
wait
if {[file exists bz6850_pass]} then { pass "$test -p5" } else { fail "$test -p5" }
exec rm -f bz6850_pass bz6850