提交 498b0002 编写于 作者: P Paul Calabrese

Clean up p2p tests

上级 bb7b08a8
......@@ -45,8 +45,6 @@ const static uint64_t block_timestamp_epoch = 946684800000ll; // epoch is year 2
const static int percent_100 = 10000;
const static int percent_1 = 100;
const static uint32_t required_producer_participation = 33 * config::percent_1;
static const uint32_t account_cpu_usage_average_window_ms = 24*60*60*1000l;
static const uint32_t account_net_usage_average_window_ms = 24*60*60*1000l;
static const uint32_t block_cpu_usage_average_window_ms = 60*1000l;
......
......@@ -1029,7 +1029,6 @@ launcher_def::write_config_file (tn_node_def &node) {
}
}
if (instance.has_db || node.producers.size()) {
cfg << "required-participation = 33\n";
for (const auto &kp : node.keys ) {
cfg << "private-key = [\"" << string(kp.get_public_key())
<< "\",\"" << string(kp) << "\"]\n";
......
......@@ -25,7 +25,6 @@ add_dependencies(plugin_test asserter test_api test_api_mem test_api_db test_api
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/core_symbol.py.in ${CMAKE_CURRENT_BINARY_DIR}/core_symbol.py)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_tests/dawn_515/test.sh ${CMAKE_CURRENT_BINARY_DIR}/p2p_tests/dawn_515/test.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/trans_sync_across_mixed_cluster_test.sh ${CMAKE_CURRENT_BINARY_DIR}/trans_sync_across_mixed_cluster_test.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/distributed-transactions-test.py ${CMAKE_CURRENT_BINARY_DIR}/distributed-transactions-test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/distributed-transactions-remote-test.py ${CMAKE_CURRENT_BINARY_DIR}/distributed-transactions-remote-test.py COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/sample-cluster-map.json ${CMAKE_CURRENT_BINARY_DIR}/sample-cluster-map.json COPYONLY)
......@@ -42,13 +41,12 @@ add_test(NAME plugin_test COMMAND plugin_test --report_level=detailed --color_ou
add_test(NAME nodeos_run_test COMMAND tests/nodeos_run_test.py -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME nodeos_run_remote_test COMMAND tests/nodeos_run_remote_test.py -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# TODO removed on slim: add_test(NAME p2p_dawn515_test COMMAND tests/p2p_tests/dawn_515/test.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME p2p_dawn515_test COMMAND tests/p2p_tests/dawn_515/test.sh WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
#if(BUILD_MONGO_DB_PLUGIN)
# add_test(NAME nodeos_run_test-mongodb COMMAND tests/nodeos_run_test.py --mongodb -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
#endif()
# TODO: Tests removed until working again on master.
# TODO: add_test(NAME trans_sync_across_mixed_cluster_test COMMAND tests/trans_sync_across_mixed_cluster_test.sh -p 1 -n 2 WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME distributed-transactions-test COMMAND tests/distributed-transactions-test.py -p 1 -n 4 -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_test(NAME distributed-transactions-remote-test COMMAND tests/distributed-transactions-remote-test.py -v --dump-error-detail WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
# TODO removed on slim: add_test(NAME restart-scenarios-test_resync COMMAND tests/restart-scenarios-test.py -c resync -p4 -v --dump-error-details WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
......
#!/bin/bash
#
# This test ensures that connections with the same p2p-server-address
# are not closed as redundant.
#
###############################################################
# Extracts staging directory and launchs cluster.
###############################################################
pnodes=1
total_nodes=3
total_nodes=2
topo=star
delay=1
read -d '' config00 << EOF
shared-file-size = 8192
read -d '' genesis << EOF
{
"initial_timestamp": "2018-06-01T12:00:00.000",
"initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV",
"initial_configuration": {
"max_block_net_usage": 1048576,
"target_block_net_usage_pct": 1000,
"max_transaction_net_usage": 524288,
"base_per_transaction_net_usage": 12,
"net_usage_leeway": 500,
"context_free_discount_net_usage_num": 20,
"context_free_discount_net_usage_den": 100,
"max_block_cpu_usage": 200000,
"target_block_cpu_usage_pct": 1000,
"max_transaction_cpu_usage": 150000,
"min_transaction_cpu_usage": 100,
"max_transaction_lifetime": 3600,
"deferred_trx_expiration_window": 600,
"max_transaction_delay": 3888000,
"max_inline_action_size": 4096,
"max_inline_action_depth": 4,
"max_authority_depth": 6
}
EOF
read -d '' configbios << EOF
p2p-server-address = localhost:9876
plugin = eosio::producer_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
required-participation = true
shared-file-dir = blockchain
plugin = eosio::net_plugin
plugin = eosio::history_api_plugin
http-server-address = 127.0.0.1:8888
block-log-dir = blocks
blocks-dir = blocks
p2p-listen-endpoint = 0.0.0.0:9876
allowed-connection = any
private-key = ['EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV','5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3']
send-whole-blocks = true
readonly = 0
genesis-json = ./genesis.json
producer-name = inita
producer-name = initb
producer-name = initc
producer-name = initd
producer-name = inite
producer-name = initf
producer-name = initg
producer-name = inith
producer-name = initi
producer-name = initj
producer-name = initk
producer-name = initl
producer-name = initm
producer-name = initn
producer-name = inito
producer-name = initp
producer-name = initq
producer-name = initr
producer-name = inits
producer-name = initt
producer-name = initu
p2p-max-nodes-per-host = 10
enable-stale-production = true
producer-name = eosio
EOF
read -d '' config01 << EOF
genesis-json = ./genesis.json
block-log-dir = blocks
read -d '' config00 << EOF
blocks-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
http-server-address = 127.0.0.1:8889
p2p-listen-endpoint = 0.0.0.0:9877
p2p-server-address = localhost:9877
allowed-connection = any
p2p-peer-address = localhost:9876
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
EOF
read -d '' config02 << EOF
genesis-json = ./genesis.json
block-log-dir = blocks
read -d '' config01 << EOF
blocks-dir = blocks
readonly = 0
send-whole-blocks = true
shared-file-dir = blockchain
shared-file-size = 8192
http-server-address = 127.0.0.1:8890
p2p-listen-endpoint = 0.0.0.0:9878
p2p-server-address = localhost:9877
allowed-connection = any
p2p-peer-address = localhost:9876
plugin = eosio::chain_api_plugin
plugin = eosio::account_history_plugin
plugin = eosio::account_history_api_plugin
EOF
read -d '' logging00 << EOF
read -d '' loggingbios << EOF
{
"includes": [],
"appenders": [{
......@@ -137,7 +135,7 @@ read -d '' logging00 << EOF
}
EOF
read -d '' logging01 << EOF
read -d '' logging00 << EOF
{
"includes": [],
"appenders": [{
......@@ -191,7 +189,7 @@ read -d '' logging01 << EOF
}
EOF
read -d '' logging02 << EOF
read -d '' logging01 << EOF
{
"includes": [],
"appenders": [{
......@@ -250,36 +248,58 @@ rm -rf etc/eosio/node_*
rm -rf var/lib
cName=config.ini
lName=logging.json
gName=genesis.json
path=staging/etc/eosio/node_bios
mkdir -p $path
echo "$configbios" > $path/$cName
echo "$loggingbios" > $path/$lName
echo "$genesis" > $path/$gName
path=staging/etc/eosio/node_00
mkdir -p $path
echo "$config00" > $path/$cName
echo "$logging00" > $path/$lName
echo "$genesis" > $path/$gName
path=staging/etc/eosio/node_01
mkdir -p $path
echo "$config01" > $path/$cName
echo "$logging01" > $path/$lName
path=staging/etc/eosio/node_02
mkdir -p $path
echo "$config02" > $path/$cName
echo "$logging02" > $path/$lName
echo "$genesis" > $path/$gName
programs/launcher/launcher -p $pnodes -n $total_nodes --nogen -d $delay
programs/eosio-launcher/eosio-launcher -p $pnodes -n $total_nodes --nogen -d $delay
sleep 1
res=$(grep "reason = duplicate" var/lib/node_0*/stderr.txt | wc -l)
sleep 5
res=$(grep "reason = duplicate" var/lib/node_*/stderr.txt | wc -l)
ret=0
if [ $res -ne 0 ]; then
echo FAILURE: got a \"duplicate\" message
else
echo "SUCCESS"
ret=1
fi
b5idbios=`./programs/cleos/cleos -u http://localhost:8888 get block 5 | grep "^ *\"id\""`
b5id00=`./programs/cleos/cleos -u http://localhost:8889 get block 5 | grep "^ *\"id\""`
b5id01=`./programs/cleos/cleos -u http://localhost:8890 get block 5 | grep "^ *\"id\""`
if [ "$b5idbios" != "$b5id00" ]; then
echo FAILURE: nodes are not in sync
ret=1
fi
if [ "$b5idbios" != "$b5id01" ]; then
echo FAILURE: nodes are not in sync
ret=1
fi
if [ $ret -eq 0 ]; then
echo SUCCESS
fi
programs/launcher/launcher -k 15
programs/eosio-launcher/eosio-launcher -k 15
rm -rf staging
rm -rf var/lib/node_*
rm -rf etc/eosio/node_*
exit $res
exit $ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册