Fix dirpath shell script generated from makefile
authorMichael Meffie <mmeffie@sinenomine.net>
Tue, 14 Jul 2009 16:03:22 +0000 (12:03 -0400)
committerRuss Allbery <rra@stanford.edu>
Tue, 14 Jul 2009 16:51:49 +0000 (10:51 -0600)
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 <rra@stanford.edu>
Verified-by: Russ Allbery <rra@stanford.edu>

src/tests/Makefile.in
src/tests/afs-newcell.pl
src/tests/run-tests.in

index ecd2700..4504943 100644 (file)
@@ -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" ;\
index 606bc00..1bfbe31 100755 (executable)
@@ -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
index c5bff28..d0fc73d 100755 (executable)
@@ -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 "-------------------------------------------------"