Make test scripts callable from any path
This commit is contained in:
committed by
Tobias Brunner
parent
0593b6c975
commit
aafc0a1799
+7
-7
@@ -14,14 +14,14 @@
|
|||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
# for more details.
|
# for more details.
|
||||||
|
|
||||||
DIR=`dirname $0`
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/testing.conf
|
||||||
. $PWD/scripts/function.sh
|
. $DIR/scripts/function.sh
|
||||||
|
|
||||||
[ -d $PWD/hosts ] || die "Directory 'hosts' not found"
|
|
||||||
[ -d $PWD/tests ] || die "Directory 'tests' not found"
|
|
||||||
[ -d $BUILDDIR ] || die "Directory '$BUILDDIR' does not exist, please run make-testing first"
|
|
||||||
|
|
||||||
|
[ -d $DIR/hosts ] || die "Directory 'hosts' not found"
|
||||||
|
[ -d $DIR/tests ] || die "Directory 'tests' not found"
|
||||||
|
[ -d $BUILDDIR ] ||
|
||||||
|
die "Directory '$BUILDDIR' does not exist, please run make-testing first"
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# take care of new path and file variables
|
# take care of new path and file variables
|
||||||
|
|||||||
@@ -1,25 +1,26 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/testing.conf
|
||||||
|
|
||||||
rm -f $LOGFILE
|
rm -f $LOGFILE
|
||||||
|
|
||||||
if [ $ENABLE_BUILD_BASEIMAGE = "yes" ]
|
if [ $ENABLE_BUILD_BASEIMAGE = "yes" ]
|
||||||
then
|
then
|
||||||
$PWD/scripts/build-baseimage || exit 1
|
$DIR/scripts/build-baseimage || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ENABLE_BUILD_ROOTIMAGE = "yes" ]
|
if [ $ENABLE_BUILD_ROOTIMAGE = "yes" ]
|
||||||
then
|
then
|
||||||
$PWD/scripts/build-rootimage || exit 1
|
$DIR/scripts/build-rootimage || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ENABLE_BUILD_GUESTKERNEL = "yes" ]
|
if [ $ENABLE_BUILD_GUESTKERNEL = "yes" ]
|
||||||
then
|
then
|
||||||
$PWD/scripts/build-guestkernel || exit 1
|
$DIR/scripts/build-guestkernel || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $ENABLE_BUILD_GUESTIMAGES = "yes" ]
|
if [ $ENABLE_BUILD_GUESTIMAGES = "yes" ]
|
||||||
then
|
then
|
||||||
$PWD/scripts/build-guestimages $HOSTS || exit 1
|
$DIR/scripts/build-guestimages $HOSTS || exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
echo "Building base image"
|
echo "Building base image"
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,11 @@
|
|||||||
|
|
||||||
echo "Creating guest images"
|
echo "Creating guest images"
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
HOSTSDIR=$PWD/hosts
|
HOSTSDIR=$DIR/../hosts
|
||||||
|
|
||||||
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
||||||
[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found"
|
[ -f $ROOTIMG ] || die "Root image $ROOTIMG not found"
|
||||||
@@ -47,7 +49,7 @@ do
|
|||||||
if [ "$host" = "winnetou" ]
|
if [ "$host" = "winnetou" ]
|
||||||
then
|
then
|
||||||
execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0
|
execute "mkdir $LOOPDIR/var/log/apache2/ocsp" 0
|
||||||
execute "cp -rf $PWD/images $LOOPDIR/var/www/" 0
|
execute "cp -rf $DIR/../images $LOOPDIR/var/www/" 0
|
||||||
execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0
|
execute_chroot "ln -s /etc/openssl/certs /var/www/certs" 0
|
||||||
execute_chroot "/etc/openssl/generate-crl" 0
|
execute_chroot "/etc/openssl/generate-crl" 0
|
||||||
execute_chroot "update-rc.d apache2 defaults" 0
|
execute_chroot "update-rc.d apache2 defaults" 0
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
echo "Building guest kernel version $KERNELVERSION"
|
echo "Building guest kernel version $KERNELVERSION"
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,9 @@
|
|||||||
|
|
||||||
echo "Building root image"
|
echo "Building root image"
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
[ `id -u` -eq 0 ] || die "You must be root to run $0"
|
||||||
[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found"
|
[ -f "$BASEIMG" ] || die "Base image $BASEIMG not found"
|
||||||
@@ -52,7 +54,7 @@ do_on_exit rm -r $LOOPDIR/root/compile
|
|||||||
do_on_exit umount $LOOPDIR/root/compile
|
do_on_exit umount $LOOPDIR/root/compile
|
||||||
|
|
||||||
echo "Installing software from source"
|
echo "Installing software from source"
|
||||||
RECPDIR=$PWD/scripts/recipes
|
RECPDIR=$DIR/recipes
|
||||||
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
|
RECIPES=`ls $RECPDIR/*.mk | xargs -n1 basename`
|
||||||
execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0
|
execute "cp -r $RECPDIR/patches $LOOPDIR/root/compile" 0
|
||||||
for r in $RECIPES
|
for r in $RECIPES
|
||||||
|
|||||||
@@ -26,9 +26,6 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -f testing.conf ] || die "Configuration file 'testing.conf' not found"
|
|
||||||
. testing.conf
|
|
||||||
|
|
||||||
# execute command
|
# execute command
|
||||||
# $1 - command to execute
|
# $1 - command to execute
|
||||||
# $2 - whether or not to log command exit status
|
# $2 - whether or not to log command exit status
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
# for more details.
|
# for more details.
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
##########################################################################
|
##########################################################################
|
||||||
# load-testconfig requires a testname as an argument
|
# load-testconfig requires a testname as an argument
|
||||||
|
|||||||
@@ -14,11 +14,13 @@
|
|||||||
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
# for more details.
|
# for more details.
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/../testing.conf
|
||||||
|
. $DIR/function.sh
|
||||||
|
|
||||||
testname=$1
|
testname=$1
|
||||||
|
|
||||||
HOSTCONFIGDIR=$PWD/hosts
|
HOSTCONFIGDIR=$DIR/../hosts
|
||||||
TESTSDIR=$BUILDDIR/tests
|
TESTSDIR=$BUILDDIR/tests
|
||||||
|
|
||||||
[ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
|
[ -d $TESTSDIR ] || die "Directory '$TESTSDIR' not found"
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/testing.conf
|
||||||
|
. $DIR/scripts/function.sh
|
||||||
|
|
||||||
NETWORKS="vnet1 vnet2 vnet3"
|
NETWORKS="vnet1 vnet2 vnet3"
|
||||||
CONFDIR=$PWD/config/kvm
|
CONFDIR=$DIR/config/kvm
|
||||||
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
|
KNLSRC=$BUILDDIR/$KERNEL/arch/x86/boot/bzImage
|
||||||
KNLTARGET=/var/run/kvm-swan-kernel
|
KNLTARGET=/var/run/kvm-swan-kernel
|
||||||
HOSTFSTARGET=/var/run/kvm-swan-hostfs
|
HOSTFSTARGET=/var/run/kvm-swan-hostfs
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
. $PWD/scripts/function.sh
|
DIR=$(dirname `readlink -f $0`)
|
||||||
|
. $DIR/testing.conf
|
||||||
|
. $DIR/scripts/function.sh
|
||||||
|
|
||||||
echo "Stopping test environment"
|
echo "Stopping test environment"
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ TESTDIR=/srv/strongswan-testing
|
|||||||
KERNELVERSION=3.5.3
|
KERNELVERSION=3.5.3
|
||||||
KERNEL=linux-$KERNELVERSION
|
KERNEL=linux-$KERNELVERSION
|
||||||
KERNELTARBALL=$KERNEL.tar.bz2
|
KERNELTARBALL=$KERNEL.tar.bz2
|
||||||
KERNELCONFIG=$PWD/config/kernel/config-3.5
|
KERNELCONFIG=$DIR/../config/kernel/config-3.5
|
||||||
KERNELPATCH=ha-3.0.patch.bz2
|
KERNELPATCH=ha-3.0.patch.bz2
|
||||||
|
|
||||||
# strongSwan version used in tests
|
# strongSwan version used in tests
|
||||||
|
|||||||
Reference in New Issue
Block a user