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
|
# Check keep temporary directory
set test "keep temporary directory"
# Script we'll use while testing:
set script "probe begin{exit();}"
set dir ""
spawn stap -k -p1 -e $script
expect {
-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {
set dir $expect_out(1,string); exp_continue
}
eof { }
}
catch {close}; catch {wait}
if { $dir != "" && [file isdirectory $dir] == 1 } {
catch {exec rm -rf $dir}
pass "$test (pass1 only)"
} else {
fail "$test (pass1 only)"
}
if {![installtest_p]} { untested "$test (full run)"; return }
set dir ""
spawn stap -k -e $script
expect {
-re {Keeping temporary directory \"((/[0-9a-zA-Z]*)+)\"\r\n} {
set dir $expect_out(1,string); exp_continue
}
eof { }
}
catch {close}; catch {wait}
if { $dir != "" && [file isdirectory $dir] == 1 } {
catch {exec rm -rf $dir}
pass "$test (full run)"
} else {
fail "$test (full run)"
}
|