-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Have basics of a configuration generation tool for expanded testing. …
…I foresee much more expanded functionality in the future and a lot of potential. This will require some possible rework of some existing code, however, as well as integration tests to make use of this proposed functionality. Also reorganized config files into their own directory which seems neater. Also needed to fix docker stff. Might need to revert docker stuff. Not sure how that will affect others. Signed-off-by: Yiannis Karavas <[email protected]>
- Loading branch information
Showing
28 changed files
with
1,378 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
2pc=1 | ||
sentinel_count=1 | ||
shard_count=1 | ||
coordinator_count=1 | ||
coordinator_max_threads=1 | ||
election_timeout_upper=4000 | ||
election_timeout_lower=3000 | ||
heartbeat=1000 | ||
raft_max_batch=100000 | ||
snapshot_distance=1000000000 | ||
batch_size=1 | ||
wait_for_followers=0 | ||
loadgen_invalid_tx_rate=0.00 | ||
loadgen_fixed_tx_rate=0.01 | ||
loadgen_sendtx_output_count=1 | ||
loadgen_sendtx_input_count=1 | ||
initial_mint_count=20000 | ||
initial_mint_value=100 | ||
tmpl_randomize_values=1 | ||
tmpl_shard_start=0 | ||
tmpl_shard_size=255 | ||
tmpl_max_shard_raft_replication_count=1 | ||
tmpl_avg_shard_start_end_overlap_percent=0.15 | ||
tmpl_max_coordinator_raft_replication_count=1 | ||
tmpl_default_log_level="INFO" | ||
tmpl_universal_override_log_level="WARN" | ||
tmpl_sentinel_log_level="WARN" | ||
tmpl_coordinator_log_level="DEBUG" | ||
tmpl_shard_log_level="DEBUG" | ||
num_wallets=10 | ||
num_minters=1 | ||
num_redeemers=1 | ||
total_number_of_transactions=100 | ||
avg_mint_value=10 | ||
avg_mint_count=10 | ||
avg_redemption_value=5 | ||
avg_redemption_count=5 | ||
transaction_frequency=5 | ||
mint_frequency=0.1 | ||
redemption_frequency=0.05 | ||
sentinel_offline_probability=0.01 | ||
shard_offline_probability=0.01 | ||
coordinator_offline_probability=0.01 | ||
randomize_execution=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
2pc=0 | ||
archiver_count=1 | ||
atomizer_count=1 | ||
shard_count=1 | ||
sentinel_count=1 | ||
watchtower_count=1 | ||
target_block_interval=3000 | ||
stxo_cache_depth=2 | ||
target_block_interval=250 | ||
election_timeout_upper=4000 | ||
election_timeout_lower=3000 | ||
heartbeat=1000 | ||
raft_max_batch=100000 | ||
snapshot_distance=1000000000 | ||
batch_size=1 | ||
wait_for_followers=0 | ||
loadgen_invalid_tx_rate=0.00 | ||
loadgen_fixed_tx_rate=0.01 | ||
loadgen_sendtx_output_count=1 | ||
loadgen_sendtx_input_count=1 | ||
initial_mint_count=20000 | ||
initial_mint_value=100 | ||
tmpl_randomize_values=1 | ||
tmpl_shard_start=0 | ||
tmpl_shard_size=255 | ||
tmpl_avg_shard_start_end_overlap_percent=0.15 | ||
tmpl_default_log_level="INFO" | ||
tmpl_sentinel_log_level="DEBUG" | ||
tmpl_shard_log_level="INFO" | ||
tmpl_watchtower_log_level="DEBUG" | ||
tmpl_archiver_log_level="DEBUG" | ||
tmpl_atomizer_log_level="DEBUG" |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Copyright (c) 2022 MIT Digital Currency Initiative, | ||
// Federal Reserve Bank of Boston | ||
// MITRE Corporation | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include "tools/config_generator/config_generator.hpp" | ||
#include "util/common/config.hpp" | ||
|
||
#include <filesystem> | ||
#include <gtest/gtest.h> | ||
#include <string> | ||
|
||
// TODO: Add file parsing tests. | ||
|
||
class config_generation_validation_test : public ::testing::Test { | ||
protected: | ||
void SetUp() override { | ||
template_file_atomizer | ||
= "../config/unit/atomizer_template_unit_test.tmpl"; | ||
template_file_2pc = "../config/unit/2pc_template_unit_test.tmpl"; | ||
port_num = 5555; | ||
} | ||
|
||
std::string template_file_atomizer; | ||
std::string template_file_2pc; | ||
size_t port_num; | ||
}; | ||
|
||
TEST_F(config_generation_validation_test, | ||
generate_configuration_file_atomizer_test) { | ||
// Assumes build dir is "build". Cannot find a way around this since unit | ||
// tests can be run from either root dir or build dir and we don't | ||
// necessarily know which one | ||
std::string build_dir = "build"; | ||
cbdc::generate_config::config_generator new_config_gen( | ||
template_file_atomizer, | ||
port_num, | ||
build_dir); | ||
auto cfg_or_err = new_config_gen.generate_configuration_file(); | ||
ASSERT_EQ(cfg_or_err, "SUCCESS"); | ||
// TODO | ||
// Reload generate file and check values | ||
// Delete generated file | ||
} | ||
|
||
TEST_F(config_generation_validation_test, | ||
generate_configuration_file_two_phase_test) { | ||
// Assumes build dir is "build". Cannot find a way around this since unit | ||
// tests can be run from either root dir or build dir and we don't | ||
// necessarily know which one | ||
std::string build_dir = "build"; | ||
cbdc::generate_config::config_generator new_config_gen(template_file_2pc, | ||
port_num, | ||
build_dir); | ||
auto cfg_or_err = new_config_gen.generate_configuration_file(); | ||
ASSERT_EQ(cfg_or_err, "SUCCESS"); | ||
// TODO | ||
// Reload generate file and check values | ||
// Delete generated file | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
2pc=1 | ||
sentinel_count=1 | ||
shard_count=1 | ||
coordinator_count=1 | ||
coordinator_max_threads=1 | ||
election_timeout_upper=4000 | ||
election_timeout_lower=3000 | ||
heartbeat=1000 | ||
raft_max_batch=100000 | ||
snapshot_distance=1000000000 | ||
batch_size=1 | ||
wait_for_followers=0 | ||
loadgen_invalid_tx_rate=0.00 | ||
loadgen_fixed_tx_rate=0.01 | ||
loadgen_sendtx_output_count=1 | ||
loadgen_sendtx_input_count=1 | ||
initial_mint_count=20000 | ||
initial_mint_value=100 | ||
tmpl_randomize_values=1 | ||
tmpl_shard_start=0 | ||
tmpl_shard_size=255 | ||
tmpl_max_shard_raft_replication_count=1 | ||
tmpl_avg_shard_start_end_overlap_percent=0.15 | ||
tmpl_max_coordinator_raft_replication_count=1 | ||
tmpl_default_log_level="INFO" | ||
tmpl_universal_override_log_level="WARN" | ||
tmpl_sentinel_log_level="WARN" | ||
tmpl_coordinator_log_level="DEBUG" | ||
tmpl_shard_log_level="DEBUG" | ||
num_wallets=10 | ||
num_minters=1 | ||
num_redeemers=1 | ||
total_number_of_transactions=100 | ||
avg_mint_value=10 | ||
avg_mint_count=10 | ||
avg_redemption_value=5 | ||
avg_redemption_count=5 | ||
transaction_frequency=5 | ||
mint_frequency=0.1 | ||
redemption_frequency=0.05 | ||
sentinel_offline_probability=0.01 | ||
shard_offline_probability=0.01 | ||
coordinator_offline_probability=0.01 | ||
randomize_execution=0 |
Oops, something went wrong.