Skip to content

Commit

Permalink
#37 First attempt at adding flow_check. Tried to repare errors from o…
Browse files Browse the repository at this point in the history
…riginal bulletins, but proved to be too much work
  • Loading branch information
andreleblanc11 committed Jun 3, 2024
1 parent 5a177bc commit 4c2c664
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 50 deletions.
93 changes: 49 additions & 44 deletions am_flow/flow_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,34 +139,39 @@ function comparetree {
}

printf "checking trees...\n"
checktree ${testdocroot}/downloaded_by_sub_amqp
checktree ${testdocroot}/downloaded_by_sub_cp
checktree ${testdocroot}/downloaded_by_sub_rabbitmqtt
checktree ${testdocroot}/downloaded_by_sub_u
checktree ${testdocroot}/posted_by_shim
checktree ${testdocroot}/recd_by_srpoll_test1
checktree ${testdocroot}/sent_by_tsource2send
checktree ${testdocroot}/mirror/linked_by_shim
checktree ${testdocroot}/cfile
checktree ${testdocroot}/cfr
# Remove special characters
# for bulletinsdir in bulletins_to_{download,post,send} bulletins_subscribe
# do
# files2sed=$(find ${testdocroot}/$bulletinsdir -type f )
# for bulletin in $files2sed
# do
# sed -i $'s/^M//g' $bulletin
# done
# done

checktree ${testdocroot}/bulletins_to_download
checktree ${testdocroot}/bulletins_subscribe
checktree ${testdocroot}/bulletins_to_post
checktree ${testdocroot}/bulletins_to_send



if [[ -z "$skip_summaries" ]]; then
# PAS performance summaries
printf "\nDownload Performance Summaries:\tLOGDIR=$LOGDIR\n"
summarize_performance ${LGPFX}shovel msg_total: rabbitmqtt_f22
summarize_performance ${LGPFX}subscribe file_total: cdnld_f21 amqp_f30 cfile_f44 u_sftp_f60 ftp_f70 q_f71
summarize_performance ${LGPFX}sender msg_total: am_send_f04
summarize_performance ${LGPFX}subscribe file_total: bulletin_subscribe_f05

echo
# MG shows retries
echo

if [[ ! "$SARRA_LIB" ]]; then
echo NB retries for ${LGPFX}subscribe amqp_f30 `grep -a Retrying "$LOGDIR"/${LGPFX}subscribe_amqp_f30*.log | wc -l`
echo NB retries for ${LGPFX}subscribe `grep -a Retrying "$LOGDIR"/${LGPFX}subscribe*.log | wc -l`
echo NB retries for ${LGPFX}sender `grep -a Retrying "$LOGDIR"/${LGPFX}sender*.log | wc -l`
else
echo NB retries for "$SARRA_LIB"/${LGPFX}subscribe.py amqp_f30 `grep -a Retrying "$LOGDIR"/${LGPFX}subscribe_amqp_f30*.log | wc -l`
echo NB retries for "$SARRA_LIB"/${LGPFX}sender.py `grep -a Retrying "$LOGDIR"/${LGPFX}sender*.log | wc -l`
# else
# echo NB retries for "$SARRA_LIB"/${LGPFX}subscribe.py amqp_f30 `grep -a Retrying "$LOGDIR"/${LGPFX}subscribe_amqp_f30*.log | wc -l`
# echo NB retries for "$SARRA_LIB"/${LGPFX}sender.py `grep -a Retrying "$LOGDIR"/${LGPFX}sender*.log | wc -l`
fi

summarize_logs ERROR
Expand All @@ -178,32 +183,32 @@ passedno=0
tno=0


if [[ "${totshovel2}" -gt "${totshovel1}" ]]; then
maxshovel=${totshovel2}
else
maxshovel=${totshovel1}
fi
printf "\n\tMaximum of the shovels is: ${maxshovel}\n\n"
# if [[ "${totshovel2}" -gt "${totshovel1}" ]]; then
# maxshovel=${totshovel2}
# else
# maxshovel=${totshovel1}
# fi
# printf "\n\tMaximum of the shovels is: ${maxshovel}\n\n"


printf "\t\tTEST RESULTS\n\n"

logPermCheck

echo " | content of subdirs of ${testdocroot} |"
comparetree downloaded_by_sub_amqp downloaded_by_sub_cp
comparetree downloaded_by_sub_cp downloaded_by_sub_rabbitmqtt
comparetree downloaded_by_sub_rabbitmqtt downloaded_by_sub_u
comparetree downloaded_by_sub_u posted_by_shim
comparetree downloaded_by_sub_amqp linked_by_shim
comparetree posted_by_shim sent_by_tsource2send
comparetree downloaded_by_sub_subscribe_bulletin downloaded_by_flow
# comparetree downloaded_by_sub_cp downloaded_by_sub_rabbitmqtt
# comparetree downloaded_by_sub_rabbitmqtt downloaded_by_sub_u
# comparetree downloaded_by_sub_u posted_by_shim
# comparetree downloaded_by_sub_amqp linked_by_shim
# comparetree posted_by_shim sent_by_tsource2send

