Index: ossp-pkg/rc/00TODO RCS File: /v/ossp/cvs/ossp-pkg/rc/00TODO,v rcsdiff -q -kk '-r1.18' '-r1.19' -u '/v/ossp/cvs/ossp-pkg/rc/00TODO,v' 2>/dev/null --- 00TODO 2002/02/05 20:37:34 1.18 +++ 00TODO 2002/02/07 15:36:26 1.19 @@ -2,6 +2,7 @@ Unfinished business Manpage options incorrectly specifies multiple rc.funcs. + Manpage reorganization lacks important option combination info. What when multiple command interpreters and one --print or --eval given? File rc.func totally undocumented, but logic should be clear. Control flow @@ -16,7 +17,6 @@ Removing the OSSP_RC_DEACT deactivation feature (thl.) Offer include directive in config file. Dynamic handling of command interpreter option. - Environment of manpage has redundant text. Interpreter option irgendwo dass hat global scope. Als variable in %config Section? @@ -152,3 +152,29 @@ while (ref := ParseSectionRef(script)) ref->create_rcfile_script(recurse=yes); } + +Test cases + ********************* + * Test cases for rc * + ********************* + +Pre: +tar zxvf ossprc-0.9.tar.gz +cd ossprc-0.9 +./configure +make +su +make install +export OSSP_RC_ROOT=/etc/ossprc/ + +Assume: +Installed program 'mycom' in /usr/local/bin/mycom +Valid OSSP run command file rc.mycom in /etc/ossprc/rc.d +File rc.mycom contains the sections start, sync, and restart + +Begin: +$ rc mycom start sync restart + +Output: +Post: +Procedure: Index: ossp-pkg/rc/rc_test.sh RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_test.sh,v rcsdiff -q -kk '-r1.4' '-r1.5' -u '/v/ossp/cvs/ossp-pkg/rc/rc_test.sh,v' 2>/dev/null --- rc_test.sh 2002/02/04 22:35:20 1.4 +++ rc_test.sh 2002/02/07 15:36:26 1.5 @@ -27,26 +27,55 @@ # # test_rc.sh: Run-command processor test script -#Pre: -#tar zxvf ossprc-0.9.tar.gz -#cd ossprc-0.9 -#./configure -#make -#su -#make install -#export OSSP_RC_ROOT=/etc/ossprc/ -# -#Assume: -#Installed program 'mycom' in /usr/local/bin/mycom -#Valid OSSP run command file rc.mycom in /etc/ossprc/rc.d -#File rc.mycom contains the sections start, sync, and restart -# -#Begin: -#$ rc mycom start sync restart -# -#Output: -# -#Post: -# -#Procedure: -# +# Test short options, should fail for false combination usage +./rc -dVehilpsrvxLcfqt samba start sleep=2 restart +echo + +# Test short options, should succeed +./rc -derv -L /sfw/etc/rc.d/rc.%{RCFILE:s/^all$/*/} -c /sfw/etc/rc.conf -f /sfw/etc/rc.func -t /tmp openssh stop sleep=4 start daily minsize=2097152 +echo + +# Test some long options, should fail for false combination usage +./rc --verbose --silent uucp stop sleep=6 start +echo +./rc --query --silent zebra bing bang +echo +./rc --conf /sfw/rc.conf --locate /sfw/etc/rc.d --query what to enter here +echo + +# Test minimal set of long options, should succeed +./rc --debug --version rsyncd nothing matters but the version +echo + +# FIXME these cases are not handled yet by our configuration FIXME # +#./rc --debug --version +#echo +#./rc --debug --help +#echo +#./rc --debug --info --verbose +#echo +#./rc --conf /etc/rc.conf --debug --info --raw +#echo +#./rc --conf /sfw/rc.conf --tmp /sfw/RPM/TMP --debug --labels rsyncd +#echo +# FIXME these cases are not handled yet by our configuration FIXME # + +./rc --func /sfw/etc/rc.func --print --verbose openssh stop sleep=4 start +echo +./rc --func /sfw/etc/rc.func --debug --eval uucp restart +echo +./rc --conf ./myrc --func /sfw/etc/rc.func --tmp /tmp --debug --silent --exec uucp start + +# Next milestone +#RequireOwner +#RequireGroup +#RequireUmask +#ParseEnvAss +#ParseSectionDef +#ParseSectionRef +#ParseSectionParam +#ParseTerminal +#NameConfig +#NameCommon +#NameDefault +#NameError