fix: root folder for docker integration tests (#1173) (#1175)

This commit is contained in:
marcello33 2024-03-05 10:33:56 +01:00 committed by GitHub
parent 241af1fa1e
commit 812ccb0923
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 10 deletions

View file

@ -3,8 +3,8 @@ set -e
while true while true
do do
peers=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'admin.peers'") peers=$(docker exec bor0 bash -c "bor attach /var/lib/bor/data/bor.ipc -exec 'admin.peers'")
block=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'eth.blockNumber'") block=$(docker exec bor0 bash -c "bor attach /var/lib/bor/data/bor.ipc -exec 'eth.blockNumber'")
if [[ -n "$peers" ]] && [[ -n "$block" ]]; then if [[ -n "$peers" ]] && [[ -n "$block" ]]; then
break break

View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
set -e set -e
balanceInit=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'") balanceInit=$(docker exec bor0 bash -c "bor attach /var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'")
stateSyncFound="false" stateSyncFound="false"
checkpointFound="false" checkpointFound="false"
@ -10,8 +10,8 @@ start_time=$SECONDS
while true while true
do do
balance=$(docker exec bor0 bash -c "bor attach /root/var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'") balance=$(docker exec bor0 bash -c "bor attach /var/lib/bor/data/bor.ipc -exec 'Math.round(web3.fromWei(eth.getBalance(eth.accounts[0])))'")
if ! [[ "$balance" =~ ^[0-9]+$ ]]; then if ! [[ "$balance" =~ ^[0-9]+$ ]]; then
echo "Something is wrong! Can't find the balance of first account in bor network." echo "Something is wrong! Can't find the balance of first account in bor network."
@ -19,10 +19,10 @@ do
fi fi
if (( $balance > $balanceInit )); then if (( $balance > $balanceInit )); then
if [ $stateSyncFound != "true" ]; then if [ $stateSyncFound != "true" ]; then
stateSyncTime=$(( SECONDS - start_time )) stateSyncTime=$(( SECONDS - start_time ))
stateSyncFound="true" stateSyncFound="true"
fi fi
fi fi
checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id) checkpointID=$(curl -sL http://localhost:1317/checkpoints/latest | jq .result.id)
@ -31,12 +31,12 @@ do
if [ $checkpointFound != "true" ]; then if [ $checkpointFound != "true" ]; then
checkpointTime=$(( SECONDS - start_time )) checkpointTime=$(( SECONDS - start_time ))
checkpointFound="true" checkpointFound="true"
fi fi
fi fi
if [ $stateSyncFound == "true" ] && [ $checkpointFound == "true" ]; then if [ $stateSyncFound == "true" ] && [ $checkpointFound == "true" ]; then
break break
fi fi
done done
echo "Both state sync and checkpoint went through. All tests have passed!" echo "Both state sync and checkpoint went through. All tests have passed!"