File: temp-directory.exp

package info (click to toggle)
systemtap 3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 32,860 kB
  • ctags: 12,513
  • sloc: cpp: 58,610; ansic: 58,189; exp: 37,322; sh: 10,633; xml: 7,771; perl: 2,252; python: 2,066; tcl: 1,305; makefile: 969; lisp: 105; java: 100; awk: 94; asm: 91; sed: 16
file content (42 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (7)
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)"
}