Client, test: Add two more protocol injection tests (from alpha)

This commit is contained in:
Pietro 2018-02-28 14:57:22 +01:00 committed by Grégoire Henry
parent c6c9117c3a
commit 9ef69b4502
8 changed files with 144 additions and 3 deletions

View File

@ -201,6 +201,16 @@ test:inject.sh:
script: script:
- jbuilder build @src/bin_client/runtest_injection.sh - jbuilder build @src/bin_client/runtest_injection.sh
test:inject_alpha.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_injection_alpha.sh
test:fork.sh:
<<: *test_definition
script:
- jbuilder build @src/bin_client/runtest_fork.sh
test:proto:sandbox: test:proto:sandbox:
<<: *test_definition <<: *test_definition
script: script:

View File

@ -1,6 +1,8 @@
{ {
"genesis_pubkey": "genesis_pubkey":
"edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2", "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2",
"dictator_pubkey":
"edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2",
"bootstrap_keys": [ "bootstrap_keys": [
"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav", "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav",
"edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9", "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9",

View File

@ -19,7 +19,7 @@ let get_commands_for_version ctxt block protocol =
if not (Protocol_hash.equal version given_version) then if not (Protocol_hash.equal version given_version) then
Format.eprintf Format.eprintf
"@[<v 2>@{<warning>@{<title>Warning@}@}@,\ "@[<v 2>@{<warning>@{<title>Warning@}@}@,\
The protocol provided via `-protocol` (%a)@,\ The protocol provided via `--protocol` (%a)@,\
is not the one retrieved from the node (%a).@]@\n@." is not the one retrieved from the node (%a).@]@\n@."
Protocol_hash.pp_short given_version Protocol_hash.pp_short given_version
Protocol_hash.pp_short version ; Protocol_hash.pp_short version ;

View File

@ -66,9 +66,43 @@
${bin:tezos-admin-client} ${bin:tezos-admin-client}
)))) ))))
(alias
((name runtest_fork.sh)
(locks (/tcp-port/18731
/tcp-port/19731))
(deps (sandbox.json
test_lib.inc.sh
(glob_files demo/*)
))
(action (run bash ${path:test_fork.sh}
${bin:tezos-sandboxed-node.sh}
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias
((name runtest_injection_alpha.sh)
(locks (/tcp-port/18731
/tcp-port/19731))
(deps (sandbox.json
test_lib.inc.sh
(glob_files demo/*)
))
(action (run bash ${path:test_injection_alpha.sh}
${bin:tezos-sandboxed-node.sh}
${bin:tezos-node}
${bin:tezos-init-sandboxed-client.sh}
${bin:tezos-client}
${bin:tezos-admin-client}
))))
(alias (alias
((name runtest) ((name runtest)
(deps ((alias runtest_basic.sh) (deps ((alias runtest_basic.sh)
(alias runtest_contracts.sh) (alias runtest_contracts.sh)
(alias runtest_multinode.sh) (alias runtest_multinode.sh)
(alias runtest_injection.sh))))) (alias runtest_injection.sh)
(alias runtest_injection_alpha.sh)
(alias runtest_fork.sh)))))

View File

@ -1,6 +1,8 @@
{ {
"genesis_pubkey": "genesis_pubkey":
"edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2", "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2",
"dictator_pubkey":
"edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2",
"bootstrap_keys": [ "bootstrap_keys": [
"edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav", "edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav",
"edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9", "edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9",

View File

@ -0,0 +1,45 @@
#! /usr/bin/env bash
## from alpha to demo
set -e
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
source $test_dir/test_lib.inc.sh "$@"
start_node 1
$client list understood protocols
activate_alpha
show_logs="no"
sleep 2
dictator_secret="edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6"
# autogenerated from the demo source
protocol_version="Ps1ZDZdgRP4PFDkzmFpiYtE7gJHioavCMxC96i9zJsK6URwSXSJ"
protocol_short="Ps1ZDZdgRP4PFD"
$client bake for bootstrap1 -max-priority 512
$client list understood protocols
$admin_client inject protocol "$test_dir/demo"
$admin_client list protocols
$client fork test protocol $protocol_version with key $dictator_secret
$admin_client list protocols
#these commands cannot be used in this case because the client does not
#know about the new protocol
#$client --protocol $protocol_short bake for bootstrap1 -max-priority 512
#$client --protocol $protocol_version rpc call /blocks/head with {}
echo
echo End of test
echo

View File

@ -1,5 +1,7 @@
#! /usr/bin/env bash #! /usr/bin/env bash
## from genesis to demo
set -e set -e
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")" test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
@ -7,6 +9,8 @@ source $test_dir/test_lib.inc.sh "$@"
start_node 1 start_node 1
show_logs="no"
sleep 2 sleep 2
# autogenerated from the demo source # autogenerated from the demo source
@ -25,4 +29,3 @@ echo
echo End of test echo End of test
echo echo
show_logs="no"

View File

@ -0,0 +1,45 @@
#! /usr/bin/env bash
## from alpha to demo
set -e
test_dir="$(cd "$(dirname "$0")" && echo "$(pwd -P)")"
source $test_dir/test_lib.inc.sh "$@"
start_node 1
$client list understood protocols
activate_alpha
show_logs="no"
sleep 2
dictator_secret="edsk31vznjHSSpGExDMHYASz45VZqXN4DPxvsa4hAyY8dHM28cZzp6"
# autogenerated from the demo source
protocol_version="Ps1ZDZdgRP4PFDkzmFpiYtE7gJHioavCMxC96i9zJsK6URwSXSJ"
protocol_short="Ps1ZDZdgRP4PFD"
$client bake for bootstrap1 -max-priority 512
$client list understood protocols
$admin_client inject protocol "$test_dir/demo"
$admin_client list protocols
$client activate protocol $protocol_version with key $dictator_secret
$admin_client list protocols
#these commands cannot be used in this case because the client does not
#know about the new protocol
#$client --protocol $protocol_short bake for bootstrap1 -max-priority 512
#$client --protocol $protocol_version rpc call /blocks/head with {}
echo
echo End of test
echo