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>
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@" >>$@
@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" ;\
$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
#
# 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@
PACKAGE=@PACKAGE@
host=@host@
RUNAS=
-FS=${afssrvbindir}/fs
+FS=${AFSSRVBINDIR}/fs
CELLNAME=${CELLNAME-testcell}
export FS
export SHELL
# 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 "-------------------------------------------------"