From f9c070802feb5bf1586ba9ed4504d3c39dac03b6 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Thu, 15 Oct 2026 11:53:50 +0900 Subject: [PATCH] Fix ACLlogin tests --- 4dev/tests/ACL/CoreLibsACLLoginTest.php | 4 +++- .../ACL/CoreLibsACLLogin_database_prepare.sh | 15 ++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/4dev/tests/ACL/CoreLibsACLLoginTest.php b/4dev/tests/ACL/CoreLibsACLLoginTest.php index 2be4285c..eedaa3a7 100644 --- a/4dev/tests/ACL/CoreLibsACLLoginTest.php +++ b/4dev/tests/ACL/CoreLibsACLLoginTest.php @@ -46,7 +46,8 @@ final class CoreLibsACLLoginTest extends TestCase // database/CoreLibsACLLogin_database_create_data.sql $load_sql_file = __DIR__ . DIRECTORY_SEPARATOR - . 'database/CoreLibsACLLogin_database_create_data.sql'; + . 'database' . DIRECTORY_SEPARATOR + . 'CoreLibsACLLogin_database_create_data.sql'; if (!is_file($load_sql_file)) { self::markTestIncomplete( 'Missing ACL\Login database load SQL file' @@ -63,6 +64,7 @@ final class CoreLibsACLLoginTest extends TestCase . "CoreLibsACLLogin_database_prepare.sh " . "$load_sql_file " . "$db_user " + . "$db_password " . "$db_name " . "$db_host "; exec($command, $ouput, $result); diff --git a/4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh b/4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh index 012b17ae..d7671f81 100755 --- a/4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh +++ b/4dev/tests/ACL/CoreLibsACLLogin_database_prepare.sh @@ -22,31 +22,32 @@ if ! command -v dropdb &> /dev/null || ! command -v createdb &> /dev/null || ! c fi; db_user="${2}"; -db_name="${3}"; -db_host="${4}"; +db_password="${3}"; +db_name="${4}"; +db_host="${5}"; # empty db name or db user -> exit with 2 -if [ -z "${db_user}" ] || [ -z "${db_name}" ] || [ -z "${db_host}" ]; then +if [ -z "${db_user}" ] || [ -z "${db_name}" ] || [ -z "${db_password}" ] || [ -z "${db_host}" ]; then echo 2; exit 2; fi; # drop database, on error exit with 3 -dropdb -U "${db_user}" -h "${db_host}" "${db_name}" 2>&1; +PGPASSWORD="${db_password}" dropdb -U "${db_user}" -h "${db_host}" "${db_name}" 2>&1; if [ ! $? ]; then echo 3; exit 3; fi; # create database, on error exit with 4 -createdb -U "${db_user}" -O "${db_user}" -h "${db_host}" -E utf8 "${db_name}" 2>&1; +PGPASSWORD="${db_password}" createdb -U "${db_user}" -O "${db_user}" -h "${db_host}" -E utf8 "${db_name}" 2>&1; if [ ! $? ]; then echo 4; exit 4; fi; # if error 5 thrown, test with enabled below if [ -n "${5}" ]; then - psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}"; + PGPASSWORD="${db_password}" psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}"; else # load data (redirect ALL error to null), on error exit with 5 - psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}" 2>&1 1>/dev/null 2>/dev/null; + PGPASSWORD="${db_password}" psql -U "${db_user}" -h "${db_host}" -f "${load_sql}" "${db_name}" 2>&1 1>/dev/null 2>/dev/null; fi; if [ ! $? ]; then echo 5;