aboutsummaryrefslogtreecommitdiffstats
path: root/testing/do-tests
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2015-11-06 17:26:42 +0100
committerTobias Brunner <tobias@strongswan.org>2015-11-09 15:18:38 +0100
commite873cb5a289f58100e2c5d9097e257fed77df602 (patch)
treef6bd489b77ba9319ddb58bd8f67f01df2b264095 /testing/do-tests
parent10fa70ee5c0c3e6b36efdd9328bae267385b4b96 (diff)
downloadstrongswan-e873cb5a289f58100e2c5d9097e257fed77df602.tar.bz2
strongswan-e873cb5a289f58100e2c5d9097e257fed77df602.tar.xz
testing: Add test config to create and remove a directory for DBs stored in ramfs
Diffstat (limited to 'testing/do-tests')
-rwxr-xr-xtesting/do-tests24
1 files changed, 23 insertions, 1 deletions
diff --git a/testing/do-tests b/testing/do-tests
index b5a12a270..c87ba05a7 100755
--- a/testing/do-tests
+++ b/testing/do-tests
@@ -47,7 +47,6 @@ testnumber="0"
failed_cnt="0"
passed_cnt="0"
-
##############################################################################
# copy default tests to $BUILDDIR
#
@@ -338,8 +337,11 @@ do
# copy test specific configurations to uml hosts and clear auth.log files
#
+ DBDIR=/etc/db.d
+
$DIR/scripts/load-testconfig $testname
unset RADIUSHOSTS
+ unset DBHOSTS
unset IPV6
unset SWANCTL
source $TESTDIR/test.conf
@@ -365,6 +367,17 @@ do
fi
##########################################################################
+ # create database directory in RAM
+ #
+
+ for host in $DBHOSTS
+ do
+ eval HOSTLOGIN=root@\$ipv4_${host}
+ ssh $SSHCONF $HOSTLOGIN "mkdir -p $DBDIR; mount -t ramfs -o size=5m ramfs $DBDIR" >/dev/null 2>&1
+ ssh $SSHCONF $HOSTLOGIN "chgrp www-data $DBDIR; chmod g+w $DBDIR" >/dev/null 2>&1
+ done
+
+ ##########################################################################
# flush conntrack table on all hosts
#
@@ -780,6 +793,15 @@ do
fi
done
+ ##########################################################################
+ # remove database directory if needed
+ #
+
+ for host in $DBHOSTS
+ do
+ eval HOSTLOGIN=root@\$ipv4_${host}
+ ssh $SSHCONF $HOSTLOGIN "umount $DBDIR; rm -r $DBDIR" > /dev/null 2>&1
+ done
##########################################################################
# copy default host config back if necessary