3 # Blackbox test for net [rpc] conf.
5 # Copyright (C) 2011 Vicentiu Ciorbaru <cvicentiu@gmail.com>
9 Usage: test_net_conf.sh SCRIPTDIR SERVERCONFFILE CONFIGURATION [rpc]
19 LOGDIR_PREFIX
="conf_test"
22 for OLDDIR
in $
(find ${PREFIX} -type d
-name "${LOGDIR_PREFIX}_*") ; do
23 echo "removing old directory ${OLDDIR}"
28 NET
="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
29 DIR
=$
(mktemp
-d ${PREFIX}/${LOGDIR_PREFIX}_XXXXXX
)
33 if test "x${RPC}" = "xrpc" ; then
34 NETCMD
="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc"
39 incdir
=`dirname $0`/..
/..
/..
/testprogs
/blackbox
51 s/read prediction/;&/g
61 REGPATH
="HKLM\Software\Samba"
66 echo "RC: $RC" >> $LOG
73 echo '\nTesting conf addshare' >> $LOG
74 echo ------------------------- >> $LOG
75 echo '\nDropping existing configuration' >> $LOG
78 log_print
$NETCMD conf drop
79 test "x$?" = "x0" ||
{
80 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
84 #create a lot of shares
85 for i
in $
(seq 1 100); do
86 if [ $
(($i % 2)) -eq 0 ]; then
87 $NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
88 "test comment" >>$DIR/addshare_exp \
90 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
93 $NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
94 "test comment" >>$DIR/addshare_exp \
96 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
99 test "x$?" = "x0" ||
{
100 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
105 $NETCMD conf listshares
> $DIR/listshares_out
106 log_print
$NETCMD conf listshares
107 test "x$?" = "x0" ||
{
108 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
112 for i
in $
(seq 1 100); do
113 grep "share$i" $DIR/listshares_out
>/dev
/null
2>>$LOG
114 if [ "$?" = "1" ]; then
115 echo "ERROR: share not found" |
tee -a $LOG
120 #check the integrity of the shares
121 #if it fails, it can also point to an error in showshare
122 for i
in $
(seq 1 100); do
123 $NETCMD conf showshare share
$i > $DIR/showshare_out
124 test "x$?" = "x0" ||
{
125 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
129 grep "path" $DIR/showshare_out
>/dev
/null
2>>$LOG
130 if [ "$?" = "1" ]; then
131 echo "ERROR: share not found" |
tee -a $LOG
135 if [ $
(($i % 2)) -eq 0 ]; then
136 grep "read only *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
137 if [ "$?" = "1" ]; then
138 echo "ERROR: share not set correctly" |
tee -a $LOG
142 grep "read only *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
143 if [ "$?" = "1" ]; then
144 echo "ERROR: share not set correctly" |
tee -a $LOG
149 if [ $
(($i % 2)) -eq 0 ]; then
150 grep "guest ok *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
151 if [ "$?" = "1" ]; then
152 echo "ERROR: share not set correctly" |
tee -a $LOG
156 grep "guest ok *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
157 if [ "$?" = "1" ]; then
158 echo "ERROR: share not set correctly" |
tee -a $LOG
163 grep "comment *= *test comment" $DIR/showshare_out
>/dev
/null
2>>$LOG
164 if [ "$?" = "1" ]; then
165 echo "ERROR: share not set correctly" |
tee -a $LOG
170 echo '\nTaking a conf snapshot for later use' >> $LOG
171 $NETCMD conf list
> $DIR/conf_import_in
172 log_print
$NETCMD conf list
173 test "x$?" = "x0" ||
{
174 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
179 test_conf_addshare_existing
()
181 #try adding an already existing share
182 echo '\nAdding an already existing share' >>$LOG
183 $NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
184 "test comment" >>$DIR/addshare_exp \
186 log_print
$NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
188 test "x$?" = "x255" ||
{
189 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
193 test -z `cat $DIR/addshare_exp` && {
194 echo "ERROR: addshare output does not match" >> $LOG
201 test_conf_addshare_usage
()
203 #check to see if command prints usage
204 echo '\nChecking usage' >>$LOG
205 $NETCMD conf addshare
> $DIR/addshare_usage_exp
206 log_print
$NETCMD conf addshare
207 test "x$?" = "x255" ||
{
208 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
212 grep "$RPC *conf addshare" $DIR/addshare_usage_exp
>/dev
/null
2>>$LOG
213 if [ "$?" = "1" ]; then
214 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
221 echo '\nTesting conf delshare' >>$LOG
222 echo ------------------------- >> $LOG
225 $NETCMD conf delshare share1
226 log_print
$NETCMD conf delshare share1
227 test "x$?" = "x0" ||
{
228 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
232 $NETCMD conf listshares
> $DIR/listshares_out
233 log_print
$NETCMD conf listshares
234 test "x$?" = "x0" ||
{
235 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
239 grep "share1$" $DIR/listshares_out
>/dev
/null
2>>$LOG
240 if [ "$?" = "0" ]; then
241 echo "ERROR: delshare did not delete 'share1'" |
tee -a $LOG
246 test_conf_delshare_empty
()
248 echo '\nAttempting to delete non_existing share'
249 $NETCMD conf delshare share1
250 log_print
$NETCMD conf delshare share1
251 test "x$?" = "x255" ||
{
252 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
258 test_conf_delshare_usage
()
260 echo '\nChecking usage' >>$LOG
261 $NETCMD conf delshare
> $DIR/delshare_usage_exp
262 log_print
$NETCMD conf delshare
263 test "x$?" = "x255" ||
{
264 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
268 grep "$RPC *conf delshare" $DIR/delshare_usage_exp
>/dev
/null
2>>$LOG
269 if [ "$?" = "1" ]; then
270 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
278 echo '\nTesting conf drop' >> $LOG
279 echo ------------------------- >> $LOG
280 echo '\nDropping existing configuration' >> $LOG
283 log_print
$NETCMD conf drop
284 test "x$?" = "x0" ||
{
285 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
289 #check to see if listing the configuration yields a blank file
290 $NETCMD conf list
1>>$DIR/list_out
291 log_print
$NETCMD conf list
292 test "x$?" = "x0" ||
{
293 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
297 test -z "`cat $DIR/list_out`" ||
{
298 echo "ERROR: Expected list output did not match" |
tee -a $LOG
303 test_conf_drop_empty
()
305 #Drop an empty config, see if conf drop fails
306 echo '\nAttempting to drop an empty configuration' >>$LOG
309 log_print
$NETCMD conf drop
310 test "x$?" = "x0" ||
{
311 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
315 #check to see if listing the configuration yields a blank file
316 $NETCMD conf list
1>>$DIR/list_out
317 log_print
$NETCMD conf list
318 test "x$?" = "x0" ||
{
319 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
323 test -z "`cat $DIR/list_out`" ||
{
324 echo ERROR
:Expected list output did not match
>> $LOG
329 test_conf_drop_usage
()
331 #check to see if command prints usage
332 echo '\nChecking usage' >>$LOG
333 $NETCMD conf drop extra_arg
> $DIR/drop_usage_exp
334 log_print
$NETCMD conf drop extra_arg
335 test "x$?" = "x255" ||
{
336 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
340 grep "$RPC *conf drop" $DIR/drop_usage_exp
>/dev
/null
2>>$LOG
341 if [ "$?" = "1" ]; then
342 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
349 echo '\nTesting conf setparm' >> $LOG
350 echo ------------------------- >> $LOG
352 echo '\nDropping existing configuration' >> $LOG
354 log_print
$NETCMD conf drop
355 test "x$?" = "x0" ||
{
356 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
360 $NETCMD conf setparm share1
"read only" yes
361 log_print
$NETCMD conf setparm share1
"read only" yes
362 test "x$?" = "x0" ||
{
363 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
367 $NETCMD conf setparm share1
"path" /tmp
/test_path
368 log_print
$NETCMD conf setparm share1
"path" /tmp
/test_path
369 test "x$?" = "x0" ||
{
370 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
374 $NETCMD conf showshare share1
> $DIR/setparm_showshare_out
375 test "x$?" = "x0" ||
{
376 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
380 grep "read only *= *yes" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
381 if [ "$?" = "1" ]; then
382 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
386 grep "path *= */tmp/test_path" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
387 if [ "$?" = "1" ]; then
388 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
393 test_conf_setparm_existing
()
396 echo '\nSetting already existing param with the same value'
397 $NETCMD conf setparm share1
"read only" yes
398 log_print
$NETCMD conf setparm share1
"read only" yes
399 test "x$?" = "x0" ||
{
400 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
404 $NETCMD conf setparm share1
"read only" yes
405 log_print
$NETCMD conf setparm share1
"read only" yes
406 test "x$?" = "x0" ||
{
407 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
411 $NETCMD conf showshare share1
> $DIR/setparm_existing_showshare_out
412 test "x$?" = "x0" ||
{
413 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
417 grep "read only *= *yes" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
418 if [ "$?" = "1" ]; then
419 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
423 $NETCMD conf setparm share1
"read only" no
424 log_print
$NETCMD conf setparm share1
"read only" no
425 test "x$?" = "x0" ||
{
426 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
430 $NETCMD conf showshare share1
> $DIR/setparm_existing_showshare_out
431 test "x$?" = "x0" ||
{
432 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
436 grep "read only *= *no" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
437 if [ "$?" = "1" ]; then
438 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
443 test_conf_setparm_usage
()
445 echo '\nChecking usage' >>$LOG
446 $NETCMD conf setparm
> $DIR/setparm_usage_exp
447 log_print
$NETCMD conf setparm
448 test "x$?" = "x255" ||
{
449 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
453 grep "$RPC *conf setparm" $DIR/setparm_usage_exp
>/dev
/null
2>>$LOG
454 if [ "$?" = "1" ]; then
455 echo "ERROR: setparm no/wrong usage message printed" |
tee -a $LOG
460 test_conf_delparm_delete_existing
()
462 echo '\nTesting conf delparm' >> $LOG
463 echo ------------------------- >> $LOG
467 log_print
$NETCMD conf drop
468 test "x$?" = "x0" ||
{
469 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
473 $NETCMD conf addshare share1
/tmp
"writeable=y" "guest_ok=n" \
475 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
478 $NETCMD conf delparm share1
"path"
479 log_print
$NETCMD conf delparm share1
"path"
480 test "x$?" = "x0" ||
{
481 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
485 $NETCMD conf showshare share1
> $DIR/delparm_showshare_out
486 test "x$?" = "x0" ||
{
487 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
491 #test to see what delparm did delete and how
492 grep "read only *= *no" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
493 if [ "$?" = "1" ]; then
494 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
498 grep "path *= */tmp" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
499 if [ "$?" = "0" ]; then
500 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
505 test_conf_delparm_delete_non_existing
()
507 echo '\nDelete non existing share' >> $LOG
510 log_print
$NETCMD conf drop
511 test "x$?" = "x0" ||
{
512 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
516 $NETCMD conf delparm share1
"path"
517 log_print
$NETCMD conf delparm share1
"path"
518 test "x$?" = "x255" ||
{
519 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
524 test_conf_delparm_usage
()
527 echo '\nChecking usage' >>$LOG
528 $NETCMD conf delparm
> $DIR/delparm_usage_exp
529 log_print
$NETCMD conf delparm
530 test "x$?" = "x255" ||
{
531 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
535 grep "$RPC *conf delparm" $DIR/delparm_usage_exp
>/dev
/null
2>>$LOG
536 if [ "$?" = "1" ]; then
537 echo "ERROR: delparm no/wrong usage message printed" |
tee -a $LOG
546 echo '\nTesting conf getparm' >> $LOG
547 echo ------------------------- >> $LOG
551 log_print
$NETCMD conf drop
552 test "x$?" = "x0" ||
{
556 $NETCMD conf addshare share1
/tmp
/path_test
"writeable=n" "guest_ok=n" \
558 log_print
$NETCMD conf addshare share
$i /tmp
/path_test
"writeable=n" "guest_ok=n" \
560 test "x$?" = "x0" ||
{
561 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
565 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
566 log_print
$NETCMD conf getparm share1
"read only"
567 test "x$?" = "x0" ||
{
568 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
572 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
573 log_print
$NETCMD conf getparm share1
"read only"
574 test "x$?" = "x0" ||
{
575 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
579 echo yes >$DIR/getparm_exp
580 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
581 if [ "$?" = "1" ]; then
582 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
586 $NETCMD conf getparm share1
"path" >$DIR/getparm_out
587 log_print
$NETCMD conf getparm share1
"path"
588 test "x$?" = "x0" ||
{
589 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
593 echo /tmp
/path_test
>$DIR/getparm_exp
594 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
595 if [ "$?" = "1" ]; then
596 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
601 test_conf_getparm_usage
()
603 echo '\nChecking usage' >>$LOG
604 $NETCMD conf getparm
> $DIR/getparm_usage_exp
605 log_print
$NETCMD conf getparm
606 test "x$?" = "x255" ||
{
607 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
611 grep "$RPC *conf getparm" $DIR/getparm_usage_exp
>/dev
/null
2>>$LOG
612 if [ "$?" = "1" ]; then
613 echo "ERROR: getparm no/wrong usage message printed" |
tee -a $LOG
619 test_conf_getparm_non_existing
()
621 echo '\nTesting getparm non existing' >>$LOG
622 $NETCMD conf getparm fictional_share fictional_param
623 log_print
$NETCMD conf getparm fictional_share fictional_param
624 test "x$?" = "x255" ||
{
625 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
629 $NETCMD conf getparm share1 fictional_param
630 log_print
$NETCMD conf getparm share1 fictional_param
631 test "x$?" = "x255" ||
{
632 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
637 test_conf_setincludes
()
639 echo '\nTesting conf setincludes' >> $LOG
640 echo ------------------------- >> $LOG
641 echo '\nDropping existing configuration' >> $LOG
644 log_print
$NETCMD conf drop
645 test "x$?" = "x0" ||
{
646 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
650 $NETCMD conf addshare tmp_share
/tmp
651 log_print
$NETCMD conf addshare tmp_share
/tmp
652 test "x$?" = "x0" ||
{
653 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
657 $NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
658 log_print
$NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
659 test "x$?" = "x0" ||
{
660 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
664 $NETCMD conf list
> $DIR/setincludes_list_out
665 log_print
$NETCMD conf list
666 test "x$?" = "x0" ||
{
667 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
671 grep "include *= */tmp/include1$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
672 if [ "$?" = "1" ]; then
673 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
677 grep "include *= */tmp/include2$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
678 if [ "$?" = "1" ]; then
679 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
683 grep "include *= */tmp/include3$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
684 if [ "$?" = "1" ]; then
685 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
691 test_conf_setincludes_usage
()
693 echo '\nChecking usage' >>$LOG
694 $NETCMD conf setincludes
> $DIR/setincludes_usage_exp
695 log_print
$NETCMD conf setincludes
696 test "x$?" = "x255" ||
{
697 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
701 grep "$RPC *conf setincludes" $DIR/setincludes_usage_exp
>/dev
/null
2>>$LOG
702 if [ "$?" = "1" ]; then
703 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
708 test_conf_getincludes
()
710 $NETCMD conf getincludes tmp_share
> $DIR/getincludes_out
711 log_print
$NETCMD conf getincludes tmp_share
712 test "x$?" = "x0" ||
{
713 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
717 grep "include *= */tmp/include1$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
718 if [ "$?" = "1" ]; then
719 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
723 grep "include *= */tmp/include2$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
724 if [ "$?" = "1" ]; then
725 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
728 grep "include *= */tmp/include3$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
729 if [ "$?" = "1" ]; then
730 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
735 test_conf_getincludes_usage
()
737 $NETCMD conf getincludes
> $DIR/getincludes_usage_exp
738 log_print
$NETCMD conf getincludes
740 grep "$RPC *conf getincludes" $DIR/getincludes_usage_exp
>/dev
/null
2>>$LOG
741 if [ "$?" = "1" ]; then
742 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
747 test_conf_delincludes
()
749 echo '\nTesting conf delincludes' >> $LOG
750 echo ------------------------- >> $LOG
752 $NETCMD conf delincludes tmp_share
753 log_print
$NETCMD conf delincludes tmp_share
754 test "x$?" = "x0" ||
{
755 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
759 $NETCMD conf list
> $DIR/delincludes_list_out
760 log_print
$NETCMD conf list
761 test "x$?" = "x0" ||
{
762 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
766 grep "include" $DIR/delincludes_list_out
>/dev
/null
2>>$LOG
767 if [ "$?" = "0" ]; then
768 echo "ERROR: delincludes did not delete correctly" |
tee -a $LOG
773 test_conf_delincludes_empty
()
775 $NETCMD conf delincludes tmp_share
776 log_print
$NETCMD conf delincludes tmp_share
777 test "x$?" = "x0" ||
{
778 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
782 $NETCMD conf delincludes fictional_share
783 log_print
$NETCMD conf delincludes fictional_share
784 test "x$?" = "x255" ||
{
785 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
791 test_conf_delincludes_usage
()
793 echo '\nChecking usage' >>$LOG
794 $NETCMD conf delincludes
> $DIR/delincludes_usage_exp
795 log_print
$NETCMD conf delincludes
796 test "x$?" = "x255" ||
{
797 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
801 grep "$RPC *conf delincludes" $DIR/delincludes_usage_exp
>/dev
/null
2>>$LOG
802 if [ "$?" = "1" ]; then
803 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
810 echo '\nTesting conf import' >> $LOG
811 echo ------------------------- >> $LOG
812 echo '\nDropping existing configuration' >> $LOG
815 log_print
$NETCMD conf drop
816 test "x$?" = "x0" ||
{
817 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
821 $NETCMD conf import
$DIR/conf_import_in
822 log_print
$NETCMD conf drop
823 test "x$?" = "x0" ||
{
824 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
828 $NETCMD conf list
> $DIR/conf_import_out
829 log_print
$NETCMD conf list
830 test "x$?" = "x0" ||
{
831 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
835 diff -q $DIR/conf_import_in
$DIR/conf_import_out
>> $LOG
836 if [ "$?" = "1" ]; then
837 echo "ERROR: import failed" |
tee -a $LOG
842 test_conf_import_usage
()
844 echo '\nChecking usage' >>$LOG
845 $NETCMD conf import
> $DIR/import_usage_exp
846 log_print
$NETCMD conf import
847 test "x$?" = "x255" ||
{
848 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
852 grep "$RPC *conf import" $DIR/import_usage_exp
>/dev
/null
2>>$LOG
853 if [ "$?" = "1" ]; then
854 echo "ERROR: conf import no/wrong usage message printed" |
tee -a $LOG
859 CONF_FILES
=$SERVERCONFFILE
863 || failed
=`expr $failed + 1`
865 testit
"conf_drop_empty" \
866 test_conf_drop_empty \
867 || failed
=`expr $failed + 1`
869 testit
"conf_drop_usage" \
870 test_conf_drop_usage \
871 || failed
=`expr $failed + 1`
873 testit
"conf_addshare" \
875 || failed
=`expr $failed + 1`
877 testit
"conf_addshare_existing" \
878 test_conf_addshare_existing \
879 || failed
=`expr $failed + 1`
881 testit
"conf_addshare_usage" \
882 test_conf_addshare_usage \
883 || failed
=`expr $failed + 1`
885 testit
"conf_delshare" \
887 || failed
=`expr $failed + 1`
889 testit
"conf_delshare_empty" \
890 test_conf_delshare_empty \
891 || failed
=`expr $failed + 1`
893 testit
"conf_delshare_usage" \
894 test_conf_delshare_usage \
895 || failed
=`expr $failed + 1`
897 testit
"conf_setparm" \
899 || failed
=`expr $failed + 1`
901 testit
"conf_setparm_existing" \
902 test_conf_setparm_existing \
903 || failed
=`expr $failed + 1`
905 testit
"conf_setparm_usage" \
906 test_conf_setparm_usage \
907 || failed
=`expr $failed + 1`
909 testit
"conf_delparm_delete_existing" \
910 test_conf_delparm_delete_existing \
911 || failed
=`expr $failed + 1`
913 testit
"conf_delparm_delete_non_existing" \
914 test_conf_delparm_delete_non_existing \
915 || failed
=`expr $failed + 1`
917 testit
"conf_delparm_delete_usage" \
918 test_conf_delparm_usage \
919 || failed
=`expr $failed + 1`
921 testit
"conf_getparm" \
923 || failed
=`expr $failed + 1`
925 testit
"conf_getparm_usage" \
926 test_conf_getparm_usage \
927 || failed
=`expr $failed + 1`
929 testit
"conf_setincludes" \
930 test_conf_setincludes \
931 || failed
=`expr $failed + 1`
933 testit
"conf_setincludes_usage" \
934 test_conf_setincludes_usage \
935 || failed
=`expr $failed + 1`
937 testit
"conf_getincludes" \
938 test_conf_getincludes \
939 || failed
=`expr $failed + 1`
941 testit
"conf_getincludes_usage" \
942 test_conf_getincludes_usage \
943 || failed
=`expr $failed + 1`
945 testit
"conf_delincludes" \
946 test_conf_delincludes \
947 || failed
=`expr $failed + 1`
949 testit
"conf_delincludes_empty" \
950 test_conf_delincludes_usage \
951 || failed
=`expr $failed + 1`
953 testit
"conf_delincludes_usage" \
954 test_conf_delincludes_empty \
955 || failed
=`expr $failed + 1`
957 testit
"conf_import" \
959 || failed
=`expr $failed + 1`
961 testit
"conf_import_usage" \
962 test_conf_import_usage \
963 || failed
=`expr $failed + 1`
965 if [ $failed -eq 0 ]; then