s3: Remove a call to procid_self()
[Samba/gebeck_regimport.git] / source3 / script / tests / test_testparm_s3.sh
blobc9682f0dd10cf09dbe02f53acceb8da5f46f483f
1 #!/bin/sh
3 # Tests for lp_load() via testparm.
5 # The main purpose (for now) is to test all the special handlers
6 # and the macro expansions.
8 if [ $# -lt 1 ]; then
9 cat <<EOF
10 Usage: test_net_registry_roundtrip.sh LOCAL_PATH
11 EOF
12 exit 1;
15 LOCAL_PATH="$1"
17 TEMP_CONFFILE=${LOCAL_PATH}/smb.conf.tmp
18 TESTPARM="$VALGRIND ${TESTPARM:-$BINDIR/testparm} --suppress-prompt --skip-logic-checks"
20 incdir=`dirname $0`/../../../testprogs/blackbox
21 . $incdir/subunit.sh
23 failed=0
25 test_include_expand_macro()
27 MACRO=$1
28 rm -f ${TEMP_CONFFILE}
29 cat >${TEMP_CONFFILE}<<EOF
30 [global]
31 include = ${TEMP_CONFFILE}.%${MACRO}
32 EOF
33 ${TESTPARM} ${TEMP_CONFFILE}
36 test_one_global_option()
38 OPTION="$@"
39 rm -f ${TEMP_CONFFILE}
40 cat > ${TEMP_CONFFILE}<<EOF
41 [global]
42 ${OPTION}
43 EOF
44 ${TESTPARM} ${TEMP_CONFFILE}
47 test_copy()
49 rm -f ${TEMP_CONFFILE}
50 cat > ${TEMP_CONFFILE}<<EOF
51 [share1]
52 path = /tmp
53 read only = no
55 [share2]
56 copy = share1
57 EOF
58 ${TESTPARM} ${TEMP_CONFFILE}
62 testit "netbios name" \
63 test_one_global_option "netbios name = funky" || \
64 failed=`expr ${failed} + 1`
66 testit "netbios aliases" \
67 test_one_global_option "netbios aliases = funky1 funky2 funky3" || \
68 failed=`expr ${failed} + 1`
70 testit "netbios scope" \
71 test_one_global_option "netbios scope = abc" || \
72 failed=`expr ${failed} + 1`
74 testit "workgroup" \
75 test_one_global_option "workgroup = samba" || \
76 failed=`expr ${failed} + 1`
78 testit "display charset" \
79 test_one_global_option "display charset = UTF8" || \
80 failed=`expr ${failed} + 1`
82 testit "ldap debug level" \
83 test_one_global_option "ldap debug level = 7" || \
84 failed=`expr ${failed} + 1`
86 for LETTER in U G D I i L N M R T a d h m v w V ; do
87 testit "include with %${LETTER} macro expansion" \
88 test_include_expand_macro "${LETTER}" || \
89 failed=`expr ${failed} + 1`
90 done
92 testit "copy" \
93 test_copy || \
94 failed=`expr ${failed} + 1`
96 rm -f ${TEMP_CONFFILE}
98 testok $0 ${failed}