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() {
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.
# 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.
# 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.
# 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";
# 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"
# 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=\
# 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.
# 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"
# 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"
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=\
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.