testing: Add test config to create and remove a directory for DBs stored in ramfs

This commit is contained in:
Tobias Brunner
2015-11-09 15:18:38 +01:00
parent 10fa70ee5c
commit e873cb5a28
+23 -1
View File
@@ -47,7 +47,6 @@ testnumber="0"
failed_cnt="0" failed_cnt="0"
passed_cnt="0" passed_cnt="0"
############################################################################## ##############################################################################
# copy default tests to $BUILDDIR # copy default tests to $BUILDDIR
# #
@@ -338,8 +337,11 @@ do
# copy test specific configurations to uml hosts and clear auth.log files # copy test specific configurations to uml hosts and clear auth.log files
# #
DBDIR=/etc/db.d
$DIR/scripts/load-testconfig $testname $DIR/scripts/load-testconfig $testname
unset RADIUSHOSTS unset RADIUSHOSTS
unset DBHOSTS
unset IPV6 unset IPV6
unset SWANCTL unset SWANCTL
source $TESTDIR/test.conf source $TESTDIR/test.conf
@@ -364,6 +366,17 @@ do
done done
fi 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 # flush conntrack table on all hosts
# #
@@ -780,6 +793,15 @@ do
fi fi
done 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 # copy default host config back if necessary