blob: a74fa0471bf9dda4d711295e9553a447ba25f00e (
plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# This file was written by Yao Qi <qiyao@cn.ibm.com>.
set testfile "system_calls"
set srcfile ${testfile}.c
set binfile ${testfile}
verbose "compiling source file now....."
# Build the shared libraries this test case needs.
if { [ ltrace_compile "${srcdir}/${subdir}/${testfile}.c" "${objdir}/${subdir}/${binfile}" executable {debug} ] != "" } {
send_user "Testcase compile failed, so all tests in this file will automatically fail.\n"
}
# set options for ltrace.
ltrace_options "-S"
#Run PUT for ltarce.
set exec_output [ltrace_runtest $objdir/$subdir $objdir/$subdir/$binfile]
#check the output of this program.
verbose "ltrace runtest output: $exec_output\n"
if [regexp {ELF from incompatible architecture} $exec_output] {
fail "32-bit ltrace can not perform on 64-bit PUTs and rebuild ltrace in 64 bit mode!"
return
} elseif [ regexp {Couldn't get .hash data} $exec_output ] {
fail "Couldn't get .hash data!"
return
}
set pattern "^munmap@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 2
set pattern "^write@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^unlink@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^brk@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^open@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^(new)?fstat(64)?@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
set pattern "^(old_)?mmap2?@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
set pattern "^close@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^getcwd@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^chdir@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^symlink@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^unlink@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^(new)?stat(64)?@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1 egrep
set pattern "^access@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^rename@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^mkdir@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
set pattern "^rmdir@SYS"
ltrace_verify_output ${objdir}/${subdir}/${testfile}.ltrace $pattern 1
|