2 if {![installtest_p]} { untested $test; return }
4 # Make sure we start with a clean slate.
5 catch {exec rm -f $test.out*}
7 # run stapio in background mode
8 spawn stap -u -F -o $test.out -we {probe begin {}}
9 # check whether stap outputs stapio pid
14 pass "$test (flight recorder option)"
15 set pid $expect_out(1,string)
17 timeout { fail "$test (timeout)" }
20 # Here we're waiting on the parent stap process to finish. Stapio will
21 # still be running in the background.
22 catch { close }; catch { wait }
29 # check whether stapio is running in background
30 spawn ps -o cmd hc $pid
33 "stapio" {pass "$test (stapio in background)"} # don't contine
34 timeout { fail "$test (timeout)"}
35 eof { fail "$test (stapio was not found)" }
37 catch { close }; catch { wait }
45 if {[catch {exec rm $test.out}]} {
46 fail "$test (no output file)"
49 pass "$test (output file)"
52 # Kill the background stapio process.
55 # check switched output file
56 if {[catch {exec rm $test.out.1}]} {
57 fail "$test (failed to switch output file)"
60 pass "$test (switch output file)"