Skip to content

Commit

Permalink
Move raw err section
Browse files Browse the repository at this point in the history
  • Loading branch information
vinny authored and thierrymarianne committed Nov 17, 2021
1 parent 8b0b4b0 commit 523f1ea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions provisioning/web-server/safepkt/templates/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ function verify() {
cargo verify --backend='klee' --script=./commands.sh --tests -vvvv 2> /safepkt-ink/examples/source/raw_err || true
fi

echo '__BEGIN_RAW_STDERR__'
cat /safepkt-ink/examples/source/raw_err
echo '__END_RAW_STDERR__'

echo '__BEGIN_EXPECTED_PANICS__'
for entry_point in ./kleeout/*; do
if [ $(echo "${entry_point}" | grep -c safe) -eq 0 ];
then
Expand All @@ -62,10 +59,11 @@ function verify() {
echo "Tests results for "'"'"$(echo "${entry_point}" | grep safe | sed -E 's/.+::(.+)$/\1/g')"'"'"";

# test method contains "fail" when a call is meant to panic
if find "${entry_point}" -name "*.err" >> /dev/null 2>&1 && \
if find "${entry_point}" -name '*.err' >> /dev/null 2>&1 && \
[ $(echo "${entry_point}" | grep -c fail) -gt 0 ];
then
panic_occurrences=$(cat $(find ./kleeout/*submit_transaction_wallet_fails* -name *err | tail -n1 ) \

panic_occurrences=$(cat $(find ./kleeout/*_fails* -name '*err' | tail -n1 ) \
| grep '\/panic' | grep -c "File:")

if [ ${panic_occurrences} -gt 0 ];
Expand All @@ -79,5 +77,10 @@ function verify() {

\grep 'KLEE:' "${entry_point}/info" | sed -E 's/^/\t/g'
done
echo '__END_EXPECTED_PANICS__'

echo '__BEGIN_RAW_STDERR__'
cat /safepkt-ink/examples/source/raw_err
echo '__END_RAW_STDERR__'
}
verify "${1}" "${2}" ${3} ${4}

0 comments on commit 523f1ea

Please sign in to comment.