3 # Blackbox test for net [rpc] conf.
5 # Copyright (C) 2011 Vicentiu Ciorbaru <cvicentiu@gmail.com>
9 Usage: test_net_conf.sh SCRIPTDIR SERVERCONFFILE NET CONFIGURATION [rpc]
20 LOGDIR_PREFIX
="conf_test"
23 for OLDDIR
in $
(find ${PREFIX} -type d
-name "${LOGDIR_PREFIX}_*") ; do
24 echo "removing old directory ${OLDDIR}"
29 NET
="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
30 DIR
=$
(mktemp
-d ${PREFIX}/${LOGDIR_PREFIX}_XXXXXX
)
34 if test "x${RPC}" = "xrpc" ; then
35 NETCMD
="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc"
40 incdir
=`dirname $0`/..
/..
/..
/testprogs
/blackbox
52 s/read prediction/;&/g
62 REGPATH
="HKLM\Software\Samba"
67 echo "RC: $RC" >> $LOG
74 echo '\nTesting conf addshare' >> $LOG
75 echo ------------------------- >> $LOG
76 echo '\nDropping existing configuration' >> $LOG
79 log_print
$NETCMD conf drop
80 test "x$?" = "x0" ||
{
81 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
85 #create a lot of shares
86 for i
in $
(seq 1 100); do
87 if [ $
(($i % 2)) -eq 0 ]; then
88 $NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
89 "test comment" >>$DIR/addshare_exp \
91 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
94 $NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
95 "test comment" >>$DIR/addshare_exp \
97 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
100 test "x$?" = "x0" ||
{
101 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
106 $NETCMD conf listshares
> $DIR/listshares_out
107 log_print
$NETCMD conf listshares
108 test "x$?" = "x0" ||
{
109 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
113 for i
in $
(seq 1 100); do
114 grep "share$i" $DIR/listshares_out
>/dev
/null
2>>$LOG
115 if [ "$?" = "1" ]; then
116 echo "ERROR: share not found" |
tee -a $LOG
121 #check the integrity of the shares
122 #if it fails, it can also point to an error in showshare
123 for i
in $
(seq 1 100); do
124 $NETCMD conf showshare share
$i > $DIR/showshare_out
125 test "x$?" = "x0" ||
{
126 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
130 grep "path" $DIR/showshare_out
>/dev
/null
2>>$LOG
131 if [ "$?" = "1" ]; then
132 echo "ERROR: share not found" |
tee -a $LOG
136 if [ $
(($i % 2)) -eq 0 ]; then
137 grep "read only *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
138 if [ "$?" = "1" ]; then
139 echo "ERROR: share not set correctly" |
tee -a $LOG
143 grep "read only *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
144 if [ "$?" = "1" ]; then
145 echo "ERROR: share not set correctly" |
tee -a $LOG
150 if [ $
(($i % 2)) -eq 0 ]; then
151 grep "guest ok *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
152 if [ "$?" = "1" ]; then
153 echo "ERROR: share not set correctly" |
tee -a $LOG
157 grep "guest ok *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
158 if [ "$?" = "1" ]; then
159 echo "ERROR: share not set correctly" |
tee -a $LOG
164 grep "comment *= *test comment" $DIR/showshare_out
>/dev
/null
2>>$LOG
165 if [ "$?" = "1" ]; then
166 echo "ERROR: share not set correctly" |
tee -a $LOG
171 echo '\nTaking a conf snapshot for later use' >> $LOG
172 $NETCMD conf list
> $DIR/conf_import_in
173 log_print
$NETCMD conf list
174 test "x$?" = "x0" ||
{
175 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
180 test_conf_addshare_existing
()
182 #try adding an already existing share
183 echo '\nAdding an already existing share' >>$LOG
184 $NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
185 "test comment" >>$DIR/addshare_exp \
187 log_print
$NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
189 test "x$?" = "x255" ||
{
190 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
194 test -z `cat $DIR/addshare_exp` && {
195 echo "ERROR: addshare output does not match" >> $LOG
202 test_conf_addshare_usage
()
204 #check to see if command prints usage
205 echo '\nChecking usage' >>$LOG
206 $NETCMD conf addshare
> $DIR/addshare_usage_exp
207 log_print
$NETCMD conf addshare
208 test "x$?" = "x255" ||
{
209 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
213 grep "$RPC *conf addshare" $DIR/addshare_usage_exp
>/dev
/null
2>>$LOG
214 if [ "$?" = "1" ]; then
215 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
222 echo '\nTesting conf delshare' >>$LOG
223 echo ------------------------- >> $LOG
226 $NETCMD conf delshare share1
227 log_print
$NETCMD conf delshare share1
228 test "x$?" = "x0" ||
{
229 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
233 $NETCMD conf listshares
> $DIR/listshares_out
234 log_print
$NETCMD conf listshares
235 test "x$?" = "x0" ||
{
236 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
240 grep "share1$" $DIR/listshares_out
>/dev
/null
2>>$LOG
241 if [ "$?" = "0" ]; then
242 echo "ERROR: delshare did not delete 'share1'" |
tee -a $LOG
247 test_conf_delshare_empty
()
249 echo '\nAttempting to delete non_existing share'
250 $NETCMD conf delshare share1
251 log_print
$NETCMD conf delshare share1
252 test "x$?" = "x255" ||
{
253 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
259 test_conf_delshare_usage
()
261 echo '\nChecking usage' >>$LOG
262 $NETCMD conf delshare
> $DIR/delshare_usage_exp
263 log_print
$NETCMD conf delshare
264 test "x$?" = "x255" ||
{
265 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
269 grep "$RPC *conf delshare" $DIR/delshare_usage_exp
>/dev
/null
2>>$LOG
270 if [ "$?" = "1" ]; then
271 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
279 echo '\nTesting conf drop' >> $LOG
280 echo ------------------------- >> $LOG
281 echo '\nDropping existing configuration' >> $LOG
284 log_print
$NETCMD conf drop
285 test "x$?" = "x0" ||
{
286 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
290 #check to see if listing the configuration yields a blank file
291 $NETCMD conf list
1>>$DIR/list_out
292 log_print
$NETCMD conf list
293 test "x$?" = "x0" ||
{
294 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
298 test -z "`cat $DIR/list_out`" ||
{
299 echo "ERROR: Expected list output did not match" |
tee -a $LOG
304 test_conf_drop_empty
()
306 #Drop an empty config, see if conf drop fails
307 echo '\nAttempting to drop an empty configuration' >>$LOG
310 log_print
$NETCMD conf drop
311 test "x$?" = "x0" ||
{
312 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
316 #check to see if listing the configuration yields a blank file
317 $NETCMD conf list
1>>$DIR/list_out
318 log_print
$NETCMD conf list
319 test "x$?" = "x0" ||
{
320 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
324 test -z "`cat $DIR/list_out`" ||
{
325 echo ERROR
:Expected list output did not match
>> $LOG
330 test_conf_drop_usage
()
332 #check to see if command prints usage
333 echo '\nChecking usage' >>$LOG
334 $NETCMD conf drop extra_arg
> $DIR/drop_usage_exp
335 log_print
$NETCMD conf drop extra_arg
336 test "x$?" = "x255" ||
{
337 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
341 grep "$RPC *conf drop" $DIR/drop_usage_exp
>/dev
/null
2>>$LOG
342 if [ "$?" = "1" ]; then
343 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
350 echo '\nTesting conf setparm' >> $LOG
351 echo ------------------------- >> $LOG
353 echo '\nDropping existing configuration' >> $LOG
355 log_print
$NETCMD conf drop
356 test "x$?" = "x0" ||
{
357 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
361 $NETCMD conf setparm share1
"read only" yes
362 log_print
$NETCMD conf setparm share1
"read only" yes
363 test "x$?" = "x0" ||
{
364 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
368 $NETCMD conf setparm share1
"path" /tmp
/test_path
369 log_print
$NETCMD conf setparm share1
"path" /tmp
/test_path
370 test "x$?" = "x0" ||
{
371 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
375 $NETCMD conf showshare share1
> $DIR/setparm_showshare_out
376 test "x$?" = "x0" ||
{
377 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
381 grep "read only *= *yes" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
382 if [ "$?" = "1" ]; then
383 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
387 grep "path *= */tmp/test_path" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
388 if [ "$?" = "1" ]; then
389 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
394 test_conf_setparm_existing
()
397 echo '\nSetting already existing param with the same value'
398 $NETCMD conf setparm share1
"read only" yes
399 log_print
$NETCMD conf setparm share1
"read only" yes
400 test "x$?" = "x0" ||
{
401 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
405 $NETCMD conf setparm share1
"read only" yes
406 log_print
$NETCMD conf setparm share1
"read only" yes
407 test "x$?" = "x0" ||
{
408 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
412 $NETCMD conf showshare share1
> $DIR/setparm_existing_showshare_out
413 test "x$?" = "x0" ||
{
414 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
418 grep "read only *= *yes" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
419 if [ "$?" = "1" ]; then
420 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
424 $NETCMD conf setparm share1
"read only" no
425 log_print
$NETCMD conf setparm share1
"read only" no
426 test "x$?" = "x0" ||
{
427 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
431 $NETCMD conf showshare share1
> $DIR/setparm_existing_showshare_out
432 test "x$?" = "x0" ||
{
433 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
437 grep "read only *= *no" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
438 if [ "$?" = "1" ]; then
439 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
444 test_conf_setparm_usage
()
446 echo '\nChecking usage' >>$LOG
447 $NETCMD conf setparm
> $DIR/setparm_usage_exp
448 log_print
$NETCMD conf setparm
449 test "x$?" = "x255" ||
{
450 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
454 grep "$RPC *conf setparm" $DIR/setparm_usage_exp
>/dev
/null
2>>$LOG
455 if [ "$?" = "1" ]; then
456 echo "ERROR: setparm no/wrong usage message printed" |
tee -a $LOG
461 test_conf_delparm_delete_existing
()
463 echo '\nTesting conf delparm' >> $LOG
464 echo ------------------------- >> $LOG
468 log_print
$NETCMD conf drop
469 test "x$?" = "x0" ||
{
470 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
474 $NETCMD conf addshare share1
/tmp
"writeable=y" "guest_ok=n" \
476 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
479 $NETCMD conf delparm share1
"path"
480 log_print
$NETCMD conf delparm share1
"path"
481 test "x$?" = "x0" ||
{
482 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
486 $NETCMD conf showshare share1
> $DIR/delparm_showshare_out
487 test "x$?" = "x0" ||
{
488 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
492 #test to see what delparm did delete and how
493 grep "read only *= *no" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
494 if [ "$?" = "1" ]; then
495 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
499 grep "path *= */tmp" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
500 if [ "$?" = "0" ]; then
501 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
506 test_conf_delparm_delete_non_existing
()
508 echo '\nDelete non existing share' >> $LOG
511 log_print
$NETCMD conf drop
512 test "x$?" = "x0" ||
{
513 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
517 $NETCMD conf delparm share1
"path"
518 log_print
$NETCMD conf delparm share1
"path"
519 test "x$?" = "x255" ||
{
520 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
525 test_conf_delparm_usage
()
528 echo '\nChecking usage' >>$LOG
529 $NETCMD conf delparm
> $DIR/delparm_usage_exp
530 log_print
$NETCMD conf delparm
531 test "x$?" = "x255" ||
{
532 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
536 grep "$RPC *conf delparm" $DIR/delparm_usage_exp
>/dev
/null
2>>$LOG
537 if [ "$?" = "1" ]; then
538 echo "ERROR: delparm no/wrong usage message printed" |
tee -a $LOG
547 echo '\nTesting conf getparm' >> $LOG
548 echo ------------------------- >> $LOG
552 log_print
$NETCMD conf drop
553 test "x$?" = "x0" ||
{
557 $NETCMD conf addshare share1
/tmp
/path_test
"writeable=n" "guest_ok=n" \
559 log_print
$NETCMD conf addshare share
$i /tmp
/path_test
"writeable=n" "guest_ok=n" \
561 test "x$?" = "x0" ||
{
562 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
566 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
567 log_print
$NETCMD conf getparm share1
"read only"
568 test "x$?" = "x0" ||
{
569 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
573 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
574 log_print
$NETCMD conf getparm share1
"read only"
575 test "x$?" = "x0" ||
{
576 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
580 echo yes >$DIR/getparm_exp
581 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
582 if [ "$?" = "1" ]; then
583 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
587 $NETCMD conf getparm share1
"path" >$DIR/getparm_out
588 log_print
$NETCMD conf getparm share1
"path"
589 test "x$?" = "x0" ||
{
590 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
594 echo /tmp
/path_test
>$DIR/getparm_exp
595 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
596 if [ "$?" = "1" ]; then
597 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
602 test_conf_getparm_usage
()
604 echo '\nChecking usage' >>$LOG
605 $NETCMD conf getparm
> $DIR/getparm_usage_exp
606 log_print
$NETCMD conf getparm
607 test "x$?" = "x255" ||
{
608 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
612 grep "$RPC *conf getparm" $DIR/getparm_usage_exp
>/dev
/null
2>>$LOG
613 if [ "$?" = "1" ]; then
614 echo "ERROR: getparm no/wrong usage message printed" |
tee -a $LOG
620 test_conf_getparm_non_existing
()
622 echo '\nTesting getparm non existing' >>$LOG
623 $NETCMD conf getparm fictional_share fictional_param
624 log_print
$NETCMD conf getparm fictional_share fictional_param
625 test "x$?" = "x255" ||
{
626 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
630 $NETCMD conf getparm share1 fictional_param
631 log_print
$NETCMD conf getparm share1 fictional_param
632 test "x$?" = "x255" ||
{
633 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
638 test_conf_setincludes
()
640 echo '\nTesting conf setincludes' >> $LOG
641 echo ------------------------- >> $LOG
642 echo '\nDropping existing configuration' >> $LOG
645 log_print
$NETCMD conf drop
646 test "x$?" = "x0" ||
{
647 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
651 $NETCMD conf addshare tmp_share
/tmp
652 log_print
$NETCMD conf addshare tmp_share
/tmp
653 test "x$?" = "x0" ||
{
654 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
658 $NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
659 log_print
$NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
660 test "x$?" = "x0" ||
{
661 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
665 $NETCMD conf list
> $DIR/setincludes_list_out
666 log_print
$NETCMD conf list
667 test "x$?" = "x0" ||
{
668 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
672 grep "include *= */tmp/include1$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
673 if [ "$?" = "1" ]; then
674 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
678 grep "include *= */tmp/include2$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
679 if [ "$?" = "1" ]; then
680 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
684 grep "include *= */tmp/include3$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
685 if [ "$?" = "1" ]; then
686 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
692 test_conf_setincludes_usage
()
694 echo '\nChecking usage' >>$LOG
695 $NETCMD conf setincludes
> $DIR/setincludes_usage_exp
696 log_print
$NETCMD conf setincludes
697 test "x$?" = "x255" ||
{
698 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
702 grep "$RPC *conf setincludes" $DIR/setincludes_usage_exp
>/dev
/null
2>>$LOG
703 if [ "$?" = "1" ]; then
704 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
709 test_conf_getincludes
()
711 $NETCMD conf getincludes tmp_share
> $DIR/getincludes_out
712 log_print
$NETCMD conf getincludes tmp_share
713 test "x$?" = "x0" ||
{
714 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
718 grep "include *= */tmp/include1$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
719 if [ "$?" = "1" ]; then
720 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
724 grep "include *= */tmp/include2$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
725 if [ "$?" = "1" ]; then
726 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
729 grep "include *= */tmp/include3$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
730 if [ "$?" = "1" ]; then
731 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
736 test_conf_getincludes_usage
()
738 $NETCMD conf getincludes
> $DIR/getincludes_usage_exp
739 log_print
$NETCMD conf getincludes
741 grep "$RPC *conf getincludes" $DIR/getincludes_usage_exp
>/dev
/null
2>>$LOG
742 if [ "$?" = "1" ]; then
743 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
748 test_conf_delincludes
()
750 echo '\nTesting conf delincludes' >> $LOG
751 echo ------------------------- >> $LOG
753 $NETCMD conf delincludes tmp_share
754 log_print
$NETCMD conf delincludes tmp_share
755 test "x$?" = "x0" ||
{
756 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
760 $NETCMD conf list
> $DIR/delincludes_list_out
761 log_print
$NETCMD conf list
762 test "x$?" = "x0" ||
{
763 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
767 grep "include" $DIR/delincludes_list_out
>/dev
/null
2>>$LOG
768 if [ "$?" = "0" ]; then
769 echo "ERROR: delincludes did not delete correctly" |
tee -a $LOG
774 test_conf_delincludes_empty
()
776 $NETCMD conf delincludes tmp_share
777 log_print
$NETCMD conf delincludes tmp_share
778 test "x$?" = "x0" ||
{
779 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
783 $NETCMD conf delincludes fictional_share
784 log_print
$NETCMD conf delincludes fictional_share
785 test "x$?" = "x255" ||
{
786 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
792 test_conf_delincludes_usage
()
794 echo '\nChecking usage' >>$LOG
795 $NETCMD conf delincludes
> $DIR/delincludes_usage_exp
796 log_print
$NETCMD conf delincludes
797 test "x$?" = "x255" ||
{
798 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
802 grep "$RPC *conf delincludes" $DIR/delincludes_usage_exp
>/dev
/null
2>>$LOG
803 if [ "$?" = "1" ]; then
804 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
811 echo '\nTesting conf import' >> $LOG
812 echo ------------------------- >> $LOG
813 echo '\nDropping existing configuration' >> $LOG
816 log_print
$NETCMD conf drop
817 test "x$?" = "x0" ||
{
818 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
822 $NETCMD conf import
$DIR/conf_import_in
823 log_print
$NETCMD conf drop
824 test "x$?" = "x0" ||
{
825 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
829 $NETCMD conf list
> $DIR/conf_import_out
830 log_print
$NETCMD conf list
831 test "x$?" = "x0" ||
{
832 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
836 diff -q $DIR/conf_import_in
$DIR/conf_import_out
>> $LOG
837 if [ "$?" = "1" ]; then
838 echo "ERROR: import failed" |
tee -a $LOG
843 test_conf_import_usage
()
845 echo '\nChecking usage' >>$LOG
846 $NETCMD conf import
> $DIR/import_usage_exp
847 log_print
$NETCMD conf import
848 test "x$?" = "x255" ||
{
849 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
853 grep "$RPC *conf import" $DIR/import_usage_exp
>/dev
/null
2>>$LOG
854 if [ "$?" = "1" ]; then
855 echo "ERROR: conf import no/wrong usage message printed" |
tee -a $LOG
860 CONF_FILES
=$SERVERCONFFILE
864 || failed
=`expr $failed + 1`
866 testit
"conf_drop_empty" \
867 test_conf_drop_empty \
868 || failed
=`expr $failed + 1`
870 testit
"conf_drop_usage" \
871 test_conf_drop_usage \
872 || failed
=`expr $failed + 1`
874 testit
"conf_addshare" \
876 || failed
=`expr $failed + 1`
878 testit
"conf_addshare_existing" \
879 test_conf_addshare_existing \
880 || failed
=`expr $failed + 1`
882 testit
"conf_addshare_usage" \
883 test_conf_addshare_usage \
884 || failed
=`expr $failed + 1`
886 testit
"conf_delshare" \
888 || failed
=`expr $failed + 1`
890 testit
"conf_delshare_empty" \
891 test_conf_delshare_empty \
892 || failed
=`expr $failed + 1`
894 testit
"conf_delshare_usage" \
895 test_conf_delshare_usage \
896 || failed
=`expr $failed + 1`
898 testit
"conf_setparm" \
900 || failed
=`expr $failed + 1`
902 testit
"conf_setparm_existing" \
903 test_conf_setparm_existing \
904 || failed
=`expr $failed + 1`
906 testit
"conf_setparm_usage" \
907 test_conf_setparm_usage \
908 || failed
=`expr $failed + 1`
910 testit
"conf_delparm_delete_existing" \
911 test_conf_delparm_delete_existing \
912 || failed
=`expr $failed + 1`
914 testit
"conf_delparm_delete_non_existing" \
915 test_conf_delparm_delete_non_existing \
916 || failed
=`expr $failed + 1`
918 testit
"conf_delparm_delete_usage" \
919 test_conf_delparm_usage \
920 || failed
=`expr $failed + 1`
922 testit
"conf_getparm" \
924 || failed
=`expr $failed + 1`
926 testit
"conf_getparm_usage" \
927 test_conf_getparm_usage \
928 || failed
=`expr $failed + 1`
930 testit
"conf_setincludes" \
931 test_conf_setincludes \
932 || failed
=`expr $failed + 1`
934 testit
"conf_setincludes_usage" \
935 test_conf_setincludes_usage \
936 || failed
=`expr $failed + 1`
938 testit
"conf_getincludes" \
939 test_conf_getincludes \
940 || failed
=`expr $failed + 1`
942 testit
"conf_getincludes_usage" \
943 test_conf_getincludes_usage \
944 || failed
=`expr $failed + 1`
946 testit
"conf_delincludes" \
947 test_conf_delincludes \
948 || failed
=`expr $failed + 1`
950 testit
"conf_delincludes_empty" \
951 test_conf_delincludes_usage \
952 || failed
=`expr $failed + 1`
954 testit
"conf_delincludes_usage" \
955 test_conf_delincludes_empty \
956 || failed
=`expr $failed + 1`
958 testit
"conf_import" \
960 || failed
=`expr $failed + 1`
962 testit
"conf_import_usage" \
963 test_conf_import_usage \
964 || failed
=`expr $failed + 1`
966 if [ $failed -eq 0 ]; then