From: Michael Meffie Date: Tue, 14 Jul 2009 16:03:22 +0000 (-0400) Subject: Fix dirpath shell script generated from makefile X-Git-Tag: openafs-devel-1_5_61~117 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=cdda13eec2a00becb8c2ce5270dd00a0f1097519;p=packages%2Fo%2Fopenafs.git Fix dirpath shell script generated from makefile Generate the correct paths when building transarc style paths. Remove the redundant dirpath shell script that was generated by the afs-newcell script. Update the run-tests driver to use the build time generated dirpaths. FIXES 124976 Reviewed-on: http://gerrit.openafs.org/80 Reviewed-by: Russ Allbery Verified-by: Russ Allbery --- diff --git a/src/tests/Makefile.in b/src/tests/Makefile.in index ecd27008b..4504943d7 100644 --- a/src/tests/Makefile.in +++ b/src/tests/Makefile.in @@ -406,7 +406,7 @@ OpenAFS/Dirpath.pm: Makefile OpenAFS/Dirpath.sh: Makefile @echo "Creating OpenAFS/Dirpath.sh" - @echo "# auto-generated by src/tests/Makefile" >>$@ + @echo "# auto-generated by src/tests/Makefile" >$@ @echo "# source or '.' in this file in shell" >>$@ @echo "# DO NOT EDIT" >>$@ @echo " AFSCONFDIR=@afsconfdir@" >>$@ @@ -420,7 +420,7 @@ OpenAFS/Dirpath.sh: Makefile @echo " AFSBACKUPDIR=@afsbackupdir@" >>$@ @echo " AFSBOSCONFIGDIR=@afsbosconfigdir@" >>$@ @echo " OSTYPE=@MKAFS_OSTYPE@" >>$@ - @if test "${sysconfdir}/openafs/server" = "/usr/afs/etc" ; then \ + @if test "@afsconfdir@" = "/usr/afs/etc" ; then \ echo "# transarc paths" ;\ echo " CACHEDIR=/usr/vice/cache" ;\ echo " AFSDDIR=/usr/vice/etc" ;\ diff --git a/src/tests/afs-newcell.pl b/src/tests/afs-newcell.pl index 606bc005d..1bfbe3108 100755 --- a/src/tests/afs-newcell.pl +++ b/src/tests/afs-newcell.pl @@ -511,15 +511,9 @@ my $username = $admin; $username=~s:/:.:g; # convert kerberos separators to afs separators. #----------------------------------------------------------------------------- -# Prereq: Save the paths and setup configuration in a form that is easily +# Prereq: Save the setup configuration in a form that is easily # read by the shell scripts. # -open(CONF, "> dirpath.conf") or die "error: Cannot open file dirpath.conf for writing: $!\n"; -my ($n, $v); -while(($n,$v)=each(%{$path})) { - print CONF "$n=$v\n"; -} -close CONF; open(CONF, "> run-tests.conf") or die "error: Cannot open file run-tests.conf for writing: $!\n"; print CONF <<"__CONF__"; CELLNAME=$cellname diff --git a/src/tests/run-tests.in b/src/tests/run-tests.in index c5bff28ab..d0fc73d70 100755 --- a/src/tests/run-tests.in +++ b/src/tests/run-tests.in @@ -4,18 +4,24 @@ # # Directory paths configured during the build. -if test -f dirpath.conf; then - . dirpath.conf +if test -f ./OpenAFS/Dirpath.sh; then + . ./OpenAFS/Dirpath.sh else - echo "error: Missing dirpath.conf file, try make dirpath.conf" + echo "error: Missing file OpenAFS/Dirpath.sh. Run 'make all' first." exit 1 fi -if test -f run-tests.conf; then - . run-tests.conf -else - echo "warning: Missing run-tests.conf, using default values." +if ! test -f ./run-tests.conf; then + echo "warning: Creating run-tests.conf with default values." + echo " Please edit run-tests.conf to match your test cell configuration." + echo "CELLNAME=testcell" > ./run-tests.conf + echo "PARTITION=a" >>./run-tests.conf + echo "ADMIN=admin" >>./run-tests.conf + echo "KERBEROS_TYPE=kaserver" >>./run-tests.conf + echo "KERBEROS_REALM=TESTCELL" >>./run-tests.conf + echo "KERBEROS_KEYTAB=${AFSCONFDIR}/krb5.keytab" >>./run-tests.conf fi +. ./run-tests.conf srcdir=@srcdir@ @@ -26,7 +32,7 @@ VERSION=@VERSION@ PACKAGE=@PACKAGE@ host=@host@ RUNAS= -FS=${afssrvbindir}/fs +FS=${AFSSRVBINDIR}/fs CELLNAME=${CELLNAME-testcell} export FS export SHELL @@ -378,7 +384,7 @@ export objdir # login if [ "$KERBEROS_TYPE" != "kaserver" ] ; then kinit -k -t $KERBEROS_KEYTAB $ADMIN || exit 1; - $afswsbindir/aklog -d -c $CELLNAME || exit 1; + ${AFSWSBINDIR}/aklog -d -c $CELLNAME || exit 1; fi echo "-------------------------------------------------"