# ... 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
///
/// 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();
// @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.
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
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]);
}
}