]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
testing: Add test config to create and remove a directory for DBs stored in ramfs
authorTobias Brunner <tobias@strongswan.org>
Fri, 6 Nov 2015 16:26:42 +0000 (17:26 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 9 Nov 2015 14:18:38 +0000 (15:18 +0100)
testing/do-tests

index b5a12a270ef47ce1226574320e0cca691970e4f9..c87ba05a7e7079e9ab54252052188fdc08a7dbb1 100755 (executable)
@@ -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