Debian Codegraph @

doc/SystemTap_Beginners_Guide/testsuite/systemtap.base/stapsh-unix.exp

raw
1 # Test that the stapsh mechanism is working over a unix socket
2 # - ensure that stapsh and socat are in our process hierarchy
3
4 set test "stapsh-unix"
5 set ::result_string {begin
6 ^ stapio
7 ^ stapsh
8 ^ socat
9 timer.s(1)
10 end}
11
12 if {![installtest_p] || [catch {exec test -f /usr/bin/socat}]} {
13 untested "$test"
14 } else {
15 # use a fixed name, to enable simple systemtap.sum comparability
16 set sock /tmp/$test.sock
17 set socat_pid [spawn /usr/bin/socat UNIX-LISTEN:$sock EXEC:stapsh]
18 set socat_sid $spawn_id
19
20 # give time for socat to get fully set up
21 sleep 1
22
23 stap_run2 $srcdir/$subdir/$test.stp --remote=unix:$sock
24
25 set spawn_id $socat_sid
26 kill -INT $socat_pid 5
27 catch {close}
28 catch {wait}
29 }
30