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
48 echo "RC: $RC" >> $LOG
55 echo '\nTesting conf addshare' >> $LOG
56 echo ------------------------- >> $LOG
57 echo '\nDropping existing configuration' >> $LOG
60 log_print
$NETCMD conf drop
61 test "x$?" = "x0" ||
{
62 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
66 #create a lot of shares
67 for i
in $
(seq 1 100); do
68 if [ $
(($i % 2)) -eq 0 ]; then
69 $NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
70 "test comment" >>$DIR/addshare_exp \
72 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
75 $NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
76 "test comment" >>$DIR/addshare_exp \
78 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=n" "guest_ok=y" \
81 test "x$?" = "x0" ||
{
82 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
87 $NETCMD conf listshares
> $DIR/listshares_out
88 log_print
$NETCMD conf listshares
89 test "x$?" = "x0" ||
{
90 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
94 for i
in $
(seq 1 100); do
95 grep "share$i" $DIR/listshares_out
>/dev
/null
2>>$LOG
96 if [ "$?" = "1" ]; then
97 echo "ERROR: share not found" |
tee -a $LOG
102 #check the integrity of the shares
103 #if it fails, it can also point to an error in showshare
104 for i
in $
(seq 1 100); do
105 $NETCMD conf showshare share
$i > $DIR/showshare_out
106 test "x$?" = "x0" ||
{
107 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
111 grep "path" $DIR/showshare_out
>/dev
/null
2>>$LOG
112 if [ "$?" = "1" ]; then
113 echo "ERROR: share not found" |
tee -a $LOG
117 if [ $
(($i % 2)) -eq 0 ]; then
118 grep "read only *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
119 if [ "$?" = "1" ]; then
120 echo "ERROR: share not set correctly" |
tee -a $LOG
124 grep "read only *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
125 if [ "$?" = "1" ]; then
126 echo "ERROR: share not set correctly" |
tee -a $LOG
131 if [ $
(($i % 2)) -eq 0 ]; then
132 grep "guest ok *= *no" $DIR/showshare_out
>/dev
/null
2>>$LOG
133 if [ "$?" = "1" ]; then
134 echo "ERROR: share not set correctly" |
tee -a $LOG
138 grep "guest ok *= *yes" $DIR/showshare_out
>/dev
/null
2>>$LOG
139 if [ "$?" = "1" ]; then
140 echo "ERROR: share not set correctly" |
tee -a $LOG
145 grep "comment *= *test comment" $DIR/showshare_out
>/dev
/null
2>>$LOG
146 if [ "$?" = "1" ]; then
147 echo "ERROR: share not set correctly" |
tee -a $LOG
152 echo '\nTaking a conf snapshot for later use' >> $LOG
153 $NETCMD conf list
> $DIR/conf_import_in
154 log_print
$NETCMD conf list
155 test "x$?" = "x0" ||
{
156 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
161 test_conf_addshare_existing
()
163 #try adding an already existing share
164 echo '\nAdding an already existing share' >>$LOG
165 $NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
166 "test comment" >>$DIR/addshare_exp \
168 log_print
$NETCMD conf addshare share1
/tmp
"writeable=n" "guest_ok=y" \
170 test "x$?" = "x255" ||
{
171 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
175 test -z `cat $DIR/addshare_exp` && {
176 echo "ERROR: addshare output does not match" >> $LOG
183 test_conf_addshare_usage
()
185 #check to see if command prints usage
186 echo '\nChecking usage' >>$LOG
187 $NETCMD conf addshare
> $DIR/addshare_usage_exp
188 log_print
$NETCMD conf addshare
189 test "x$?" = "x255" ||
{
190 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
194 grep "$RPC *conf addshare" $DIR/addshare_usage_exp
>/dev
/null
2>>$LOG
195 if [ "$?" = "1" ]; then
196 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
203 echo '\nTesting conf delshare' >>$LOG
204 echo ------------------------- >> $LOG
207 $NETCMD conf delshare share1
208 log_print
$NETCMD conf delshare share1
209 test "x$?" = "x0" ||
{
210 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
214 $NETCMD conf listshares
> $DIR/listshares_out
215 log_print
$NETCMD conf listshares
216 test "x$?" = "x0" ||
{
217 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
221 grep "share1$" $DIR/listshares_out
>/dev
/null
2>>$LOG
222 if [ "$?" = "0" ]; then
223 echo "ERROR: delshare did not delete 'share1'" |
tee -a $LOG
228 test_conf_delshare_empty
()
230 echo '\nAttempting to delete non_existing share'
231 $NETCMD conf delshare share1
232 log_print
$NETCMD conf delshare share1
233 test "x$?" = "x255" ||
{
234 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
240 test_conf_delshare_usage
()
242 echo '\nChecking usage' >>$LOG
243 $NETCMD conf delshare
> $DIR/delshare_usage_exp
244 log_print
$NETCMD conf delshare
245 test "x$?" = "x255" ||
{
246 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
250 grep "$RPC *conf delshare" $DIR/delshare_usage_exp
>/dev
/null
2>>$LOG
251 if [ "$?" = "1" ]; then
252 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
260 echo '\nTesting conf drop' >> $LOG
261 echo ------------------------- >> $LOG
262 echo '\nDropping existing configuration' >> $LOG
265 log_print
$NETCMD conf drop
266 test "x$?" = "x0" ||
{
267 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
271 #check to see if listing the configuration yields a blank file
272 $NETCMD conf list
1>>$DIR/list_out
273 log_print
$NETCMD conf list
274 test "x$?" = "x0" ||
{
275 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
279 test -z "`cat $DIR/list_out`" ||
{
280 echo "ERROR: Expected list output did not match" |
tee -a $LOG
285 test_conf_drop_empty
()
287 #Drop an empty config, see if conf drop fails
288 echo '\nAttempting to drop an empty configuration' >>$LOG
291 log_print
$NETCMD conf drop
292 test "x$?" = "x0" ||
{
293 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
297 #check to see if listing the configuration yields a blank file
298 $NETCMD conf list
1>>$DIR/list_out
299 log_print
$NETCMD conf list
300 test "x$?" = "x0" ||
{
301 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
305 test -z "`cat $DIR/list_out`" ||
{
306 echo ERROR
:Expected list output did not match
>> $LOG
311 test_conf_drop_usage
()
313 #check to see if command prints usage
314 echo '\nChecking usage' >>$LOG
315 $NETCMD conf drop extra_arg
> $DIR/drop_usage_exp
316 log_print
$NETCMD conf drop extra_arg
317 test "x$?" = "x255" ||
{
318 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
322 grep "$RPC *conf drop" $DIR/drop_usage_exp
>/dev
/null
2>>$LOG
323 if [ "$?" = "1" ]; then
324 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
331 echo '\nTesting conf setparm' >> $LOG
332 echo ------------------------- >> $LOG
334 echo '\nDropping existing configuration' >> $LOG
336 log_print
$NETCMD conf drop
337 test "x$?" = "x0" ||
{
338 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
342 $NETCMD conf setparm share1
"read only" yes
343 log_print
$NETCMD conf setparm share1
"read only" yes
344 test "x$?" = "x0" ||
{
345 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
349 $NETCMD conf setparm share1
"path" /tmp
/test_path
350 log_print
$NETCMD conf setparm share1
"path" /tmp
/test_path
351 test "x$?" = "x0" ||
{
352 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
356 $NETCMD conf showshare share1
> $DIR/setparm_showshare_out
357 test "x$?" = "x0" ||
{
358 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
362 grep "read only *= *yes" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
363 if [ "$?" = "1" ]; then
364 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
368 grep "path *= */tmp/test_path" $DIR/setparm_showshare_out
>/dev
/null
2>>$LOG
369 if [ "$?" = "1" ]; then
370 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
375 test_conf_setparm_existing
()
378 echo '\nSetting already existing param with the same value'
379 $NETCMD conf setparm share1
"read only" yes
380 log_print
$NETCMD conf setparm share1
"read only" yes
381 test "x$?" = "x0" ||
{
382 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
386 $NETCMD conf setparm share1
"read only" yes
387 log_print
$NETCMD conf setparm share1
"read only" yes
388 test "x$?" = "x0" ||
{
389 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
393 $NETCMD conf showshare share1
> $DIR/setparm_existing_showshare_out
394 test "x$?" = "x0" ||
{
395 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
399 grep "read only *= *yes" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
400 if [ "$?" = "1" ]; then
401 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
405 $NETCMD conf setparm share1
"read only" no
406 log_print
$NETCMD conf setparm share1
"read only" no
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 *= *no" $DIR/setparm_existing_showshare_out
>/dev
/null
2>>$LOG
419 if [ "$?" = "1" ]; then
420 echo "ERROR: setparm did not set correctly" |
tee -a $LOG
425 test_conf_setparm_usage
()
427 echo '\nChecking usage' >>$LOG
428 $NETCMD conf setparm
> $DIR/setparm_usage_exp
429 log_print
$NETCMD conf setparm
430 test "x$?" = "x255" ||
{
431 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
435 grep "$RPC *conf setparm" $DIR/setparm_usage_exp
>/dev
/null
2>>$LOG
436 if [ "$?" = "1" ]; then
437 echo "ERROR: setparm no/wrong usage message printed" |
tee -a $LOG
442 test_conf_delparm_delete_existing
()
444 echo '\nTesting conf delparm' >> $LOG
445 echo ------------------------- >> $LOG
449 log_print
$NETCMD conf drop
450 test "x$?" = "x0" ||
{
451 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
455 $NETCMD conf addshare share1
/tmp
"writeable=y" "guest_ok=n" \
457 log_print
$NETCMD conf addshare share
$i /tmp
"writeable=y" "guest_ok=n" \
460 $NETCMD conf delparm share1
"path"
461 log_print
$NETCMD conf delparm share1
"path"
462 test "x$?" = "x0" ||
{
463 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
467 $NETCMD conf showshare share1
> $DIR/delparm_showshare_out
468 test "x$?" = "x0" ||
{
469 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
473 #test to see what delparm did delete and how
474 grep "read only *= *no" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
475 if [ "$?" = "1" ]; then
476 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
480 grep "path *= */tmp" $DIR/delparm_showshare_out
>/dev
/null
2>>$LOG
481 if [ "$?" = "0" ]; then
482 echo "ERROR: delparm did not delete correctly" |
tee -a $LOG
487 test_conf_delparm_delete_non_existing
()
489 echo '\nDelete non existing share' >> $LOG
492 log_print
$NETCMD conf drop
493 test "x$?" = "x0" ||
{
494 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
498 $NETCMD conf delparm share1
"path"
499 log_print
$NETCMD conf delparm share1
"path"
500 test "x$?" = "x255" ||
{
501 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
506 test_conf_delparm_usage
()
509 echo '\nChecking usage' >>$LOG
510 $NETCMD conf delparm
> $DIR/delparm_usage_exp
511 log_print
$NETCMD conf delparm
512 test "x$?" = "x255" ||
{
513 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
517 grep "$RPC *conf delparm" $DIR/delparm_usage_exp
>/dev
/null
2>>$LOG
518 if [ "$?" = "1" ]; then
519 echo "ERROR: delparm no/wrong usage message printed" |
tee -a $LOG
528 echo '\nTesting conf getparm' >> $LOG
529 echo ------------------------- >> $LOG
533 log_print
$NETCMD conf drop
534 test "x$?" = "x0" ||
{
538 $NETCMD conf addshare share1
/tmp
/path_test
"writeable=n" "guest_ok=n" \
540 log_print
$NETCMD conf addshare share
$i /tmp
/path_test
"writeable=n" "guest_ok=n" \
542 test "x$?" = "x0" ||
{
543 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
547 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
548 log_print
$NETCMD conf getparm share1
"read only"
549 test "x$?" = "x0" ||
{
550 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
554 $NETCMD conf getparm share1
"read only" >$DIR/getparm_out
555 log_print
$NETCMD conf getparm share1
"read only"
556 test "x$?" = "x0" ||
{
557 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
561 echo yes >$DIR/getparm_exp
562 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
563 if [ "$?" = "1" ]; then
564 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
568 $NETCMD conf getparm share1
"path" >$DIR/getparm_out
569 log_print
$NETCMD conf getparm share1
"path"
570 test "x$?" = "x0" ||
{
571 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
575 echo /tmp
/path_test
>$DIR/getparm_exp
576 diff -q $DIR/getparm_out
$DIR/getparm_exp
>> $LOG
577 if [ "$?" = "1" ]; then
578 echo "ERROR: getparm did not print correctly" |
tee -a $LOG
583 test_conf_getparm_usage
()
585 echo '\nChecking usage' >>$LOG
586 $NETCMD conf getparm
> $DIR/getparm_usage_exp
587 log_print
$NETCMD conf getparm
588 test "x$?" = "x255" ||
{
589 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
593 grep "$RPC *conf getparm" $DIR/getparm_usage_exp
>/dev
/null
2>>$LOG
594 if [ "$?" = "1" ]; then
595 echo "ERROR: getparm no/wrong usage message printed" |
tee -a $LOG
601 test_conf_getparm_non_existing
()
603 echo '\nTesting getparm non existing' >>$LOG
604 $NETCMD conf getparm fictional_share fictional_param
605 log_print
$NETCMD conf getparm fictional_share fictional_param
606 test "x$?" = "x255" ||
{
607 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
611 $NETCMD conf getparm share1 fictional_param
612 log_print
$NETCMD conf getparm share1 fictional_param
613 test "x$?" = "x255" ||
{
614 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
619 test_conf_setincludes
()
621 echo '\nTesting conf setincludes' >> $LOG
622 echo ------------------------- >> $LOG
623 echo '\nDropping existing configuration' >> $LOG
626 log_print
$NETCMD conf drop
627 test "x$?" = "x0" ||
{
628 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
632 $NETCMD conf addshare tmp_share
/tmp
633 log_print
$NETCMD conf addshare tmp_share
/tmp
634 test "x$?" = "x0" ||
{
635 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
639 $NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
640 log_print
$NETCMD conf setincludes tmp_share
/tmp
/include1
/tmp
/include2
/tmp
/include3
641 test "x$?" = "x0" ||
{
642 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
646 $NETCMD conf list
> $DIR/setincludes_list_out
647 log_print
$NETCMD conf list
648 test "x$?" = "x0" ||
{
649 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
653 grep "include *= */tmp/include1$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
654 if [ "$?" = "1" ]; then
655 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
659 grep "include *= */tmp/include2$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
660 if [ "$?" = "1" ]; then
661 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
665 grep "include *= */tmp/include3$" $DIR/setincludes_list_out
>/dev
/null
2>>$LOG
666 if [ "$?" = "1" ]; then
667 echo "ERROR: setincludes did not set correctly" |
tee -a $LOG
673 test_conf_setincludes_usage
()
675 echo '\nChecking usage' >>$LOG
676 $NETCMD conf setincludes
> $DIR/setincludes_usage_exp
677 log_print
$NETCMD conf setincludes
678 test "x$?" = "x255" ||
{
679 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
683 grep "$RPC *conf setincludes" $DIR/setincludes_usage_exp
>/dev
/null
2>>$LOG
684 if [ "$?" = "1" ]; then
685 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
690 test_conf_getincludes
()
692 $NETCMD conf getincludes tmp_share
> $DIR/getincludes_out
693 log_print
$NETCMD conf getincludes tmp_share
694 test "x$?" = "x0" ||
{
695 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
699 grep "include *= */tmp/include1$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
700 if [ "$?" = "1" ]; then
701 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
705 grep "include *= */tmp/include2$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
706 if [ "$?" = "1" ]; then
707 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
710 grep "include *= */tmp/include3$" $DIR/getincludes_out
>/dev
/null
2>>$LOG
711 if [ "$?" = "1" ]; then
712 echo "ERROR: getincludes did not print correctly" |
tee -a $LOG
717 test_conf_getincludes_usage
()
719 $NETCMD conf getincludes
> $DIR/getincludes_usage_exp
720 log_print
$NETCMD conf getincludes
722 grep "$RPC *conf getincludes" $DIR/getincludes_usage_exp
>/dev
/null
2>>$LOG
723 if [ "$?" = "1" ]; then
724 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
729 test_conf_delincludes
()
731 echo '\nTesting conf delincludes' >> $LOG
732 echo ------------------------- >> $LOG
734 $NETCMD conf delincludes tmp_share
735 log_print
$NETCMD conf delincludes tmp_share
736 test "x$?" = "x0" ||
{
737 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
741 $NETCMD conf list
> $DIR/delincludes_list_out
742 log_print
$NETCMD conf list
743 test "x$?" = "x0" ||
{
744 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
748 grep "include" $DIR/delincludes_list_out
>/dev
/null
2>>$LOG
749 if [ "$?" = "0" ]; then
750 echo "ERROR: delincludes did not delete correctly" |
tee -a $LOG
755 test_conf_delincludes_empty
()
757 $NETCMD conf delincludes tmp_share
758 log_print
$NETCMD conf delincludes tmp_share
759 test "x$?" = "x0" ||
{
760 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
764 $NETCMD conf delincludes fictional_share
765 log_print
$NETCMD conf delincludes fictional_share
766 test "x$?" = "x255" ||
{
767 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
773 test_conf_delincludes_usage
()
775 echo '\nChecking usage' >>$LOG
776 $NETCMD conf delincludes
> $DIR/delincludes_usage_exp
777 log_print
$NETCMD conf delincludes
778 test "x$?" = "x255" ||
{
779 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
783 grep "$RPC *conf delincludes" $DIR/delincludes_usage_exp
>/dev
/null
2>>$LOG
784 if [ "$?" = "1" ]; then
785 echo "ERROR: no/wrong usage message printed" |
tee -a $LOG
792 echo '\nTesting conf import' >> $LOG
793 echo ------------------------- >> $LOG
794 echo '\nDropping existing configuration' >> $LOG
797 log_print
$NETCMD conf drop
798 test "x$?" = "x0" ||
{
799 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
803 $NETCMD conf import
$DIR/conf_import_in
804 log_print
$NETCMD conf drop
805 test "x$?" = "x0" ||
{
806 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
810 $NETCMD conf list
> $DIR/conf_import_out
811 log_print
$NETCMD conf list
812 test "x$?" = "x0" ||
{
813 echo 'ERROR: RC does not match, expected: 0' |
tee -a $LOG
817 diff -q $DIR/conf_import_in
$DIR/conf_import_out
>> $LOG
818 if [ "$?" = "1" ]; then
819 echo "ERROR: import failed" |
tee -a $LOG
824 test_conf_import_usage
()
826 echo '\nChecking usage' >>$LOG
827 $NETCMD conf import
> $DIR/import_usage_exp
828 log_print
$NETCMD conf import
829 test "x$?" = "x255" ||
{
830 echo 'ERROR: RC does not match, expected: 255' |
tee -a $LOG
834 grep "$RPC *conf import" $DIR/import_usage_exp
>/dev
/null
2>>$LOG
835 if [ "$?" = "1" ]; then
836 echo "ERROR: conf import no/wrong usage message printed" |
tee -a $LOG
841 CONF_FILES
=$SERVERCONFFILE
845 || failed
=`expr $failed + 1`
847 testit
"conf_drop_empty" \
848 test_conf_drop_empty \
849 || failed
=`expr $failed + 1`
851 testit
"conf_drop_usage" \
852 test_conf_drop_usage \
853 || failed
=`expr $failed + 1`
855 testit
"conf_addshare" \
857 || failed
=`expr $failed + 1`
859 testit
"conf_addshare_existing" \
860 test_conf_addshare_existing \
861 || failed
=`expr $failed + 1`
863 testit
"conf_addshare_usage" \
864 test_conf_addshare_usage \
865 || failed
=`expr $failed + 1`
867 testit
"conf_delshare" \
869 || failed
=`expr $failed + 1`
871 testit
"conf_delshare_empty" \
872 test_conf_delshare_empty \
873 || failed
=`expr $failed + 1`
875 testit
"conf_delshare_usage" \
876 test_conf_delshare_usage \
877 || failed
=`expr $failed + 1`
879 testit
"conf_setparm" \
881 || failed
=`expr $failed + 1`
883 testit
"conf_setparm_existing" \
884 test_conf_setparm_existing \
885 || failed
=`expr $failed + 1`
887 testit
"conf_setparm_usage" \
888 test_conf_setparm_usage \
889 || failed
=`expr $failed + 1`
891 testit
"conf_delparm_delete_existing" \
892 test_conf_delparm_delete_existing \
893 || failed
=`expr $failed + 1`
895 testit
"conf_delparm_delete_non_existing" \
896 test_conf_delparm_delete_non_existing \
897 || failed
=`expr $failed + 1`
899 testit
"conf_delparm_delete_usage" \
900 test_conf_delparm_usage \
901 || failed
=`expr $failed + 1`
903 testit
"conf_getparm" \
905 || failed
=`expr $failed + 1`
907 testit
"conf_getparm_usage" \
908 test_conf_getparm_usage \
909 || failed
=`expr $failed + 1`
911 testit
"conf_setincludes" \
912 test_conf_setincludes \
913 || failed
=`expr $failed + 1`
915 testit
"conf_setincludes_usage" \
916 test_conf_setincludes_usage \
917 || failed
=`expr $failed + 1`
919 testit
"conf_getincludes" \
920 test_conf_getincludes \
921 || failed
=`expr $failed + 1`
923 testit
"conf_getincludes_usage" \
924 test_conf_getincludes_usage \
925 || failed
=`expr $failed + 1`
927 testit
"conf_delincludes" \
928 test_conf_delincludes \
929 || failed
=`expr $failed + 1`
931 testit
"conf_delincludes_empty" \
932 test_conf_delincludes_usage \
933 || failed
=`expr $failed + 1`
935 testit
"conf_delincludes_usage" \
936 test_conf_delincludes_empty \
937 || failed
=`expr $failed + 1`
939 testit
"conf_import" \
941 || failed
=`expr $failed + 1`
943 testit
"conf_import_usage" \
944 test_conf_import_usage \
945 || failed
=`expr $failed + 1`
947 if [ $failed -eq 0 ]; then