From e873cb5a289f58100e2c5d9097e257fed77df602 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Fri, 6 Nov 2015 17:26:42 +0100 Subject: [PATCH] testing: Add test config to create and remove a directory for DBs stored in ramfs --- testing/do-tests | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 @@ -364,6 +366,17 @@ do done 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