ligo/src/bin_client/test/test_injection.sh
2018-06-29 04:10:30 +02:00

51 lines
951 B
Bash
Executable File

#! /usr/bin/env bash
## from genesis to demo
set -e
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
source $test_dir/test_lib.inc.sh "$@"
expected_connections=2
max_peer_id=3
for i in $(seq 1 $max_peer_id); do
echo
echo "## Starting node $i."
echo
start_node $i
echo
done
## waiting for the node to establish connections
for client in "${client_instances[@]}"; do
echo
echo "### $client bootstrapped"
echo
$client -w none config update
$client bootstrapped
echo
done
sleep 2
# autogenerated from the demo source
protocol_version="PsoXmK2EEBAsbFy7XHr8xB34jmArfrJQMRniTVdUsrSVu2VtRsr"
$admin_client inject protocol "$test_dir/demo"
$admin_client list protocols
$client activate protocol $protocol_version \
with fitness 1 \
and key activator \
and parameters $parameters_file
retry 2 15 assert_protocol "$protocol_version"
echo
echo End of test
echo
show_logs="no"