testing: Reduce runtime of all tests that use SQLite databases by storing them in ramfs

This commit is contained in:
Tobias Brunner
2015-11-09 15:18:39 +01:00
parent 3102da20a7
commit 10051b01e9
161 changed files with 319 additions and 312 deletions
@@ -3,11 +3,11 @@
libimcv {
load = random nonce openssl pubkey sqlite
debug_level = 3
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
assessment_result = no
}
attest {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
}
@@ -3,7 +3,6 @@ carol::ipsec stop
dave::ipsec stop
alice::killall radiusd
alice::rm /etc/freeradius/sites-enabled/inner-tunnel-second
alice::umount /etc/pts
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
@@ -5,11 +5,8 @@ carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
alice::ln -s /etc/freeradius/sites-available/inner-tunnel-second /etc/freeradius/sites-enabled/inner-tunnel-second
alice::cat /etc/freeradius/sites-enabled/inner-tunnel-second
alice::mv /etc/pts/data1.sql /tmp/
alice::mount -t ramfs -o size=5m ramfs /etc/pts
alice::mv /tmp/data1.sql /etc/pts/
alice::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
alice::LEAK_DETECTIVE_DISABLE=1 LOG4CXX_CONFIGURATION=/etc/tnc/log4cxx.properties radiusd
alice::cat /etc/tnc_config
carol::cat /etc/tnc_config
@@ -24,3 +24,6 @@ IPSECHOSTS="moon carol dave"
#
RADIUSHOSTS="alice"
# Guest instances on which databases are used
#
DBHOSTS="alice"
@@ -15,7 +15,7 @@ charon {
}
libimcv {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
plugins {
imv-attestation {
@@ -26,5 +26,5 @@ libimcv {
attest {
load = random nonce openssl sqlite
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
}
@@ -5,4 +5,3 @@ moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::umount /etc/pts
@@ -3,11 +3,8 @@ carol::iptables-restore < /etc/iptables.rules
dave::iptables-restore < /etc/iptables.rules
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
moon::mv /etc/pts/data1.sql /tmp/
moon::mount -t ramfs -o size=5m ramfs /etc/pts
moon::mv /tmp/data1.sql /etc/pts/
moon::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
+2 -3
View File
@@ -20,7 +20,6 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="moon carol dave"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="moon"
@@ -15,11 +15,11 @@ charon {
}
libimcv {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
}
attest {
load = random nonce openssl sqlite
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
}
@@ -5,4 +5,3 @@ moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::umount /etc/pts
+1 -4
View File
@@ -3,12 +3,9 @@ carol::iptables-restore < /etc/iptables.rules
dave::iptables-restore < /etc/iptables.rules
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
moon::mv /etc/pts/data1.sql /tmp/
moon::mount -t ramfs -o size=5m ramfs /etc/pts
moon::mv /tmp/data1.sql /etc/pts/
moon::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
moon::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
+2 -3
View File
@@ -20,7 +20,6 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="moon carol dave"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="moon"
@@ -5,7 +5,7 @@ DEBUG_TOOLBAR=0
[db]
DJANGO_DB_URL=sqlite:////var/www/tnc/django.db
STRONGTNC_DB_URL = sqlite:////etc/pts/config.db
STRONGTNC_DB_URL = sqlite:////etc/db.d/config.db
[localization]
LANGUAGE_CODE=en-us
@@ -24,7 +24,7 @@ charon {
libimcv {
debug_level = 3
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
plugins {
@@ -3,7 +3,6 @@ carol::ipsec stop
dave::ipsec stop
alice::ipsec stop
alice::service apache2 stop
alice::umount /etc/pts
moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
@@ -6,13 +6,10 @@ carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
alice::mv /etc/pts/data1.sql /tmp/
alice::mount -t ramfs -o size=5m ramfs /etc/pts
alice::mv /tmp/data1.sql /etc/pts/
alice::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
alice::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
alice::chgrp -R www-data /etc/pts; chmod -R g+w /etc/pts
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
alice::chgrp -R www-data /etc/db.d/config.db; chmod -R g+w /etc/db.d/config.db
alice::/var/www/tnc/manage.py setpassword strongSwan strongSwan
alice::service apache2 start
alice::ipsec start
+2 -2
View File
@@ -20,7 +20,7 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="moon carol dave alice"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="alice"
@@ -5,7 +5,7 @@ DEBUG_TOOLBAR=0
[db]
DJANGO_DB_URL=sqlite:////var/www/tnc/django.db
STRONGTNC_DB_URL = sqlite:////etc/pts/config.db
STRONGTNC_DB_URL = sqlite:////etc/db.d/config.db
[localization]
LANGUAGE_CODE=en-us
@@ -18,7 +18,7 @@ libtls {
}
libimcv {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
plugins {
@@ -3,7 +3,6 @@ dave::ip route del 10.1.0.0/16 via 192.168.0.1
winnetou::ip route del 10.1.0.0/16 via 192.168.0.1
alice::ipsec stop
alice::service apache2 stop
alice::umount /etc/pts
alice::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
@@ -6,13 +6,10 @@ carol::cat /etc/tnc_config
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
dave::cat /etc/tnc_config
alice::mv /etc/pts/data1.sql /tmp/
alice::mount -t ramfs -o size=5m ramfs /etc/pts
alice::mv /tmp/data1.sql /etc/pts/
alice::sed -i "s/NOW/`date +%s`/g" /etc/pts/data1.sql
alice::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
alice::chgrp -R www-data /etc/pts; chmod -R g+w /etc/pts
alice::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
alice::chgrp -R www-data /etc/db.d/config.db; chmod -R g+w /etc/db.d/config.db
alice::/var/www/tnc/manage.py setpassword strongSwan strongSwan
alice::service apache2 start
alice::ipsec start
@@ -20,7 +20,6 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="carol moon dave alice"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="alice"
@@ -15,7 +15,7 @@ charon {
}
libimcv {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
plugins {
imv-attestation {
@@ -28,5 +28,5 @@ libimcv {
attest {
load = random nonce openssl sqlite
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
}
@@ -5,4 +5,3 @@ moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::umount /etc/pts
@@ -3,11 +3,8 @@ carol::iptables-restore < /etc/iptables.rules
dave::iptables-restore < /etc/iptables.rules
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
moon::mv /etc/pts/data1.sql /tmp/
moon::mount -t ramfs -o size=5m ramfs /etc/pts
moon::mv /tmp/data1.sql /etc/pts/
moon::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
@@ -20,7 +20,7 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="moon carol dave"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="moon"
@@ -17,7 +17,7 @@ charon {
}
libimcv {
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
policy_script = ipsec imv_policy_manager
plugins {
imv-attestation {
@@ -28,5 +28,5 @@ libimcv {
attest {
load = random nonce openssl sqlite
database = sqlite:///etc/pts/config.db
database = sqlite:///etc/db.d/config.db
}
@@ -5,4 +5,3 @@ moon::iptables-restore < /etc/iptables.flush
carol::iptables-restore < /etc/iptables.flush
dave::iptables-restore < /etc/iptables.flush
carol::echo 1 > /proc/sys/net/ipv4/ip_forward
moon::umount /etc/pts
+1 -4
View File
@@ -3,11 +3,8 @@ carol::iptables-restore < /etc/iptables.rules
dave::iptables-restore < /etc/iptables.rules
carol::echo 0 > /proc/sys/net/ipv4/ip_forward
dave::echo aabbccddeeff11223344556677889900 > /var/lib/dbus/machine-id
moon::mv /etc/pts/data1.sql /tmp/
moon::mount -t ramfs -o size=5m ramfs /etc/pts
moon::mv /tmp/data1.sql /etc/pts/
moon::sed -i "s:DEBIAN_VERSION:\`cat /etc/debian_version\`:" /etc/pts/data1.sql
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/pts/config.db
moon::cd /usr/local/share/strongswan/templates/database/imv; cat tables.sql data.sql /etc/pts/data1.sql | sqlite3 /etc/db.d/config.db
moon::cat /etc/tnc_config
carol::cat /etc/tnc_config
dave::cat /etc/tnc_config
+2 -2
View File
@@ -20,7 +20,7 @@ TCPDUMPHOSTS="moon"
#
IPSECHOSTS="moon carol dave"
# Guest instances on which FreeRadius is started
# Guest instances on which databases are used
#
RADIUSHOSTS=
DBHOSTS="moon"