in_bindings.addInet4(pool_end_address);
getPools(GET_POOL4_RANGE, in_bindings, pools, pool_ids);
- if (!pools.empty()) {
- break;
- }
+ // Break if something is found?
}
}
in_bindings.addOptional(subnet->getDdnsSendUpdates(Network::Inheritance::NONE));
in_bindings.addOptional(subnet->getDdnsOverrideNoUpdate(Network::Inheritance::NONE));
in_bindings.addOptional(subnet->getDdnsOverrideClientUpdate(Network::Inheritance::NONE));
- in_bindings.addOptional(subnet->getDdnsReplaceClientNameMode(Network::Inheritance::NONE));
+
+ auto ddns_rcn_mode = subnet->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
+ if (!ddns_rcn_mode.unspecified()) {
+ in_bindings.add(static_cast<uint8_t>(ddns_rcn_mode.get()));
+ } else {
+ in_bindings.addNull();
+ }
+
in_bindings.addOptional(subnet->getDdnsGeneratedPrefix(Network::Inheritance::NONE));
in_bindings.addOptional(subnet->getDdnsQualifyingSuffix(Network::Inheritance::NONE));
in_bindings.addOptional(subnet->getReservationsInSubnet(Network::Inheritance::NONE));
in_bindings.addOptional(shared_network->getDdnsSendUpdates(Network::Inheritance::NONE));
in_bindings.addOptional(shared_network->getDdnsOverrideNoUpdate(Network::Inheritance::NONE));
in_bindings.addOptional(shared_network->getDdnsOverrideClientUpdate(Network::Inheritance::NONE));
- in_bindings.addOptional(shared_network->getDdnsReplaceClientNameMode(Network::Inheritance::NONE));
+
+ auto ddns_rcn_mode = shared_network->getDdnsReplaceClientNameMode(Network::Inheritance::NONE);
+ if (!ddns_rcn_mode.unspecified()) {
+ in_bindings.add(static_cast<uint8_t>(ddns_rcn_mode.get()));
+ } else {
+ in_bindings.addNull();
+ }
+
in_bindings.addOptional(shared_network->getDdnsGeneratedPrefix(Network::Inheritance::NONE));
in_bindings.addOptional(shared_network->getDdnsQualifyingSuffix(Network::Inheritance::NONE));
in_bindings.addOptional(shared_network->getReservationsInSubnet(Network::Inheritance::NONE));
} else {
const auto& tags = server_selector.getTags();
// This test is not meant to handle multiple server tags all at once.
- if (tags.size() > 1) {
- ADD_FAILURE() << "Test error: do not use multiple server tags";
- } else if (tags.size() == 1) {
- // Get the server tag for which we run the current test.
- tag = tags.begin()->get();
- }
+ if (tags.size() != 1) {
+ ADD_FAILURE() << "Test error: tags.size(): " << tags.size()
+ << ", you must specify one and only one server tag";
+ }
+
+ // Get the server tag for which we run the current test.
+ tag = tags.begin()->get();
}
size_t new_entries_num = exp_entries.size();
namespace dhcp {
namespace test {
+/// @brief Describes an expected audit table entry.
struct ExpAuditEntry {
+ /// @brief Type of object changed.
std::string object_type;
+ /// @brief Timestamp the change occurred.
db::AuditEntry::ModificationType modification_type;
+ /// @brief Log message describing the change.
std::string log_message;
};
-- we will select.
snid BIGINT;
sid BIGINT;
- cascade_transaction BOOLEAN := true;
+ cascade_transaction BOOLEAN;
BEGIN
-- Cascade transaction flag is set to true to prevent creation of
-- the audit entries for the options when the options are
-- allow table aliases to be used with column names in update
-- set expressions.
-- -----------------------------------------------------
-CREATE OR REPLACE FUNCTION createOptionAuditDHCP6(modification_type VARCHAR(32),
+CREATE OR REPLACE FUNCTION createOptionAuditDHCP6(modification_type VARCHAR,
scope_id SMALLINT,
option_id INT,
p_subnet_id BIGINT,
host_id INT,
- network_name VARCHAR(128),
+ network_name VARCHAR,
pool_id BIGINT,
pd_pool_id BIGINT,
p_modification_ts TIMESTAMP WITH TIME ZONE)
-- we will select.
snid BIGINT;
sid BIGINT;
- cascade_transaction BOOLEAN := false;
+ cascade_transaction BOOLEAN;
BEGIN
-- Cascade transaction flag is set to true to prevent creation of
-- the audit entries for the options when the options are
-- we will select.
snid BIGINT;
sid BIGINT;
- cascade_transaction BOOLEAN := true;
+ cascade_transaction BOOLEAN;
BEGIN
-- Cascade transaction flag is set to true to prevent creation of
-- the audit entries for the options when the options are
-- allow table aliases to be used with column names in update
-- set expressions.
-- -----------------------------------------------------
-CREATE OR REPLACE FUNCTION createOptionAuditDHCP6(modification_type VARCHAR(32),
+CREATE OR REPLACE FUNCTION createOptionAuditDHCP6(modification_type VARCHAR,
scope_id SMALLINT,
option_id INT,
p_subnet_id BIGINT,
host_id INT,
- network_name VARCHAR(128),
+ network_name VARCHAR,
pool_id BIGINT,
pd_pool_id BIGINT,
p_modification_ts TIMESTAMP WITH TIME ZONE)
-- we will select.
snid BIGINT;
sid BIGINT;
- cascade_transaction BOOLEAN := false;
+ cascade_transaction BOOLEAN;
BEGIN
-- Cascade transaction flag is set to true to prevent creation of
-- the audit entries for the options when the options are