From c73f5a75a5d5ce06ef5b4dc116aaf7281c2a02bc Mon Sep 17 00:00:00 2001 From: Attila Klenik Date: Tue, 30 Nov 2021 11:28:55 +0100 Subject: [PATCH] Fix Besu integration test (#1174) * Change opened RPC WS API names to upper case, lower case names resulted in error. * Remove the custom docker build from the network, use the Besu image directly and set the required parameters on the container. * Fix the Besu version to 21.10.1 * Add some docker container log dumps in case of CI test failure Signed-off-by: Attila Klenik --- .../config/caliper-besu-clique.Dockerfile | 18 --------------- .../besu_tests/config/docker-compose.yml | 22 ++++++++++++++----- .../besu_tests/run.sh | 4 ++++ 3 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 packages/caliper-tests-integration/besu_tests/config/caliper-besu-clique.Dockerfile diff --git a/packages/caliper-tests-integration/besu_tests/config/caliper-besu-clique.Dockerfile b/packages/caliper-tests-integration/besu_tests/config/caliper-besu-clique.Dockerfile deleted file mode 100644 index 12abee6e4..000000000 --- a/packages/caliper-tests-integration/besu_tests/config/caliper-besu-clique.Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM hyperledger/besu:latest -COPY ./data/ /root/ -VOLUME [ "/root/.ethereum/keystore/" ] -ENTRYPOINT [ "/opt/besu/bin/besu", "--genesis-file=/root/genesis.json", "--node-private-key-file=/root/.ethereum/keystore/key" ] diff --git a/packages/caliper-tests-integration/besu_tests/config/docker-compose.yml b/packages/caliper-tests-integration/besu_tests/config/docker-compose.yml index e693b9ac7..5f45ab36e 100644 --- a/packages/caliper-tests-integration/besu_tests/config/docker-compose.yml +++ b/packages/caliper-tests-integration/besu_tests/config/docker-compose.yml @@ -15,10 +15,7 @@ version: "3" services: node: - build: - context: . - dockerfile: caliper-besu-clique.Dockerfile - image: caliper-besu-clique + image: hyperledger/besu:21.10.1 container_name: besu_clique volumes: - ./keys:/root/.ethereum/keystore @@ -26,7 +23,22 @@ services: - ./orion:/orion ports: - 8545-8547:8545-8547 - command: --min-gas-price 0 --revert-reason-enabled --rpc-ws-enabled --rpc-ws-host 0.0.0.0 --host-whitelist=* --rpc-ws-apis admin,eth,miner,web3,net,priv,eea --graphql-http-enabled --discovery-enabled=false --privacy-enabled=true --privacy-url=http://orion:8888 --privacy-public-key-file=/orion/key/orion.pub + entrypoint: + - /opt/besu/bin/besu + - --genesis-file=/root/genesis.json + - --node-private-key-file=/root/.ethereum/keystore/key + command: + - --min-gas-price=0 + - --revert-reason-enabled + - --rpc-ws-enabled + - --rpc-ws-host=0.0.0.0 + - --host-allowlist=* + - --rpc-ws-apis=ADMIN,ETH,MINER,WEB3,NET,PRIV,EEA + - --graphql-http-enabled + - --discovery-enabled=false + - --privacy-enabled=true + - --privacy-url=http://orion:8888 + - --privacy-public-key-file=/orion/key/orion.pub orion: image: "pegasyseng/orion:1.6.0" container_name: orion diff --git a/packages/caliper-tests-integration/besu_tests/run.sh b/packages/caliper-tests-integration/besu_tests/run.sh index 23c754495..327e45e0c 100755 --- a/packages/caliper-tests-integration/besu_tests/run.sh +++ b/packages/caliper-tests-integration/besu_tests/run.sh @@ -32,7 +32,11 @@ fi export CALIPER_PROJECTCONFIG=../caliper.yaml dispose () { + # dump some container information in case of an error before tearing down the network + echo "########### Container states and logs" docker ps -a + docker logs --tail 50 besu_clique + echo "" ${CALL_METHOD} launch manager --caliper-workspace phase1 --caliper-flow-only-end }