Index: ossp-pkg/rc/rc_test.sh RCS File: /v/ossp/cvs/ossp-pkg/rc/rc_test.sh,v rcsdiff -q -kk '-r1.22' '-r1.23' -u '/v/ossp/cvs/ossp-pkg/rc/rc_test.sh,v' 2>/dev/null --- rc_test.sh 2003/04/03 12:05:14 1.22 +++ rc_test.sh 2003/06/03 15:27:32 1.23 @@ -29,39 +29,75 @@ if [ -d $MOPKG/etc ]; then RCBASE=$MOPKG/etc -else +elif [ -d /sw/etc ]; then + RCBASE=/sw/etc +elif [ -d /cw/etc ]; then + RCBASE=/cw/etc +elif [ -d /usr/opkg/etc ]; then RCBASE=/usr/opkg/etc fi -# Test short options, should fail for false combination usage -#echo "./rc -dvef ./rc_test/rcfuncs -hilpsrvxLcqt samba start sleep=2 restart" -#./rc -dVef ./rc_test/rcfuncs -hilpsrvxLcqt samba start sleep=2 restart - -# Test short options, should succeed -#echo; echo "./rc -derv -L ./rc_test/rc.%{RCFILE:s/^all$/*/} -c ./rc.conf -f ./rc_test/rcfuncs -t /tmp openssh stop sleep=4 start daily minsize=2097152" -#./rc -derv -L ./rc_test/rc.d/rc.%{RCFILE:s/^all$/*/} -c ./rc.conf -f ./rc_test/rcfuncs -t /tmp openssh stop sleep=4 start daily minsize=2097152 - -# Test some long options, should fail for false combination usage -#clear -echo; echo "./rc --verbose --silent --print --NameConfig config --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" uucp stop sleep=6 start" -./rc --verbose --silent --print --NameConfig config --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" uucp stop sleep=6 start -#read dummy;clear -echo; echo "./rc --query myvar --silent --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" zebra bing bang" -./rc --query myvar --silent --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" zebra bing bang -#read dummy;clear -echo; echo "./rc --conf ./rc.conf --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --locate ./rc_test/ --query this barf test" -./rc --conf ./rc.conf --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --locate ./rc_test/ --query this barf test -#read dummy;clear - -# Test minimal set of long options, should succeed -echo; echo "./rc --debug --version --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" rsyncd nothing matters but the version" -./rc --debug --version --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" rsyncd nothing matters but the version -#read dummy;clear -echo; echo "./rc --conf $RCBASE/rc.conf --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --locate $RCBASE/rc.d:./rc_test:/etc/rc --query all barf test" +echo "*** Test short options, should fail for false combination usage ***" +echo "./rc -Dvexpf ./rc_test/rcfuncs -islrvc rc.conf -q somevalue -t /tmp -L rc_test samba search" +./rc -Dvexpf ./rc_test/rcfuncs -ilrvc rc.conf -q somevalue -t /tmp -L rc_test samba search +echo; echo "" +read dummy;clear + +echo "*** Test short options, should succeed ***" +echo "./rc -Dpf ./rc_test/rcfuncs -irvt /tmp -L rc_test -c rc.conf samba search finish" +./rc -Dpf ./rc_test/rcfuncs -irvt /tmp -L rc_test -c rc.conf samba search finish +echo; echo "" +read dummy;clear +#echo "./rc -Derv -L ./rc_test/rc.%{RCFILE:s/^all$/*/} -c ./rc.conf -f ./rc_test/rcfuncs -t /tmp openssh stop sleep=4 start daily minsize=2097152" +#./rc -Derv -L ./rc_test/rc.d/rc.%{RCFILE:s/^all$/*/} -c ./rc.conf -f ./rc_test/rcfuncs -t /tmp openssh stop sleep=4 start daily minsize=2097152 +#echo; echo "" +#read dummy;clear + +echo "*** Test some long options, should fail for false combination usage ***" +echo "./rc --verbose --silent --print --NameConfig config --locate rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" zebra sleep=6 start test" +./rc --verbose --silent --print --NameConfig config --locate rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" zebra sleep=6 start test +echo; echo "" +read dummy;clear +echo "*** Test some long options, should fail for false combination usage ***" +echo "./rc --query myvar --print --exec --locate rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" zebra start test" +./rc --query myvar --print --exec --locate rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" zebra start test +echo; echo "" +read dummy;clear +echo "*** Test some long options, should fail for false combination usage ***" +echo "./rc --info --print --eval --silent --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --query format --locate ./rc_test/ pam test" +./rc --info --print --eval --silent --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --query format --locate ./rc_test/ pam test +echo; echo "" +read dummy;clear + +echo "*** Test minimal set of long options, should succeed ***" +echo "./rc --locate rc_test --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" rsyncd go" +./rc --locate rc_test --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" rsyncd go +echo; echo "" +read dummy;clear +echo "*** Test minimal set of long options, should succeed ***" +echo "./rc --version --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" rsyncd nothing matters but the version" +./rc --version --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" rsyncd nothing matters but the version +echo; echo "" +read dummy;clear +echo "*** Test minimal set of long options, should succeed ***" +echo "./rc --exec --conf $RCBASE/rc.conf --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --locate $RCBASE/rc.d:./rc_test:/etc/rc --query format all barf test" +./rc --exec --conf rc.conf --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --locate rc_test --query format all barf test +echo; echo "" +read dummy;clear + +# Some examples using fake rc files and REAL ONES AS WELL, use with care! +echo "The following test will execute test suite code," +echo "and code ALSO FROM YOUR REAL OPENPKG RC FILES!!!" +echo "If this concerns you, then press Ctrl-C now to exit." +echo; echo "" +read dummy;clear +echo "./rc --conf $RCBASE/rc.conf --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --locate $RCBASE/rc.d:./rc_test:/etc/rc --query all barf test" ./rc --conf $RCBASE/rc.conf --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --locate $RCBASE/rc.d:./rc_test:/etc/rc --query all barf test +echo; echo "" #read dummy;clear # FIXME these cases are not handled yet by our configuration FIXME # +exit #echo; echo "./rc --debug --version" #./rc --debug --version #echo; echo "./rc --debug --help" @@ -74,70 +110,70 @@ #./rc --conf $RCBASE/rc.conf --tmp /tmp --debug --labels rsyncd # FIXME these cases are not handled yet by our configuration FIXME # -echo; echo "./rc --func rc_test/rcfuncs --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --verbose openssh stop sleep=4 start" -./rc --func rc_test/rcfuncs --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --verbose openssh stop sleep=4 start +#echo; echo "./rc --func rc_test/rcfuncs --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --verbose openssh stop sleep=4 start" +#./rc --func rc_test/rcfuncs --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --verbose openssh stop sleep=4 start #read dummy;clear -echo; echo "./rc --func ./rc_test/rcfuncs --info --eval uucp restart" -./rc --func ./rc_test/rcfuncs --info --eval uucp restart +#echo; echo "./rc --func ./rc_test/rcfuncs --info --eval uucp restart" +#./rc --func ./rc_test/rcfuncs --info --eval uucp restart #read dummy;clear -echo; echo "./rc --conf rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" uucp start" -./rc --conf rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" uucp start +#echo; echo "./rc --conf rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" uucp start" +#./rc --conf rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" uucp start #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" ntp sync" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" ntp sync +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" ntp sync" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" ntp sync #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --silent --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" ralf feed suppe" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --silent --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" ralf feed suppe +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --silent --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" ralf feed suppe" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs --tmp /tmp --debug --silent --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" ralf feed suppe #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent samba search finish destroy" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent samba search finish destroy +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent samba search finish destroy" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent samba search finish destroy #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent all feed suppe" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent all feed suppe +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent all feed suppe" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent all feed suppe #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug all config barf gag" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug all config barf gag +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug all config barf gag" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug all config barf gag #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug --eval all config start" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug --eval all config start +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug --eval all config start" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug --eval all config start #read dummy;clear #echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug --exec all config start" #./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug --exec all config start -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"%(.+)\" --tmp /tmp --silent --print --debug pam info" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "%(.+)" --tmp /tmp --silent --print --debug pam info +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"%(.+)\" --tmp /tmp --silent --print --debug pam info" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "%(.+)" --tmp /tmp --silent --print --debug pam info #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"%(.+)\" --tmp /tmp --silent --debug apache config start" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "%(.+)" --tmp /tmp --silent --debug apache config start +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef \"%(.+)\" --tmp /tmp --silent --debug apache config start" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L $RCBASE/rc.d --ParseSectionDef "%(.+)" --tmp /tmp --silent --debug apache config start #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --tmp /tmp --silent --debug all config start" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --tmp /tmp --silent --debug all config start +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --tmp /tmp --silent --debug all config start" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --tmp /tmp --silent --debug all config start #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --tmp /tmp --silent --debug pam info" -./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --tmp /tmp --silent --debug pam info +#echo; echo "./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" --tmp /tmp --silent --debug pam info" +#./rc --conf ./rc_test/myrc.conf --func ./rc_test/rcfuncs -L ./rc_test/ --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" --tmp /tmp --silent --debug pam info #read dummy;clear -echo; echo "./rc --conf ./rc_test/myrc.conf --func $RCBASE/rc.func -L $RCBASE/rc.d/ --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug dhcpd start" -./rc --conf ./rc_test/myrc.conf --func $RCBASE/rc.func -L $RCBASE/rc.d/ --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug dhcpd start +#echo; echo "./rc --conf ./rc_test/myrc.conf --func $RCBASE/rc.func -L $RCBASE/rc.d/ --ParseSectionDef \"^%(\w+)[ \t]*(.*?)\n(.*?)^$\" --tmp /tmp --silent --debug dhcpd start" +#./rc --conf ./rc_test/myrc.conf --func $RCBASE/rc.func -L $RCBASE/rc.d/ --ParseSectionDef "^%(\w+)[ \t]*(.*?)\n(.*?)^$" --tmp /tmp --silent --debug dhcpd start #read dummy;clear -echo; echo "./rc --func ./rc_test/rcfuncs --exec --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" -L ./rc_test pam autre" -./rc --func ./rc_test/rcfuncs --exec --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" -L ./rc_test pam autre +#echo; echo "./rc --func ./rc_test/rcfuncs --exec --ParseSectionDef \"^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>\" -L ./rc_test pam autre" +#./rc --func ./rc_test/rcfuncs --exec --ParseSectionDef "^<(.+?)[ \t]*(.*?)>\n*(.*?)^<\/\1>" -L ./rc_test pam autre #read dummy;clear -echo; echo "./rc --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd stop" -./rc --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd stop +#echo; echo "./rc --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd stop" +#./rc --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd stop #read dummy;clear -echo; echo "./rc --exec --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd gotest" -./rc --exec --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd gotest +#echo; echo "./rc --exec --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd gotest" +#./rc --exec --func ./rc_test/rcfuncs -L ./rc_test/ dhcpd gotest #read dummy;clear # Next milestone