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.
10 Usage: test_net_registry_roundtrip.sh LOCAL_PATH
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
25 test_include_expand_macro
()
28 rm -f ${TEMP_CONFFILE}
29 cat >${TEMP_CONFFILE}<<EOF
31 include = ${TEMP_CONFFILE}.%${MACRO}
33 ${TESTPARM} ${TEMP_CONFFILE}
36 test_one_global_option
()
39 rm -f ${TEMP_CONFFILE}
40 cat > ${TEMP_CONFFILE}<<EOF
44 ${TESTPARM} ${TEMP_CONFFILE}
49 rm -f ${TEMP_CONFFILE}
50 cat > ${TEMP_CONFFILE}<<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`
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`
94 failed
=`expr ${failed} + 1`
96 rm -f ${TEMP_CONFFILE}