Merge from TNG.
[tprouty/samba.git] / testsuite / nsswitch / nss_winbind_syms.exp
1 #
2 # @(#) Test nss functions are exported from the libnss_winbind.so library
3 # @(#) Test there are no external dependencies in the libnss_winbind.so library
4 #
5 # We expect the following symbols to be exported:
6 #
7 #    _nss_winbind_getgrent_r
8 #    _nss_winbind_endgrent
9 #    _nss_winbind_endpwent
10 #    _nss_winbind_getgrgid_r
11 #    _nss_winbind_getgrnam_r
12 #    _nss_winbind_getpwent_r
13 #    _nss_winbind_getpwnam_r
14 #    _nss_winbind_getpwuid_r
15 #    _nss_winbind_setgrent
16 #    _nss_winbind_setpwent
17 #
18 # This test also has the nice side-effect of showing any unresolved symbols 
19 # in the library.
20 #
21
22 load_lib util-defs.exp
23
24 # Compile nss_winbind_syms.c
25
26 set output [target_compile "$srcdir/$subdir/nss_winbind_syms.c" \
27         "$srcdir/$subdir/nss_winbind_syms" executable \
28         {"libs=-ldl" "additional_flags=-g"}]
29
30 if {$output != ""} {
31     perror "compile nss_winbind_syms.c"
32     puts $output
33     return
34 }
35
36 # Run load-dl.c
37
38 set output [util_start "$srcdir/$subdir/nss_winbind_syms" \
39         "nsswitch/libnss_winbind.so"]
40
41 if {[regexp "FAIL:" $output]} {
42     fail "run nss_winbind_syms"
43     puts $output
44     return
45 }
46
47 pass "nss_winbind_syms"
48
49 # Clean up
50
51 file delete "$srcdir/$subdir/nss_winbind_syms"