Commit ea2a8aed authored by Francis Dupont's avatar Francis Dupont
Browse files

[466-kea-admin-lease-options-to-be-renamed-to-db] Checkpoint: kea-admin lease-{^dump} -> db-* (src)

parent 82d601c1
......@@ -9,9 +9,10 @@
# This is kea-admin script that conducts administrative tasks on the Kea
# installation. Currently supported operations are:
#
# - lease database init
# - lease database version check
# - lease database version upgrade
# - database init
# - database version check
# - database version upgrade
# - lease database dump
# Get the location of the kea-admin scripts
......@@ -53,10 +54,10 @@ usage() {
printf "\n"
printf "COMMAND: Currently supported operations are:\n"
printf "\n"
printf " - lease-init: Initializes new lease database. Useful for first time installation.\n"
printf " - lease-version: Checks version of the existing lease database scheme. Useful\n"
printf " - for checking lease DB version when preparing for an upgrade.\n"
printf " - lease-upgrade: Upgrades your lease database scheme\n"
printf " - db-init: Initializes new database. Useful for first time installation.\n"
printf " - db-version: Checks version of the existing database scheme. Useful\n"
printf " - for checking databaseB version when preparing for an upgrade.\n"
printf " - dn-upgrade: Upgrades your database scheme\n"
printf " - lease-dump: Dump current leases to a CSV file\n"
printf "\n"
printf "BACKEND - one of the supported backends: memfile|mysql|pgsql|cql\n"
......@@ -124,7 +125,7 @@ is_in_list() {
### Functions that implement database initialization commands
memfile_init() {
# @todo Implement this as part of #3601
# Useless as Kea converts CSV versions at startup.
log_error "NOT IMPLEMENTED"
exit 1
}
......@@ -165,7 +166,7 @@ mysql_init() {
printf "mysql returned status code %s\n" "$ERRCODE"
if [ "$ERRCODE" -eq 0 ]; then
printf "Lease DB version reported after initialization: "
printf "Database version reported after initialization: "
mysql_version
printf "\n"
fi
......@@ -202,7 +203,7 @@ pgsql_init() {
fi
version=$(pgsql_version)
printf "Lease DB version reported after initialization: %s\n" "$version"
printf "Database version reported after initialization: %s\n" "$version"
exit 0
}
......@@ -222,21 +223,21 @@ cql_init() {
fi
version=$(cql_version)
printf "Lease DB version reported after initialization: %s\n" "$version"
printf "Database version reported after initialization: %s\n" "$version"
exit 0
}
### Functions that implement database version checking commands
memfile_version() {
# @todo Implement this as part of #3601
# @todo Implement this?
log_error "NOT IMPLEMENTED"
exit 1
}
### Functions used for upgrade
memfile_upgrade() {
# @todo Implement this as part of #3601
# Useless as Kea converts CSV versions at startup.
log_error "NOT IMPLEMENTED"
exit 1
}
......@@ -249,7 +250,7 @@ memfile_upgrade() {
# This function prints version before and after upgrade.
mysql_upgrade() {
printf "Lease DB version reported before upgrade: "
printf "Database version reported before upgrade: "
mysql_version
printf "\n"
......@@ -272,14 +273,14 @@ mysql_upgrade() {
sh "${script}" --host="${db_host}" --user="${db_user}" --password="${db_password}" "${db_name}"
done
printf "Lease DB version reported after upgrade: "
printf "Database version reported after upgrade: "
mysql_version
printf "\n"
}
pgsql_upgrade() {
version=$(pgsql_version)
printf "Lease DB version reported before upgrade: %s\n" "$version"
printf "Database version reported before upgrade: %s\n" "$version"
# Check if the scripts directory exists at all.
if [ ! -d ${scripts_dir}/pgsql ]; then
......@@ -305,13 +306,13 @@ pgsql_upgrade() {
done
version=$(pgsql_version)
printf "Lease DB version reported after upgrade: %s\n" "$version"
printf "Database version reported after upgrade: %s\n" "$version"
exit 0
}
cql_upgrade() {
version=$(cql_version)
printf "Lease DB version reported before upgrade: %s\n" "$version"
printf "Database version reported before upgrade: %s\n" "$version"
# Check if the scripts directory exists at all.
if [ ! -d ${scripts_dir}/cql ]; then
......@@ -339,7 +340,7 @@ cql_upgrade() {
fi
version=$(cql_version)
printf "Lease DB version reported after upgrade: %s\n" "$version"
printf "Database version reported after upgrade: %s\n" "$version"
exit 0
}
......@@ -553,7 +554,7 @@ if test "${command}" = "-v" || test "${command}" = "--version" ; then
exit 0
fi
is_in_list "${command}" "lease-init lease-version lease-upgrade lease-dump"
is_in_list "${command}" "db-init db-version db-upgrade lease-dump"
if [ ${_inlist} -eq 0 ]; then
log_error "invalid command: ${command}"
exit 1
......@@ -666,7 +667,7 @@ done
case ${command} in
# Initialize the database
lease-init)
db-init)
case ${backend} in
memfile)
memfile_init
......@@ -682,7 +683,7 @@ case ${command} in
;;
esac
;;
lease-version)
db-version)
case ${backend} in
memfile)
memfile_version
......@@ -699,7 +700,7 @@ case ${command} in
;;
esac
;;
lease-upgrade)
db-upgrade)
case ${backend} in
memfile)
memfile_upgrade
......
<!--
- Copyright (C) 2014-2018 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
......@@ -75,27 +75,27 @@
<variablelist>
<varlistentry>
<term>lease-init</term>
<term>db-init</term>
<listitem>
<para>Initializes a new lease database. Useful during first Kea
<para>Initializes a new database. Useful during first Kea
installation. The database is initialized to the latest version
supported by the version of the software.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lease-version</term>
<term>db-version</term>
<listitem>
<para>Reports lease database version. This is not necessarily
<para>Reports database version. This is not necessarily
equal to Kea version as each backend has its own versioning
scheme.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>lease-upgrade</term>
<term>db-upgrade</term>
<listitem>
<para>Conducts lease database upgrade. This is useful when
<para>Conducts database upgrade. This is useful when
migrating between old and new Kea versions.</para>
</listitem>
</varlistentry>
......
......@@ -28,15 +28,15 @@ cql_wipe() {
assert_eq 0 $? "drop table query failed, exit code %d, expected %d"
}
cql_lease_init_test() {
cql_db_init_test() {
test_start "cql.init"
# Wipe the database.
cql_wipe
# Create the database
$keaadmin lease-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin lease-init cql failed, expected exit code: %d, actual: %d"
$keaadmin db-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
# Verify that all the expected tables exist
......@@ -64,8 +64,8 @@ cql_lease_init_test() {
# check
echo ""
echo "Making sure keyspace creation fails the second time..."
$keaadmin lease-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 2 $? "kea-admin failed to deny lease-init, expected exit code: %d, actual: %d"
$keaadmin db-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 2 $? "kea-admin failed to deny db-init, expected exit code: %d, actual: %d"
# Wipe the database.
cql_wipe
......@@ -73,18 +73,18 @@ cql_lease_init_test() {
test_finish 0
}
cql_lease_version_test() {
cql_db_version_test() {
test_start "cql.version"
# Wipe the database.
cql_wipe
# Create the database.
$keaadmin lease-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin lease-init cql failed, expected exit code: %d, actual: %d"
$keaadmin db-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
# Verify that kea-admin lease-version returns the correct version.
version=$($keaadmin lease-version cql -u $db_user -p $db_password -n $db_name)
# Verify that kea-admin db-version returns the correct version.
version=$($keaadmin db-version cql -u $db_user -p $db_password -n $db_name)
assert_str_eq "4.0" $version "Expected kea-admin to return %s, returned value was %s"
# Wipe the database.
......@@ -103,8 +103,8 @@ cql_upgrade_test() {
cql_execute_script @abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.cql
assert_eq 0 $? "cannot initialize the database, expected exit code: %d, actual: %d"
$keaadmin lease-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "lease-upgrade failed, expected exit code: %d, actual: %d"
$keaadmin db-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "db-upgrade failed, expected exit code: %d, actual: %d"
# Wipe the database.
cql_wipe
......@@ -138,8 +138,8 @@ cql_lease4_dump_test() {
cql_wipe
# Create the database
$keaadmin lease-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin lease-init cql failed, expected exit code: %d, actual: %d"
$keaadmin db-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin db-init cql failed, expected exit code: %d, actual: %d"
# Insert the reference record.
# -1073741302 corresponds to 192.0.2.10
......@@ -211,7 +211,7 @@ cql_lease6_dump_test() {
cql_wipe
# Create the database.
$keaadmin lease-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
$keaadmin db-init cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "could not create database, expected exit code %d, actual %d"
# Insert the reference record.
......@@ -330,7 +330,7 @@ cql_unused_subnet_id_test() {
assert_eq 0 $? "insert hosts failed, expected exit code: %d, actual: %d"
# Ok, we have a 2.0 database with hosts and options. Let's upgrade it.
${keaadmin} lease-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
# Upgrade should succeed
......@@ -422,7 +422,7 @@ cql_upgrade_hosts_test() {
assert_eq 0 $? "insert hosts failed, expected exit code: %d, actual: %d"
# Ok, we have a 3.0 database with hosts and options. Let's upgrade it.
${keaadmin} lease-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade cql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
# Upgrade should succeed
......@@ -467,8 +467,8 @@ cql_upgrade_hosts_test() {
# Run tests.
cql_lease_init_test
cql_lease_version_test
cql_db_init_test
cql_db_version_test
cql_upgrade_test
cql_lease4_dump_test
cql_lease6_dump_test
......
-- Copyright (C) 2018-2019 Internet Systems Consortium, Inc. ("ISC")
-- Copyright (C) 2015-2017 Deutsche Telekom AG.
-- Author: Razvan Becheriu <razvan.becheriu@qualitance.com>
......@@ -31,7 +32,7 @@
-- SOURCE dhcpdb_create.cql
-- This script is also called from kea-admin, see kea-admin lease-init cql
-- This script is also called from kea-admin, see kea-admin db-init cql
-- Over time, Kea database schema will evolve. Each version is marked with
-- major.minor version. This file is organized sequentially, i.e. database
......
......@@ -64,17 +64,17 @@ mysql_wipe() {
assert_eq 0 $ERRCODE "mysql-wipe: drop table sql failed, exit code %d, expected %d"
}
mysql_lease_init_test() {
test_start "mysql.lease-init"
mysql_db_init_test() {
test_start "mysql.db-init"
# Let's wipe the whole database
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init mysql returned non-zero status code %d, expected %d"
# Ok, now let's check if the tables are indeed there.
# First table: schema_version. Should have 2 columns: version and minor.
......@@ -118,8 +118,8 @@ EOF
test_finish 0
}
mysql_lease_version_test() {
test_start "mysql.lease-version"
mysql_db_version_test() {
test_start "mysql.db-version"
# Let's wipe the whole database
mysql_wipe
......@@ -133,7 +133,7 @@ CREATE TABLE schema_version (
INSERT INTO schema_version VALUES (1, 7);
EOF
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name)
version=$(${keaadmin} db-version mysql -u $db_user -p $db_password -n $db_name)
assert_str_eq "1.7" ${version} "Expected kea-admin to return %s, returned value was %s"
......@@ -150,10 +150,10 @@ mysql_host_reservation_init_test() {
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init mysql returned non-zero status code %d, expected %d"
# Ok, now let's check if the tables are indeed there.
# First table: schema_version. Should have 2 columns: version and minor.
......@@ -254,7 +254,7 @@ mysql_upgrade_test() {
mysql -u$db_user -p$db_password $db_name < @abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.mysql
# Sanity check - verify that it reports version 1.0.
version=$(${keaadmin} lease-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
version=$(${keaadmin} db-version mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
assert_str_eq "1.0" ${version} "Expected kea-admin to return %s, returned value was %s"
......@@ -262,7 +262,7 @@ mysql_upgrade_test() {
${keaadmin} lease-upgrade mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-upgrade mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-upgrade mysql returned non-zero status code %d, expected %d"
# Let's check that the new tables are indeed there.
......@@ -746,7 +746,7 @@ mysql_lease4_dump_test() {
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "could not create database, expected exit code %d, actual %d"
......@@ -806,7 +806,7 @@ mysql_lease6_dump_test() {
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "could not create database, expected exit code %d, actual %d"
......@@ -850,9 +850,9 @@ mysql_lease4_stat_test() {
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init mysql returned non-zero status code %d, expected %d"
# Verify lease4 stat table is present
qry="select count(subnet_id) from lease4_stat";
......@@ -942,10 +942,10 @@ mysql_lease6_stat_test() {
mysql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init mysql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init mysql returned non-zero status code %d, expected %d"
# verify lease6 stat table is present
qry="select count(subnet_id) from lease6_stat"
......@@ -1001,7 +1001,7 @@ mysql_lease_stat_upgrade_test() {
run_statement "insert v6 leases" "$qry"
# Ok, we have a 4.0 database with leases. Let's upgrade it to 6.0
${keaadmin} lease-upgrade mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
#
......@@ -1149,7 +1149,7 @@ mysql_unused_subnet_id_test() {
run_statement "insert options" "$qry"
# Ok, we have a 4.0 database with hosts and options. Let's upgrade it to 5.0
${keaadmin} lease-upgrade mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade mysql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
# Upgrade should succeed
......@@ -1191,9 +1191,9 @@ mysql_unused_subnet_id_test() {
mysql_wipe
}
mysql_lease_init_test
mysql_db_init_test
mysql_host_reservation_init_test
mysql_lease_version_test
mysql_db_version_test
mysql_upgrade_test
mysql_lease4_dump_test
mysql_lease6_dump_test
......
......@@ -63,15 +63,15 @@ pgsql_wipe() {
assert_eq 0 $? "pgsql_wipe drop failed, expected exit code: %d, actual: %d"
}
pgsql_lease_init_test() {
test_start "pgsql.lease-init"
pgsql_db_init_test() {
test_start "pgsql.db-init"
# Let's wipe the whole database
pgsql_wipe
# Create the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin lease-init pgsql failed, expected exit code: %d, actual: %d"
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "kea-admin db-init pgsql failed, expected exit code: %d, actual: %d"
# Verify that all the expected tables exist
......@@ -99,8 +99,8 @@ pgsql_lease_init_test() {
# check
echo ""
echo "DB created successfully, make sure we aren't allowed to try it again:"
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 2 $? "kea-admin failed to deny lease-init, expected exit code: %d, actual: %d"
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 2 $? "kea-admin failed to deny db-init, expected exit code: %d, actual: %d"
# Let's wipe the whole database
pgsql_wipe
......@@ -108,18 +108,18 @@ pgsql_lease_init_test() {
test_finish 0
}
pgsql_lease_version_test() {
test_start "pgsql.lease-version"
pgsql_db_version_test() {
test_start "pgsql.db-version"
# Wipe the whole database
pgsql_wipe
# Create the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "cannot initialize the database, expected exit code: %d, actual: %d"
# Verify that kea-admin lease-version returns the correct version
version=$(${keaadmin} lease-version pgsql -u $db_user -p $db_password -n $db_name)
# Verify that kea-admin db-version returns the correct version
version=$(${keaadmin} db-version pgsql -u $db_user -p $db_password -n $db_name)
assert_str_eq "5.1" ${version} "Expected kea-admin to return %s, returned value was %s"
# Let's wipe the whole database
......@@ -230,9 +230,9 @@ pgsql_upgrade_2_0_to_3_0() {
assert_eq 1 "$output" "lease_hwaddr_source does not contain entry for HWADDR_SOURCE_UNKNOWN. (record count %d, expected %d)"
}
pgsql_upgrade_3_0_to_5_1() {
<pgsql_upgrade_3_0_to_5_1() {
# Verify upgraded schema reports version 5.1.
version=$(${keaadmin} lease-version pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
version=$(${keaadmin} db-version pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir)
assert_str_eq "5.1" ${version} "Expected kea-admin to return %s, returned value was %s"
# Added user_context to lease4
......@@ -261,8 +261,8 @@ pgsql_upgrade_test() {
pgsql_execute_script @abs_top_srcdir@/src/bin/admin/tests/dhcpdb_create_1.0.pgsql
assert_eq 0 $? "cannot initialize the database, expected exit code: %d, actual: %d"
${keaadmin} lease-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "lease-upgrade failed, expected exit code: %d, actual: %d"
${keaadmin} db-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
assert_eq 0 $? "db-upgrade failed, expected exit code: %d, actual: %d"
# Check 1.0 to 2.0 upgrade
pgsql_upgrade_1_0_to_2_0
......@@ -333,7 +333,7 @@ pgsql_lease4_dump_test() {
pgsql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "could not create database, expected exit code %d, actual %d"
......@@ -428,7 +428,7 @@ pgsql_lease6_dump_test() {
pgsql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "could not create database, status code %d"
......@@ -532,9 +532,9 @@ pgsql_lease4_stat_test() {
pgsql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init pgsql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init pgsql returned non-zero status code %d, expected %d"
# Verify lease4 stat table is present
qry="select count(subnet_id) from lease4_stat"
......@@ -624,10 +624,10 @@ pgsql_lease6_stat_test() {
pgsql_wipe
# Ok, now let's initialize the database
${keaadmin} lease-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-init pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
assert_eq 0 $ERRCODE "kea-admin lease-init pgsql returned non-zero status code %d, expected %d"
assert_eq 0 $ERRCODE "kea-admin db-init pgsql returned non-zero status code %d, expected %d"
# verify lease6 stat table is present
qry="select count(subnet_id) from lease6_stat"
......@@ -684,7 +684,7 @@ pgsql_lease_stat_upgrade_test() {
run_statement "insert v6 leases" "$qry"
# Ok, we have a 2.0 database with leases. Let's upgrade it to 4.0
${keaadmin} lease-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
#
......@@ -834,7 +834,7 @@ pgsql_unused_subnet_id_test() {
run_statement "insert options" "$qry"
# Ok, we have a 4.0 database with hosts and options. Let's upgrade it to 5.0
${keaadmin} lease-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
${keaadmin} db-upgrade pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir
ERRCODE=$?
# Upgrade should succeed
......@@ -877,8 +877,8 @@ pgsql_unused_subnet_id_test() {
}
pgsql_lease_init_test
pgsql_lease_version_test
pgsql_db_init_test
pgsql_db_version_test
pgsql_upgrade_test
pgsql_lease4_dump_test
pgsql_lease6_dump_test
......
......@@ -30,7 +30,7 @@
-- SOURCE dhcpdb_create.cql
-- This script is also called from kea-admin, see kea-admin lease-init cql
-- This script is also called from kea-admin, see kea-admin db-init cql
-- Over time, Kea database schema will evolve. Each version is marked with
-- major.minor version. This file is organized sequentially, i.e. database
......
......@@ -19,7 +19,7 @@
#
# source dhcpdb_create.mysql
#
# This script is also called from kea-admin, see kea-admin lease-init mysql
# This script is also called from kea-admin, see kea-admin db-init mysql
#
# Over time, Kea database schema will evolve. Each version is marked with
# major.minor version. This file is organized sequentially, i.e. database
......