From cf4521d98d325607cead6af441c2e5fea18e2a06 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 1 Jun 2007 17:01:32 +0000 Subject: [PATCH] Test cleanup: remove test database if 'python manage.py test' crashes - Legacy-Id: 205 --- test/shell-utils | 2 +- test/test-setup | 2 +- test/test-teardown | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/shell-utils b/test/shell-utils index 3cd3d7a1a..9a7cd8eaf 100644 --- a/test/shell-utils +++ b/test/shell-utils @@ -43,5 +43,5 @@ function py_module_file() { } -trap 'echo "$program($LINENO): Command failed with error code $? ($0 $*)"; exit 1' ERR +#trap 'echo "$program($LINENO): Command failed with error code $? ($0 $*)"; exit 1' ERR diff --git a/test/test-setup b/test/test-setup index 895c20f3d..af130f27d 100755 --- a/test/test-setup +++ b/test/test-setup @@ -49,7 +49,7 @@ cd $build settings_local=$(py_module_file "settings_local") [ "$settings_local" ] || err -cat $settings_local test/settings_local_test.py - > ietf/settings_local.py +cat $settings_local test/settings_local_test.py > ietf/settings_local.py exit $warnings diff --git a/test/test-teardown b/test/test-teardown index 478d3601f..4265cce78 100755 --- a/test/test-teardown +++ b/test/test-teardown @@ -14,9 +14,9 @@ build=$PWD # Database Cleanup # Make sure the test database has been removed -python ietf/manage.py dbshell <<-EOT - drop database test_ietf; - exit; - EOT +if echo "show databases;" | python ietf/manage.py dbshell | grep test_ietf; then + echo "drop database test_ietf;" | python ietf/manage.py dbshell + echo "test database removed." +fi exit $warnings