From: Andrei Pavel Date: Fri, 11 Dec 2020 15:19:12 +0000 (+0200) Subject: [#1574] reformulate some error messages X-Git-Tag: Kea-1.9.3~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1d7bf22aa3c3b031a00925f7a58c538ed4db429;p=thirdparty%2Fkea.git [#1574] reformulate some error messages --- diff --git a/src/bin/admin/tests/cql_tests.sh.in b/src/bin/admin/tests/cql_tests.sh.in index 0ede814595..bdf4113c3f 100644 --- a/src/bin/admin/tests/cql_tests.sh.in +++ b/src/bin/admin/tests/cql_tests.sh.in @@ -33,7 +33,7 @@ cql_wipe() { # Wipe the database. run_command \ cql_execute_script $db_scripts_dir/cql/dhcpdb_drop.cql - assert_eq 0 "${EXIT_CODE}" "drop table query failed, exit code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "drop table query failed, expected %d, returned %d" } cql_db_init_test() { diff --git a/src/bin/admin/tests/mysql_tests.sh.in b/src/bin/admin/tests/mysql_tests.sh.in index f3e26029f5..cd260838c7 100644 --- a/src/bin/admin/tests/mysql_tests.sh.in +++ b/src/bin/admin/tests/mysql_tests.sh.in @@ -69,7 +69,7 @@ mysql_wipe() { run_command \ mysql_execute_script "${db_scripts_dir}/mysql/dhcpdb_drop.mysql" - assert_eq 0 "${EXIT_CODE}" "mysql-wipe: drop table sql failed, exit code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "mysql-wipe: drop table sql failed, epected %d, returned %d" } mysql_db_init_test() { @@ -82,7 +82,7 @@ mysql_db_init_test() { run_command \ "${kea_admin}" db-init mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql failed, expected %d, returned non-zero status code %d" # Ok, now let's check if the tables are indeed there. # First table: schema_version. Should have 2 columns: version and minor. @@ -163,7 +163,7 @@ mysql_host_reservation_init_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql failed, expected %d, returned non-zero status code %d" # Ok, now let's check if the tables are indeed there. # First table: schema_version. Should have 2 columns: version and minor. @@ -264,7 +264,7 @@ mysql_upgrade_test() { # Ok, we have a 1.0 database. Let's upgrade it to 9.5 run_command \ "${kea_admin}" db-upgrade mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-upgrade mysql returned non-zero status code %d, expected %d\n" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-upgrade mysql failed, expected %d, returned non-zero status code %d\n" # Let's check that the new tables are indeed there. @@ -950,7 +950,7 @@ mysql_lease4_stat_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql failed, expected %d, returned non-zero status code %d" # Verify lease4 stat table is present qry="select count(subnet_id) from lease4_stat"; @@ -1042,7 +1042,7 @@ mysql_lease6_stat_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql failed, expected %d, returned non-zero status code %d" # verify lease6 stat table is present qry="select count(subnet_id) from lease6_stat" @@ -1216,7 +1216,7 @@ mysql_lease_stat_recount_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init mysql failed, expected %d, returned non-zero status code %d" # Now we need insert some leases to "recount" qry=\ @@ -1252,7 +1252,7 @@ mysql_lease_stat_recount_test() { # Recount all statistics from scratch. run_command \ "${kea_admin}" stats-recount mysql -u "${db_user}" -p "${db_password}" -n "${db_name}" - assert_eq 0 "${EXIT_CODE}" "kea-admin stats-recount mysql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin stats-recount mysql failed, expected %d, returned non-zero status code %d" # # First we'll verify lease4_stats are correct after recount. diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 14d15d29b1..090a601c9e 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -580,7 +580,7 @@ pgsql_lease4_stat_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql failed, expected %d, returned non-zero status code %d" # Verify lease4 stat table is present qry="select count(subnet_id) from lease4_stat" @@ -672,7 +672,7 @@ pgsql_lease6_stat_test() { # Ok, now let's initialize the database run_command \ "${kea_admin}" db-init pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql failed, expected %d, returned non-zero status code %d" # verify lease6 stat table is present qry="select count(subnet_id) from lease6_stat" @@ -846,7 +846,7 @@ pgsql_lease_stat_recount_test() { run_command \ "${kea_admin}" db-init pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" -d "${db_scripts_dir}" - assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin db-init pgsql failed, expected %d, returned non-zero status code %d" # Now we need insert some leases to "recount" qry=\ @@ -883,7 +883,7 @@ pgsql_lease_stat_recount_test() { run_command \ "${kea_admin}" stats-recount pgsql -u "${db_user}" -p "${db_password}" -n "${db_name}" - assert_eq 0 "${EXIT_CODE}" "kea-admin stats-recount pgsql returned non-zero status code %d, expected %d" + assert_eq 0 "${EXIT_CODE}" "kea-admin stats-recount pgsql failed, expected %d, returned non-zero status code %d" # # First we'll verify lease4_stats are correct after recount.