X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Frotation%2Frotate_utils.sh;fp=tests%2Fregression%2Ftools%2Frotation%2Frotate_utils.sh;h=2803517f21d0a3d0f08a18c93e70d8037b072562;hp=0454b7ce3e8d421d97cf2e4c7c3271a1b24c1dd7;hb=bf1e8411c30b21bc8dd6184c9890e9885bb7d503;hpb=56f80787af0aa6c608c3927309c4cf3b595e17d2 diff --git a/tests/regression/tools/rotation/rotate_utils.sh b/tests/regression/tools/rotation/rotate_utils.sh index 0454b7ce3..2803517f2 100644 --- a/tests/regression/tools/rotation/rotate_utils.sh +++ b/tests/regression/tools/rotation/rotate_utils.sh @@ -144,3 +144,20 @@ function rotate_timer_test () fi shopt -u extglob } + +function wait_for_archives () +{ + local trace_path=$1 + local target_archive_count=$2 + local archive_count=0 + + diag "Waiting for $target_archive_count size-based rotations to occur" + while [[ archive_count -lt $target_archive_count ]] + do + archive_count=$(find "$TRACE_PATH" -mindepth 2 -maxdepth 2 -type d -path "*archives*" | wc -l) + $TESTAPP_BIN -i 2000 -w 0 > /dev/null 2>&1 + done + + [[ $archive_count -eq $target_archive_count ]] + ok $? "Found $target_archive_count trace archives resulting from trace archive rotations" +}