echo "Building base image"
-DIR=`dirname $0`
-
-. $DIR/function.sh
+. $PWD/scripts/function.sh
[ `id -u` -eq 0 ] || die "You must be root to run $0"
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-. $DIR/../testing.conf
-
# additional packages
EXTRAS=build-essential,gperf,libgmp-dev,libldap2-dev,libcurl4-openssl-dev,libxml2-dev,libtspi-dev,libsqlite3-dev,openssh-server,tcpdump,psmisc,openssl,vim,sqlite3,conntrack,gdb,cmake,libxerces-c2-dev,libltdl-dev,liblog4cxx10-dev,libboost-thread-dev,libboost-system-dev,git-core
SERVICES="isc-dhcp-server apache2 slapd"
echo "Creating guest images"
-DIR=`dirname $0`
-
-. $DIR/function.sh
+. $PWD/scripts/function.sh
[ `id -u` -eq 0 ] || die "You must be root to run $0"
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-. $DIR/../testing.conf
-
BASE=$BUILDDIR/base.img
ROOTFSDIR=$BUILDDIR/root-fs
-HOSTSDIR=$DIR/../hosts
+HOSTSDIR=$PWD/hosts
[ -f $BASE ] || die "Base image $BASE not found"
[ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found"
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
-DIR=`dirname $0`
-. $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-. $DIR/../testing.conf
+. $PWD/scripts/function.sh
echo "Building guest kernel version $KERNELVERSION"
echo "Building root image"
-DIR=`dirname $0`
-
-. $DIR/function.sh
+. $PWD/scripts/function.sh
[ `id -u` -eq 0 ] || die "You must be root to run $0"
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-. $DIR/../testing.conf
-
[ -f "$ROOTFS" ] || die "Root image $ROOTFS not found"
ROOTFSDIR=$BUILDDIR/root-fs
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
+export TERM=xterm
+RED=$(tput setaf 1)
+GREEN=$(tput setaf 2)
+NORMAL=$(tput op)
+
+# exit with given error message
+# $1 - error message
+die() {
+ echo -e "${RED}$1${NORMAL}"
+ exit 1
+}
+
+[ -f testing.conf ] || die "Configuration file 'testing.conf' not found"
+. testing.conf
+
# execute command
# $1 - command to execute
# $2 - whether or not to log command exit status
execute "chroot $LOOPDIR $@"
}
-export TERM=xterm
-RED=$(tput setaf 1)
-GREEN=$(tput setaf 2)
-NORMAL=$(tput op)
-
function cecho {
echo -e "\033[1;31m$1\033[0m"
}
echo
}
-# exit with given error message
-# $1 - error message
-die() {
- echo -e "${RED}$1${NORMAL}"
- exit 1
-}
-
#############################################
# search and replace strings throughout a
# whole directory
# for more details.
#
-DIR=`dirname $0`
-
-source $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-source $DIR/../testing.conf
+. $PWD/scripts/function.sh
cecho "installing strongSwan from shared tree"
cecho-n " on: "
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
-DIR=`dirname $0`
-
-source $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-source $DIR/../testing.conf
+. $PWD/scripts/function.sh
##########################################################################
# load-testconfig requires a testname as an argument
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
-DIR=`dirname $0`
-
-. $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-. $DIR/../testing.conf
+. $PWD/scripts/function.sh
##########################################################################
# load-testconfig requires a testname as an argument
testname=$1
-HOSTCONFIGDIR=$DIR/../hosts
+HOSTCONFIGDIR=$PWD/hosts
TESTSDIR=$BUILDDIR/tests
[ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
# for more details.
#
-DIR=`dirname $0`
-
-source $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-source $DIR/../testing.conf
+. $PWD/scripts/function.sh
cecho "shutting down"
cecho-n " "
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
-DIR=`dirname $0`
-
-source $DIR/function.sh
-
-[ -f $DIR/../testing.conf ] || die "Configuration file 'testing.conf' not found"
-
-source $DIR/../testing.conf
+. $PWD/scripts/function.sh
if [ "$#" -eq 0 ]
then