Skip to content

Commit

Permalink
add script for matching artifacts
Browse files Browse the repository at this point in the history
Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Nov 4, 2024
1 parent a6acd30 commit b7a9e2a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions infra/experimental/chronos/e2e-replay-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ docker run -v $PWD/build/out/${PROJECT}:/out \
echo "finish" >> ${LOG}
echo $(date +%Y:%m:%d:%H:%M:%S) >> ${LOG}
cp -rf $PWD/build/out/${PROJECT} ${OUT2}

# Now match the artifacts
SUCCESS=$(infra/experimental/chronos/match_artifacts $OUT1 $OUT2)

if [[ $SUCCESS -eq 0 ]]; then
echo "SUCCESS REPLAY" >> ${LOG}
else
echo "FAIL REPLAY" >> ${LOG}
fi
20 changes: 20 additions & 0 deletions infra/experimental/chronos/match_artifacts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#/bin/bash -eux

CMP1=$1
CMP2=$2

for exec1 in $(find $CMP1/ -type f -executable); do
base=$(basename $exec1)

exec2=$CMP2/${base}
if [ ! -f ${exec2} ]; then
exit 1
fi

comparison=$(cmp --silent $exec1 $exec2; echo $?)
if [[ $comparison -ne 0 ]]; then
exit 1
fi
done

exit 0

0 comments on commit b7a9e2a

Please sign in to comment.