From 2cb7e0aaedad73b076ea18c6900b0e86c5760d79 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 15:00:47 +0200 Subject: Adding upstream version 247.3. Signed-off-by: Daniel Baumann --- test/mocks/fsck | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 test/mocks/fsck (limited to 'test/mocks') diff --git a/test/mocks/fsck b/test/mocks/fsck new file mode 100755 index 0000000..241583b --- /dev/null +++ b/test/mocks/fsck @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +fd=0 + +OPTIND=1 +while getopts "C:aTlM" opt; do + case "$opt" in + C) + fd=$OPTARG + ;; + \?);; + esac +done + +shift "$((OPTIND-1))" +device=$1 + +echo "Running fake fsck on $device" + +declare -a maxpass=(30 5 2 30 60) + +for pass in {1..5}; do + maxprogress=${maxpass[$((pass-1))]} + for (( current=0; current<=${maxprogress}; current++)); do + echo "$pass $current $maxprogress $device">&$fd + sleep 0.1 + done +done -- cgit v1.2.3