File: dtrace_vfork_exec.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 (51 lines) | stat: -rw-r--r-- 1,521 bytes parent folder | download | duplicates (9)
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
47
48
49
50
51
set TEST_NAME "dtrace_vfork_exec"
set build_dir ""
set test_progs {"dtrace_vfork_parent" "dtrace_child"}

if {![installtest_p]} { untested $TEST_NAME; return }
if {![uprobes_p]} { untested $TEST_NAME; return }

source $srcdir/$subdir/test_progs.tcl

proc run_test_prog {} {
    global build_dir
    catch { exec $build_dir/dtrace_vfork_parent $build_dir/dtrace_child }
    return 0
}

set output_string "parent - pid: \[0-9\]+\r\nparent - child pid: \[0-9\]+\r\nchild - pid: \[0-9\]+\r\nparent - finished\r\n"

# Build everything (without semaphores)
set TEST_NAME "dtrace_vfork_exec1"
if {[build_test_progs "Makefile.vfork_exec" $test_progs] == 0} {
    fail "$TEST_NAME - build failure"
    cleanup_test_progs
    return
} else {
    pass "$TEST_NAME - build success"
}

# Run the test (without semaphores)
set TEST_NAME "dtrace_vfork_exec2"
stap_run $TEST_NAME run_test_prog $output_string \
  $srcdir/$subdir/dtrace_vfork_exec.stp $build_dir/dtrace_vfork_parent \
  $build_dir/dtrace_child

# Build everything (with semaphores)
set TEST_NAME "dtrace_vfork_exec3"
if {[build_test_progs "Makefile.vfork_exec" $test_progs "-DUSE_SEMAPHORES"] == 0} {
    fail "$TEST_NAME - build failure"
    cleanup_test_progs
    return
} else {
    pass "$TEST_NAME - build success"
}

# Run the test (with semaphores)
set TEST_NAME "dtrace_vfork_exec4"
stap_run $TEST_NAME run_test_prog $output_string \
  $srcdir/$subdir/dtrace_vfork_exec.stp $build_dir/dtrace_vfork_parent \
  $build_dir/dtrace_child

# Cleanup
cleanup_test_progs