Tests: rotation: add a per-pid size-based rotation test
[lttng-tools.git] / tests / regression / tools / rotation / rotate_utils.sh
index 0454b7ce3e8d421d97cf2e4c7c3271a1b24c1dd7..2803517f21d0a3d0f08a18c93e70d8037b072562 100644 (file)
@@ -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"
+}
This page took 0.024103 seconds and 4 git commands to generate.