File: task_paths.exp

package info (click to toggle)
systemtap 5.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,556 kB
  • sloc: cpp: 81,117; ansic: 54,933; xml: 49,795; exp: 43,595; sh: 11,526; python: 5,003; perl: 2,252; tcl: 1,312; makefile: 1,006; javascript: 149; lisp: 105; awk: 101; asm: 91; java: 70; sed: 16
file content (46 lines) | stat: -rw-r--r-- 1,312 bytes parent folder | download | duplicates (5)
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
43
44
45
46
set test "task_paths"
set stapio_path $env(PKGLIBDIR)/stapio

# Only run on make installcheck
if {! [installtest_p]} { untested "$test"; return }

# Run the test script on 'whoami'
spawn stap $srcdir/$subdir/$test.stp -c whoami
verbose -log "stap $srcdir/$subdir/$test.stp -c whoami"

set pwd "[pwd]"
set found_cwd 0
set found_stapio 0
set found_whoami 0
set found_error 0
expect {
    -timeout 180
    -re "^current cwd: $pwd\r\n" { incr found_cwd; exp_continue }
    -re "^current exe: $stapio_path\r\n" { incr found_stapio; exp_continue }
    -re "^target cwd: $pwd\r\n" { incr found_cwd; exp_continue }
    -re "^target exe: $stapio_path\r\n" { incr found_stapio; exp_continue }
    -re {^ERROR: [^\r\n]+\r\n} { incr found_error;
	exp_continue }
    -re {^current exe: /[^\r\n]+/whoami\r\n} { incr found_whoami; exp_continue }

    -re {^[^\r\n]+\r\n} {
	# ignore everything else
	exp_continue }
    eof { }
    timeout { fail "$test (timeout)" }
}
catch {close}; catch {wait}

# On older kernels, we can't get the cwd.
if {$found_cwd == 0 && ![min_kernel_vers_p 2.6.25]} {
    setup_kfail NO_CWD *-*-*
}

if {$found_cwd == 2 && $found_stapio == 1 && $found_error == 2
    && $found_whoami == 1} {
    pass "$test"
} else {
    fail "$test ($found_cwd, $found_stapio, $found_error, $found_whoami)"
}

return