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" && {
13 .
$incdir/test_functions.sh
18 test_include_expand_macro
()
21 rm -f ${TEMP_CONFFILE}
22 cat >${TEMP_CONFFILE}<<EOF
24 include = ${TEMP_CONFFILE}.%${MACRO}
26 ${TESTPARM} ${TEMP_CONFFILE}
29 test_one_global_option
()
32 rm -f ${TEMP_CONFFILE}
33 cat > ${TEMP_CONFFILE}<<EOF
37 ${TESTPARM} ${TEMP_CONFFILE}
42 rm -f ${TEMP_CONFFILE}
43 cat > ${TEMP_CONFFILE}<<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`
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`
87 failed
=`expr ${failed} + 1`
89 rm -f ${TEMP_CONFFILE}