Return-Path: To: info-cvs@gnu.org Subject: pserver sanity check for CVS 1.9.24 Content-Type: text/plain; charset=US-ASCII Date: Sat, 21 Feb 1998 02:51:28 +0900 From: WATANABE Katsuhiro I made a patch to do sanity check for pserver of CVS 1.9.24. (Though there is a comment in src/sanity.sh: # Use rsh so we can test it without having to muck with inetd # or anything like that. ) How to do sanity check for pserver: (1) Cut the attatched patch and paste it to "the_patch_file". (2) Apply the patch to cvs-1.9.24/src/sanity.sh by "patch < the_patch_file". (3) Add "--allow-root=/tmp/cvs-sanity/cvsroot" and "--allow-root=/tmp/cvs-sanity/crerepos" settings into cvspserver entry of inetd.conf. Then "kill -HUP inetd-process-ID". (4) Invoke "sh sanity.sh -p cvs-1.9.24-absolute-path". (5) When CVS login prompt comes, enter your login password. I ran pserver sanity check on FreeBSD 2.2.5-RELEASE, Linux 2.0.33 with Slackware 3.1, and SunOS 4.1.2. And it revealed for me that (a) config-4 fails for all machines. check.log says: cvs [commit aborted]: unrecognized auth response from sras49: cvs pserver: syntax error in /tmp/cvs-sanity/cvsroot/CVSROOT/config: line 'bogus line' is missing '=' exit status was 1 FAIL: config-4 (b) modules-155c8 fails in SunOS 4.1.2. check.log says: ** expected: cvs [a-z]*: warning: first-dir/file1 is not (any longer) pertinent U first-dir/file2 ** got: cvs server: warning: first-dir/file1 is not (any longer) pertinent cvs checkout: protocol error: duplicate Mod-time U first-dir/file2 FAIL: modules-155c8 I just ran the test and haven't investigated why these check fails, yet. -- WATANABE Katsuhiro Software Research Associates, Inc. Tokyo Japan. *** sanity.sh Fri Jan 30 13:22:28 1998 --- sanityr.sh Sat Feb 20 23:29:09 1971 *************** *** 18,25 **** # # Original Author: K. Richard Pixley ! # usage: sanity.sh [-r] @var{cvs-to-test} @var{tests-to-run} ! # -r means to test remote instead of local cvs. # @var{tests-to-run} are the names of the tests to run; if omitted run all # tests. --- 18,26 ---- # # Original Author: K. Richard Pixley ! # usage: sanity.sh [-(r|p)] @var{cvs-to-test} @var{tests-to-run} ! # -r means to test remote(:ext:) instead of local cvs. ! # -p means to test remote(:pserver:) instead of local cvs. # @var{tests-to-run} are the names of the tests to run; if omitted run all # tests. *************** *** 64,83 **** # "debugger" #set -x ! echo 'This test should produce no other output than this line, and a final "OK".' ! ! if test x"$1" = x"-r"; then shift remote=yes ! # If we're going to do remote testing, make sure 'rsh' works first. host="`hostname`" if test "x`${CVS_RSH-rsh} $host -n 'echo hi'`" != "xhi"; then ! echo "ERROR: cannot test remote CVS, because \`rsh $host' fails." >&2 exit 1 fi ! else remote=no ! fi # The --keep option will eventually cause all the tests to leave around the # contents of the /tmp directory; right now only some implement it. Not --- 65,122 ---- # "debugger" #set -x ! protocol=local ! case x"$1" in ! x"-r") ! echo 'This test should produce no other output than this line, and a final "OK".' shift remote=yes ! protocol=ext ! # If we're going to do :ext: testing, make sure 'rsh' works first. host="`hostname`" if test "x`${CVS_RSH-rsh} $host -n 'echo hi'`" != "xhi"; then ! echo "ERROR: cannot test remote CVS through :ext:, because \`rsh $host' fails." >&2 exit 1 fi ! ;; ! x"-p") ! echo 'This test should produce no other output than this line, login prompt and a final "OK".' ! shift ! remote=yes ! protocol=pserver ! # If we're going to do :pserver: testing, make sure cvs pserver ! # serves for connection. ! host="`hostname`" ! if echo QUIT | telnet "$host" 2401 2>&1 | grep -q 'refused'; then ! echo "ERROR: cannot test remote CVS through :pserver:, \ ! because \`telnet $host 2401' fails." >&2 ! exit 1 ! fi ! pservconf="`egrep '^(cvspserver|2401)' /etc/inetd.conf`" ! if test "$?" -ne 0; then ! echo "ERROR: cannot confirm if the CVS pserver is invoked \ ! with proper --allow-root switch." >&2 ! exit 1 ! fi ! # $EXPR is not set yet. Be careful not to be caught expr's ! # incompatibilities. ! if expr "$pservconf" : \ ! '.*--allow-root=/tmp/cvs-sanity/cvsroot' >/dev/null && ! expr "$pservconf" : \ ! '.*--allow-root=/tmp/cvs-sanity/crerepos' >/dev/null; then ! : OK. ! else ! echo "ERROR: cvs pserver must be invoked with \ ! '--allow-root=/tmp/cvs-sanity/cvsroot' and \ ! '--allow-root=/tmp/cvs-sanity/crerepos'." ! exit 1 ! fi ! ;; ! *) ! echo 'This test should produce no other output than this line, and a final "OK".' remote=no ! ;; ! esac # The --keep option will eventually cause all the tests to leave around the # contents of the /tmp directory; right now only some implement it. Not *************** *** 609,623 **** # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set). CVSROOT_DIRNAME=${TESTDIR}/cvsroot CVSROOT=${CVSROOT_DIRNAME} ; export CVSROOT ! if test "x$remote" = xyes; then # Use rsh so we can test it without having to muck with inetd # or anything like that. Also needed to get CVS_SERVER to # work. ! CVSROOT=:ext:`hostname`:${CVSROOT_DIRNAME} ; export CVSROOT CVS_SERVER=${testcvs}; export CVS_SERVER fi - dotest 1 "${testcvs} init" '' ### The big loop for what in $tests; do --- 648,698 ---- # Set up CVSROOT (the crerepos tests will test operating without CVSROOT set). CVSROOT_DIRNAME=${TESTDIR}/cvsroot CVSROOT=${CVSROOT_DIRNAME} ; export CVSROOT ! case "x$protocol" in ! xext) # Use rsh so we can test it without having to muck with inetd # or anything like that. Also needed to get CVS_SERVER to # work. ! myid="`whoami`" ! CVSROOT=:ext:$myid@$host:${CVSROOT_DIRNAME} ; export CVSROOT CVS_SERVER=${testcvs}; export CVS_SERVER + ;; + xpserver) + # Force to use pserver. + #myid="`id -un`" + myid="`whoami`" + CVSROOT=":pserver:$myid@$host:${CVSROOT_DIRNAME}" + export CVSROOT + CVS_PASSFILE=${TESTDIR}/.cvspass + export CVS_PASSFILE + ;; + esac + + if test "x$protocol" != xpserver; then + dotest 1 "${testcvs} init" '' + else + dotest 1-1 "${testcvs} -d :local:${CVSROOT_DIRNAME} init" '' + if ypmatch "$myid" passwd >/dev/null 2>&1; then + passent="`ypmatch $myid passwd`" + else + passent="`grep $myid /etc/passwd`" + fi + echo "passent" | \ + awk -F : '{print $1":"$2}' > ${CVSROOT_DIRNAME}/CVSROOT/passwd + + # FAKE Login prompt + echo "(Logging in to $myid@$host)" + # Because "echo -n" is not portable, use awk. + # Depends on the spec of getpass(3), It can happen that you see + # the prompt two times. + awk 'BEGIN {printf("CVS password: "); exit;}' + dotest 1-2 "${testcvs} login" \ + "(Logging in to $myid@$host) + CVS password: .*" \ + "(Logging in to $myid@$host)" + echo fi ### The big loop for what in $tests; do *************** *** 8662,8668 **** mkdir crerepos mkdir crerepos/CVSROOT ! CREREPOS_ROOT=:ext:`hostname`:${TESTDIR}/crerepos fi --- 8737,8752 ---- mkdir crerepos mkdir crerepos/CVSROOT ! case x"$protocol" in ! xext) ! CREREPOS_ROOT=:ext:$host:${TESTDIR}/crerepos ! ;; ! xpserver) ! scrambledpass="`head -1 ${CVS_PASSFILE} | awk '{print $2}'`" ! CREREPOS_ROOT=:pserver:$myid@$host:${TESTDIR}/crerepos ! echo "${CREREPOS_ROOT} $scrambledpass" >> ${CVS_PASSFILE} ! ;; ! esac fi *************** *** 8682,8697 **** else # remote # Test that CVS rejects a relative path in CVSROOT. mkdir 1; cd 1 ! dotest_fail crerepos-6a \ ! "${testcvs} -q -d :ext:`hostname`:../crerepos get ." \ "Root ../crerepos must be an absolute pathname" cd .. rm -r 1 mkdir 1; cd 1 ! dotest_fail crerepos-6b \ ! "${testcvs} -d :ext:`hostname`:crerepos init" \ "Root crerepos must be an absolute pathname" cd .. rm -r 1 fi # end of tests to be skipped for remote --- 8766,8809 ---- else # remote # Test that CVS rejects a relative path in CVSROOT. mkdir 1; cd 1 ! case x"$protocol" in ! xext) ! dotest_fail crerepos-6a \ ! "${testcvs} -q -d :ext:$host:../crerepos get ." \ "Root ../crerepos must be an absolute pathname" + ;; + xpserver) + # Actually, this test doesn't check relative pass acceptability. + # It may be rejected because the path is not specified as + # --allow-root switch for cvs pserver. + echo ":pserver:$myid@$host:../crerepos $scrambledpass" \ + >> ${CVS_PASSFILE} + dotest_fail crerepos-6a \ + "${testcvs} -q -d :pserver:$myid@$host:../crerepos get ." \ + "cvs \[[a-z]* aborted\]: authorization failed: server $host rejected access" + ;; + esac cd .. rm -r 1 mkdir 1; cd 1 ! case x"$protocol" in ! xext) ! dotest_fail crerepos-6b \ ! "${testcvs} -d :ext:$host:crerepos init" \ "Root crerepos must be an absolute pathname" + ;; + xpserver) + # Actually, this test doesn't check relative pass acceptability. + # It may be rejected because the path is not specified as + # --allow-root switch for cvs pserver. + echo ":pserver:$myid@$host:crerepos $scrambledpass" \ + >> ${CVS_PASSFILE} + dotest_fail crerepos-6b \ + "${testcvs} -d :pserver:$myid@$host:crerepos init" \ + "cvs \[[a-z]* aborted\]: authorization failed: server $host rejected access" + ;; + esac cd .. rm -r 1 fi # end of tests to be skipped for remote *************** *** 13468,13474 **** # * cvs rm twice (should be a nice error message). # * -P option to checkout--(a) refrains from checking out new empty dirs, # (b) prunes empty dirs already there. ! # * Test that cvs -d `hostname`:${TESTDIR}/non/existent co foo # gives an appropriate error (e.g. # Cannot access ${TESTDIR}/non-existent/CVSROOT # No such file or directory). --- 13580,13586 ---- # * cvs rm twice (should be a nice error message). # * -P option to checkout--(a) refrains from checking out new empty dirs, # (b) prunes empty dirs already there. ! # * Test that cvs -d $host:${TESTDIR}/non/existent co foo # gives an appropriate error (e.g. # Cannot access ${TESTDIR}/non-existent/CVSROOT # No such file or directory).