Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: certificate production test #44

Merged
merged 3 commits into from
Dec 14, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions tests/test_cert_production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,55 @@ echo "Executing block cert production test..."
# Get last block number created on the topos polygon edge node
last_block_topos=$(get_last_block topos-node-1)
echo "Topos subnet last block: $last_block_topos"

atanmarko marked this conversation as resolved.
Show resolved Hide resolved
# Check if certificate with this block number is produced on the topos sequencer
certificate_produced=$(check_certificate_produced topos-sequencer $last_block_topos)
if [ $certificate_produced -eq 0 ]; then
echo "Certificate for block $last_block_topos produced on topos sequencer"
else
echo "Certificate for block $last_block_topos IS NOT produced on topos sequencer"
exit 1
fi
# Try multiple times to give time to sequencer to sync/catch up
for i in {1..10};
do
certificate_produced=$(check_certificate_produced topos-sequencer $last_block_topos)
if [ $certificate_produced -eq 0 ]; then
echo "Certificate for block $last_block_topos produced on topos sequencer"
break
else
echo "Certificate for block $last_block_topos IS NOT produced on topos sequencer"
if [[ "$i" != '10' ]]; then
echo "Trying again in 5 seconds for $(($i+1)) time"
sleep 5
continue
fi
if [ $network_started -eq 1 ]; then
echo "Test failed, shutting down network started for this test"
stop_network
fi
exit 1
fi
done


# Get last block number created on the incal polygon edge node
last_block_incal=$(get_last_block incal-node-1)
echo "Incal subnet last block: $last_block_incal"
# Check if certificate with this block number is produced on the incal sequencer
certificate_produced=$(check_certificate_produced incal-sequencer $last_block_incal)
if [ $certificate_produced -eq 0 ]; then
echo "Certificate for block $last_block_incal produced on incal sequencer"
else
echo "Certificate for block $last_block_incal IS NOT produced on incal sequencer"
exit 1
fi
for i in {1..10};
do
certificate_produced=$(check_certificate_produced incal-sequencer $last_block_incal)
if [ $certificate_produced -eq 0 ]; then
echo "Certificate for block $last_block_incal produced on incal sequencer"
break
else
echo "Certificate for block $last_block_incal IS NOT produced on incal sequencer"
if [[ "$i" != '10' ]]; then
echo "Trying again in 5 seconds for $(($i+1)) time"
sleep 5
continue
fi
if [ $network_started -eq 1 ]; then
echo "Test failed, shutting down network started for this test"
stop_network
fi
exit 1
fi
done



Expand Down
Loading