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 } #################################################