BIND 10 trac3146, updated. 05a05d810be754e7a4d8ca181550867febf6dcc6 [3146] Minor changes after review:
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 11 15:14:38 UTC 2013
The branch, trac3146 has been updated
via 05a05d810be754e7a4d8ca181550867febf6dcc6 (commit)
from 346892cca6784b947e11efb446f53676b143e4d6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 05a05d810be754e7a4d8ca181550867febf6dcc6
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Wed Sep 11 17:14:19 2013 +0200
[3146] Minor changes after review:
- LeaseType is now initalized from static array
- @todos added in 2 MySQL tests
- Added a comment about lease type values to MySQL schema
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcpsrv/dhcpdb_create.mysql | 4 +++-
src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc | 2 ++
src/lib/dhcpsrv/tests/test_utils.cc | 12 ++++++++++--
3 files changed, 15 insertions(+), 3 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcpsrv/dhcpdb_create.mysql b/src/lib/dhcpsrv/dhcpdb_create.mysql
index a819061..10531e3 100644
--- a/src/lib/dhcpsrv/dhcpdb_create.mysql
+++ b/src/lib/dhcpsrv/dhcpdb_create.mysql
@@ -76,7 +76,9 @@ CREATE INDEX lease6_by_iaid_subnet_id_duid ON lease6 (iaid, subnet_id, duid);
# ... and a definition of lease6 types. This table is a convenience for
# users of the database - if they want to view the lease table and use the
-# type names, they can join this table with the lease6 table
+# type names, they can join this table with the lease6 table.
+# Make sure those values match Lease6::LeaseType enum (see src/bin/dhcpsrv/
+# lease_mgr.h)
CREATE TABLE lease6_types (
lease_type TINYINT PRIMARY KEY NOT NULL, # Lease type code.
name VARCHAR(5) # Name of the lease type
diff --git a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
index 25bf1c8..52a39e9 100644
--- a/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
+++ b/src/lib/dhcpsrv/tests/mysql_lease_mgr_unittest.cc
@@ -824,6 +824,7 @@ TEST_F(MySqlLeaseMgrTest, getLease4ClientIdSubnetId) {
///
/// Adds leases to the database and checks that they can be accessed via
/// a combination of DIUID and IAID.
+/// @todo: update this test once type checking/filtering is implemented
TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
// Get the leases to be used for the test.
vector<Lease6Ptr> leases = createLeases6();
@@ -870,6 +871,7 @@ TEST_F(MySqlLeaseMgrTest, getLease6DuidIaid) {
// @brief Get Lease4 by DUID and IAID (2)
//
// Check that the system can cope with a DUID of any size.
+/// @todo: update this test once type checking/filtering is implemented
TEST_F(MySqlLeaseMgrTest, getLease6DuidIaidSize) {
// Create leases, although we need only one.
diff --git a/src/lib/dhcpsrv/tests/test_utils.cc b/src/lib/dhcpsrv/tests/test_utils.cc
index 01f2bb8..85b2423 100644
--- a/src/lib/dhcpsrv/tests/test_utils.cc
+++ b/src/lib/dhcpsrv/tests/test_utils.cc
@@ -36,6 +36,13 @@ const char* ADDRESS6[] = {
NULL
};
+// Lease types that correspond to ADDRESS6 leases
+static const Lease6::LeaseType LEASETYPE6[] = {
+ Lease6::LEASE_IA_NA, Lease6::LEASE_IA_TA, Lease6::LEASE_IA_PD,
+ Lease6::LEASE_IA_NA, Lease6::LEASE_IA_TA, Lease6::LEASE_IA_PD,
+ Lease6::LEASE_IA_NA, Lease6::LEASE_IA_TA
+};
+
void
detailCompareLease(const Lease4Ptr& first, const Lease4Ptr& second) {
// Compare address strings. Comparison of address objects is not used, as
@@ -109,8 +116,9 @@ GenericLeaseMgrTest::GenericLeaseMgrTest()
IOAddress ioaddr(addr);
ioaddress6_.push_back(ioaddr);
- /// Let's create different lease types
- leasetype6_.push_back(static_cast<Lease6::LeaseType>(i%3));
+ /// Let's create different lease types. We use LEASETYPE6 values as
+ /// a template
+ leasetype6_.push_back(LEASETYPE6[i]);
}
}
More information about the bind10-changes
mailing list