s4:LogonGetDomainInfo - allow to set DNS hostname for the first time
[Samba/ekacnet.git] / source3 / script / tests / test_testparm_s3.sh
blobc88fc2d9d591e63d214f95856740e7041756a03b
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 TEMP_CONFFILE=${LIBDIR}/smb.conf.tmp
9 TESTPARM="$VALGRIND ${TESTPARM:-$BINDIR/testparm} --suppress-prompt --skip-logic-checks"
11 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
12 incdir=`dirname $0`
13 . $incdir/test_functions.sh
16 failed=0
18 test_include_expand_macro()
20 MACRO=$1
21 rm -f ${TEMP_CONFFILE}
22 cat >${TEMP_CONFFILE}<<EOF
23 [global]
24 include = ${TEMP_CONFFILE}.%${MACRO}
25 EOF
26 ${TESTPARM} ${TEMP_CONFFILE}
29 test_one_global_option()
31 OPTION="$@"
32 rm -f ${TEMP_CONFFILE}
33 cat > ${TEMP_CONFFILE}<<EOF
34 [global]
35 ${OPTION}
36 EOF
37 ${TESTPARM} ${TEMP_CONFFILE}
40 test_copy()
42 rm -f ${TEMP_CONFFILE}
43 cat > ${TEMP_CONFFILE}<<EOF
44 [share1]
45 path = /tmp
46 read only = no
48 [share2]
49 copy = share1
50 EOF
51 ${TESTPARM} ${TEMP_CONFFILE}
55 testit "netbios name" \
56 test_one_global_option "netbios name = funky" || \
57 failed=`expr ${failed} + 1`
59 testit "netbios aliases" \
60 test_one_global_option "netbios aliases = funky1 funky2 funky3" || \
61 failed=`expr ${failed} + 1`
63 testit "netbios scope" \
64 test_one_global_option "netbios scope = abc" || \
65 failed=`expr ${failed} + 1`
67 testit "workgroup" \
68 test_one_global_option "workgroup = samba" || \
69 failed=`expr ${failed} + 1`
71 testit "display charset" \
72 test_one_global_option "display charset = UTF8" || \
73 failed=`expr ${failed} + 1`
75 testit "ldap debug level" \
76 test_one_global_option "ldap debug level = 7" || \
77 failed=`expr ${failed} + 1`
79 for LETTER in U G D I i L N M R T a d h m v w V ; do
80 testit "include with %${LETTER} macro expansion" \
81 test_include_expand_macro "${LETTER}" || \
82 failed=`expr ${failed} + 1`
83 done
85 testit "copy" \
86 test_copy || \
87 failed=`expr ${failed} + 1`
89 rm -f ${TEMP_CONFFILE}
91 testok $0 ${failed}