tokenbridge/monitor-e2e/wait-for-monitor.sh
Gerardo Nardelli 5d770e8607 Add AMB monitor e2e tests (#231)
* Add amb monitor e2e tests
* Fix eventsStats endpoint monitor
2019-11-13 07:51:10 +01:00

29 lines
789 B
Bash
Executable File

FILES=(getBalances.json validators.json eventsStats.json alerts.json)
check_files_exist() {
rc=0
for f in "${FILES[@]}"; do
command="test -f responses/$f"
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "$command") || rc=1
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "$command") || rc=1
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "$command") || rc=1
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-amb /bin/bash -c "$command") || rc=1
done
return $rc
}
i=0
until check_files_exist
do
((i++))
if [ "$i" -gt 30 ]
then
exit -1
fi
echo "Waiting for monitor to start..."
sleep 3
done
echo "Monitor started"