StampedValuePtr calc_tee_times(new StampedValue("calculate-tee-times", Element::create(bool(false))));
StampedValuePtr t2_percent(new StampedValue("t2-percent", Element::create(0.75)));
StampedValuePtr renew_timer(new StampedValue("renew-timer", Element::create(500)));
+ StampedValuePtr mt_enabled(new StampedValue("multi-threading/enable-multi-threading", Element::create(true)));
+ StampedValuePtr mt_pool_size(new StampedValue("multi-threading/thread-pool-size", Element::create(256)));
// Let's add all of the globals to the second backend. This will verify
// we find them there.
db2_->createUpdateGlobalParameter4(ServerSelector::ALL(), calc_tee_times);
db2_->createUpdateGlobalParameter4(ServerSelector::ALL(), t2_percent);
db2_->createUpdateGlobalParameter4(ServerSelector::ALL(), renew_timer);
+ db2_->createUpdateGlobalParameter4(ServerSelector::ALL(), mt_enabled);
+ db2_->createUpdateGlobalParameter4(ServerSelector::ALL(), mt_pool_size);
// Should parse and merge without error.
ASSERT_NO_FATAL_FAILURE(configure(base_config, CONTROL_RESULT_SUCCESS, ""));
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, calc_tee_times));
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, t2_percent));
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, renew_timer));
+ ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, mt_enabled));
+ ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, mt_pool_size));
}
// This test verifies that externally configured option definitions
StampedValuePtr server_tag(new StampedValue("server-tag", "second-server"));
StampedValuePtr decline_period(new StampedValue("decline-probation-period", Element::create(86400)));
StampedValuePtr renew_timer(new StampedValue("renew-timer", Element::create(500)));
+ StampedValuePtr mt_enabled(new StampedValue("multi-threading/enable-multi-threading", Element::create(true)));
+ StampedValuePtr mt_pool_size(new StampedValue("multi-threading/thread-pool-size", Element::create(256)));
// Let's add all of the globals to the second backend. This will verify
// we find them there.
db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), server_tag);
db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), decline_period);
db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), renew_timer);
+ db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), mt_enabled);
+ db2_->createUpdateGlobalParameter6(ServerSelector::ALL(), mt_pool_size);
// Should parse and merge without error.
ASSERT_NO_FATAL_FAILURE(configure(base_config, CONTROL_RESULT_SUCCESS, ""));
// Verify that the implicit globals from the backend are there.
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, server_tag));
ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, renew_timer));
+ ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, mt_enabled));
+ ASSERT_NO_FATAL_FAILURE(checkConfiguredGlobal(staging_cfg, mt_pool_size));
}
// This test verifies that externally configured option definitions
" } \n"
"} \n";
-
OptionDescriptorPtr opt;
// Add solmax-rt to the first backend.
opt.reset(new OptionDescriptor(
const std::string &name,
ConstElementPtr exp_value) {
ConstCfgGlobalsPtr globals = srv_cfg->getConfiguredGlobals();
- ConstElementPtr found_global = globals->get(name);
+ std::string name_elem = name;
+ std::string sub_elem;
+ auto pos = name_elem.find('/');
+ if (pos != std::string::npos) {
+ sub_elem = name_elem.substr(pos + 1);
+ name_elem = name_elem.substr(0, pos);
+ }
+
+ ConstElementPtr found_global = globals->get(name_elem);
ASSERT_TRUE(found_global) << "expected global: "
- << name << " not found";
+ << name_elem << " not found";
+
+ if (!sub_elem.empty()) {
+ ASSERT_EQ(Element::map, found_global->getType())
+ << "expected global: " << name_elem << " has wrong type";
+ found_global = found_global->get(sub_elem);
+ ASSERT_TRUE(found_global) << "expected global: "
+ << name << " not found";
+ }
ASSERT_EQ(exp_value->getType(), found_global->getType())
<< "expected global: " << name << " has wrong type";
checkConfiguredGlobal(srv_cfg, exp_global->getName(), exp_global->getElementValue());
}
-
void
GenericBackendTest::testNewAuditEntry(const std::string& exp_object_type,
const AuditEntry::ModificationType& exp_modification_type,