~zulcss/samba/server-dailies-3.4

« back to all changes in this revision

Viewing changes to testsuite/nsswitch/getgrent_r.exp

  • Committer: Chuck Short
  • Date: 2010-09-28 20:38:39 UTC
  • Revision ID: zulcss@ubuntu.com-20100928203839-pgjulytsi9ue63x1
Initial version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#
 
2
# @(#) Test multiple threads can enumerate groups correctly
 
3
#
 
4
 
 
5
load_lib util-defs.exp
 
6
load_lib "$srcdir/lib/nsswitch-config.exp"
 
7
 
 
8
# Compile getgrent_r.c
 
9
 
 
10
set output [target_compile "$srcdir/$subdir/getgrent_r.c" \
 
11
        "$srcdir/$subdir/getgrent_r" executable {additional_flags="-g"}]
 
12
 
 
13
if {$output != ""} {
 
14
    perror "compile getgrent_r"
 
15
    puts $output
 
16
    return
 
17
}
 
18
 
 
19
# Clean up output from previous tests
 
20
 
 
21
set pid [pid]
 
22
file delete [glob -nocomplain "/tmp/getgrent_r-$pid.out-*"]
 
23
 
 
24
# Run test proggy
 
25
 
 
26
set output [util_start "$srcdir/$subdir/getgrent_r" "$pid" ""]
 
27
if {![regexp "^PASS:" $output]} {
 
28
    perror "run getgrent_r"
 
29
    puts $output
 
30
    return -1
 
31
}
 
32
 
 
33
# Sort and compare output
 
34
 
 
35
set output [util_start "$srcdir/$subdir/getent_r.sh" "getgrent $pid" ""]
 
36
if {$output == ""} {
 
37
    pass "getgrent_r"
 
38
} else {
 
39
    fail "getgrent_r"
 
40
    puts $output
 
41
}