diff options
Diffstat (limited to 'src/bin/admin/tests/pgsql_tests.sh.in')
-rw-r--r-- | src/bin/admin/tests/pgsql_tests.sh.in | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/bin/admin/tests/pgsql_tests.sh.in b/src/bin/admin/tests/pgsql_tests.sh.in index 6fe61991a9..da91db5fcf 100644 --- a/src/bin/admin/tests/pgsql_tests.sh.in +++ b/src/bin/admin/tests/pgsql_tests.sh.in @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC") +# Copyright (C) 2015-2017 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 @@ -18,6 +18,7 @@ db_scripts_dir=@abs_top_srcdir@/src/share/database/scripts db_user="keatest" db_password="keatest" db_name="keatest" +db_host="localhost" # Set location of the kea-admin. keaadmin=@abs_top_builddir@/src/bin/admin/kea-admin @@ -86,9 +87,9 @@ pgsql_lease_version_test() { ${keaadmin} lease-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" - # Verfiy that kea-admin lease-version returns the correct version + # Verify that kea-admin lease-version returns the correct version version=$(${keaadmin} lease-version pgsql -u $db_user -p $db_password -n $db_name) - assert_str_eq "3.0" ${version} "Expected kea-admin to return %s, returned value was %s" + assert_str_eq "3.1" ${version} "Expected kea-admin to return %s, returned value was %s" # Let's wipe the whole database pgsql_wipe @@ -182,7 +183,7 @@ pgsql_upgrade_2_0_to_3_0() { assert_eq 1 $count "lease6DumpHeader is missing hwaddr columns" # Added hwaddr columns to lease6DumpData - output=`pgsql_execute "select hwaddr,hwttype,hwaddr_source from lease6DumpData();"` + output=`pgsql_execute "select hwaddr,hwtype,hwaddr_source from lease6DumpData();"` assert_eq 0 $ERRCODE "function lease6DumpData() broken or missing. (expected status code %d, returned %d)" # Added order by clause to lease6DumpData @@ -195,11 +196,13 @@ pgsql_upgrade_2_0_to_3_0() { output=`pgsql_execute "select count(hwaddr_source) from lease_hwaddr_source where hwaddr_source = 0 and name='HWADDR_SOURCE_UNKNOWN';"` ERRCODE=$? assert_eq 0 $ERRCODE "select from lease_hwaddr_source failed. (expected status code %d, returned %d)" - assert_eq 1 "$output" "lease_hwaddr_source does not contain entry for HWADDR_SOURCE_UKNOWN. (record count %d, expected %d)" + assert_eq 1 "$output" "lease_hwaddr_source does not contain entry for HWADDR_SOURCE_UNKNOWN. (record count %d, expected %d)" +} - # Verify upgraded schemd reports version 3.0. +pgsql_upgrade_3_0_to_3_1() { + # Verify upgraded schema reports version 3.1. version=$(${keaadmin} lease-version pgsql -u $db_user -p $db_password -n $db_name -d $db_scripts_dir) - assert_str_eq "3.0" ${version} "Expected kea-admin to return %s, returned value was %s" + assert_str_eq "3.1" ${version} "Expected kea-admin to return %s, returned value was %s" } pgsql_upgrade_test() { @@ -221,6 +224,9 @@ pgsql_upgrade_test() { # Check 2.0 to 3.0 upgrade pgsql_upgrade_2_0_to_3_0 + # Check 3.0 to 3.1 upgrade + pgsql_upgrade_3_0_to_3_1 + # Let's wipe the whole database pgsql_wipe @@ -280,7 +286,7 @@ pgsql_lease4_dump_test() { # Let's wipe the whole database pgsql_wipe - # Ok, now let's initalize the database + # Ok, now let's initialize the database ${keaadmin} lease-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" @@ -375,7 +381,7 @@ pgsql_lease6_dump_test() { # Let's wipe the whole database pgsql_wipe - # Ok, now let's initalize the database + # Ok, now let's initialize the database ${keaadmin} lease-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" |