From 7cd452f07a8ed33e4b4fde5dba6acf6ee149bfcf Mon Sep 17 00:00:00 2001 From: BrandonRomano Date: Thu, 21 Jul 2016 08:38:09 -0400 Subject: [PATCH] Import interface after closing database --- lib/sql.sh | 1 + test.sh | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/lib/sql.sh b/lib/sql.sh index 02d7b4a..11ccb7c 100644 --- a/lib/sql.sh +++ b/lib/sql.sh @@ -38,5 +38,6 @@ Sql__open() { # Shuts down the database ################################################# Sql__close() { + . "$Sql__PACKAGE_LOCATION/lib/drivers/interface.sh" Sql_driver_close } diff --git a/test.sh b/test.sh index a394260..edffb6f 100644 --- a/test.sh +++ b/test.sh @@ -115,6 +115,14 @@ Sql_test_generic_open() { echo "'Sql__close' returned an error" return 1 fi + + # Test connection + local ping_output + ping_output=$(Sql__ping) + if [[ $? -eq 0 ]]; then + echo "Database not closed properly, can still ping the database after closing" + return 1 + fi } #################################################