aboutsummaryrefslogtreecommitdiffstats
path: root/testing/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'testing/scripts')
-rwxr-xr-xtesting/scripts/build-baseimage7
-rwxr-xr-xtesting/scripts/build-umlhostfs9
-rwxr-xr-xtesting/scripts/build-umlkernel7
-rwxr-xr-xtesting/scripts/build-umlrootfs7
-rwxr-xr-xtesting/scripts/function.sh27
-rwxr-xr-xtesting/scripts/install-shared8
-rwxr-xr-xtesting/scripts/load-testconfig8
-rwxr-xr-xtesting/scripts/restore-defaults9
-rwxr-xr-xtesting/scripts/shutdown-umls8
-rwxr-xr-xtesting/scripts/start-umls8
10 files changed, 26 insertions, 72 deletions
diff --git a/testing/scripts/build-baseimage b/testing/scripts/build-baseimage
index 08da30f08..4b81c5cdb 100755
--- a/testing/scripts/build-baseimage
+++ b/testing/scripts/build-baseimage
@@ -2,15 +2,10 @@
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"
diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs
index ada9696c7..e5355988c 100755
--- a/testing/scripts/build-umlhostfs
+++ b/testing/scripts/build-umlhostfs
@@ -16,18 +16,13 @@
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"
diff --git a/testing/scripts/build-umlkernel b/testing/scripts/build-umlkernel
index 3947e4ab1..6e17af430 100755
--- a/testing/scripts/build-umlkernel
+++ b/testing/scripts/build-umlkernel
@@ -14,12 +14,7 @@
# 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"
diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs
index a0444de38..6c67a2534 100755
--- a/testing/scripts/build-umlrootfs
+++ b/testing/scripts/build-umlrootfs
@@ -16,15 +16,10 @@
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
diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh
index a04490aec..3e0560a46 100755
--- a/testing/scripts/function.sh
+++ b/testing/scripts/function.sh
@@ -14,6 +14,21 @@
# 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
@@ -40,11 +55,6 @@ execute_chroot()
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"
}
@@ -76,13 +86,6 @@ log_status()
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
diff --git a/testing/scripts/install-shared b/testing/scripts/install-shared
index 4cfac9e77..0f961aef9 100755
--- a/testing/scripts/install-shared
+++ b/testing/scripts/install-shared
@@ -17,13 +17,7 @@
# 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: "
diff --git a/testing/scripts/load-testconfig b/testing/scripts/load-testconfig
index d73b31275..1abe5985c 100755
--- a/testing/scripts/load-testconfig
+++ b/testing/scripts/load-testconfig
@@ -14,13 +14,7 @@
# 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
diff --git a/testing/scripts/restore-defaults b/testing/scripts/restore-defaults
index 6bad3c5f0..16714db26 100755
--- a/testing/scripts/restore-defaults
+++ b/testing/scripts/restore-defaults
@@ -14,12 +14,7 @@
# 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
@@ -27,7 +22,7 @@ DIR=`dirname $0`
testname=$1
-HOSTCONFIGDIR=$DIR/../hosts
+HOSTCONFIGDIR=$PWD/hosts
TESTSDIR=$BUILDDIR/tests
[ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
diff --git a/testing/scripts/shutdown-umls b/testing/scripts/shutdown-umls
index e71e46602..9d37ab1d8 100755
--- a/testing/scripts/shutdown-umls
+++ b/testing/scripts/shutdown-umls
@@ -17,13 +17,7 @@
# 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 " "
diff --git a/testing/scripts/start-umls b/testing/scripts/start-umls
index 470bdc61b..f9578d751 100755
--- a/testing/scripts/start-umls
+++ b/testing/scripts/start-umls
@@ -14,13 +14,7 @@
# 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