if [ "${SKIP_KNOWN_BAD}" ]; then
echo "skipping one known bad v2 comparison."
else
comparetree downloaded_by_sub_amqp cfile
fi
comparetree cfile cfr
# comparetree cfile cfr

echo "broker state:"
if [[ ${messages_unacked} > 0 ]] || [[ ${messages_ready} > 0 ]]; then
Expand Down Expand Up @@ -275,27 +280,27 @@ zerowanted "${missed_dispositions}" "${maxshovel}" "messages received that we do
# tallyres ${totcpelle04r} ${totcpelle04p} "pump pelle_dd1_f04 (c shovel) should publish (${totcpelle04p}) as many messages as are received (${totcpelle04r})"
# tallyres ${totcpelle05r} ${totcpelle05p} "pump pelle_dd2_f05 (c shovel) should publish (${totcpelle05p}) as many messages as are received (${totcpelle05r})"

if [[ "$C_ALSO" || -d "$SARRAC_LIB" ]]; then

echo " | C routing |"
calcres ${totcpelle04p} ${totcpelle05p} "cpost both pelles should post the same number of messages (${totcpelle05p}) (${totcpelle04p})"

totcvan=$(( ${totcvan14p} + ${totcvan15p} ))
calcres ${totcvan} ${totcdnld} "cdnld_f21 subscribe downloaded ($totcdnld) the same number of files that was published by both van_14 and van_15 ($totcvan)"
t5=$(( $totcveille / 2 ))
calcres "${totcveille}" "${totcdnld}" "veille_f34 should post as many files ($totcveille) as subscribe cdnld_f21 downloaded ($totcdnld)"
calcres "${totcveille}" "${totcfile}" "veille_f34 should post as many files ($totcveille) as subscribe cfile_f44 downloaded ($totcfile)"

fi
# if [[ "$C_ALSO" || -d "$SARRAC_LIB" ]]; then
#
# echo " | C routing |"
# calcres ${totcpelle04p} ${totcpelle05p} "cpost both pelles should post the same number of messages (${totcpelle05p}) (${totcpelle04p})"
#
# totcvan=$(( ${totcvan14p} + ${totcvan15p} ))
# calcres ${totcvan} ${totcdnld} "cdnld_f21 subscribe downloaded ($totcdnld) the same number of files that was published by both van_14 and van_15 ($totcvan)"
# t5=$(( $totcveille / 2 ))
# calcres "${totcveille}" "${totcdnld}" "veille_f34 should post as many files ($totcveille) as subscribe cdnld_f21 downloaded ($totcdnld)"
# calcres "${totcveille}" "${totcfile}" "veille_f34 should post as many files ($totcveille) as subscribe cfile_f44 downloaded ($totcfile)"
#
# fi

if [ "$MQP" == "amqp" ]; then
zerowanted "${messages_unacked}" "${maxshovel}" "there should be no unacknowledged messages left, but there are ${messages_unacked}"
zerowanted "${messages_ready}" "${maxshovel}" "there should be no messages ready to be consumed but there are ${messages_ready}"
fi

if [ "${totwvip}" ]; then
calcres "${totwvip}" 1 "there should be 1 process in wVip state"
fi
# if [ "${totwvip}" ]; then
# calcres "${totwvip}" 1 "there should be 1 process in wVip state"
# fi

echo "Overall ${flow_test_name} ${passedno} of ${tno} passed (sample size: $staticfilecount) !"

Expand Down
6 changes: 0 additions & 6 deletions am_flow/flow_cleanup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@ if [ "$1" != "skipconfig" ]; then
fi
fi

rm $LOGDIR/${LGPFX}post_t_dd?_f00_01.log $LOGDIR/${LGPFX}post_shim_f63_01.log $LOGDIR/${LGPFX}post_test2_f61_01.log
rm $LOGDIR/flowcheck*.txt
rm $LOGDIR/flowsetup_f00.log
rm $LOGDIR/sr_audit*.log*
rm $LOGDIR/trivialupstreamhttpserver_f00.log

echo "Removing flow cache/state files ..."
echo $flow_configs | sed 's/ / ; rm $CACHEDIR\//g' | sed 's/^/rm $CACHEDIR\//' | sed 's+\.conf+/*+g' | sh - 2>/dev/null
echo "$CACHEDIR/*_unit_test" | sed 's/ / ; rm -rf /g' | sed 's/^/rm -rf /' | sh
Expand Down

0 comments on commit 4c2c664

Please sign in to comment.