From 597f5e71d29d7bd808b2e000b2a233731441b0a8 Mon Sep 17 00:00:00 2001 From: Daniel Poelzleithner Date: Wed, 13 Apr 2022 01:55:59 +0200 Subject: [PATCH] Add script to simulate fs changes --- tests/test_actions.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 tests/test_actions.sh diff --git a/tests/test_actions.sh b/tests/test_actions.sh new file mode 100755 index 0000000..025ca1f --- /dev/null +++ b/tests/test_actions.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +if [ -z $1 ]; then + echo "usage: test_actions [directory]" + exit 1 +fi + +set -x + +BLOBB1=$(realpath /tmp/src/../blobb1) + +if [ ! -e $BLOBB1 ]; then + echo "create outside blobb $BLOBB1" + dd count=50 bs=1M if=/dev/urandom of=$BLOBB1 + echo done +fi + +while true; do + mkdir -p $1/testdir + sleep 3 + touch $1/testfile + sleep 2 + echo "blubb" >> $1/testfile + sleep 2 + mv $1/testfile $1/testdir + sleep 2 + ln $BLOBB1 $1/blubb1 + ln $BLOBB1 $1/testdir/blubb2 + ln $BLOBB1 $1/blubb3 + sleep 30 + rm $1/testdir/testfile + sleep 2 + rm -rf $1/testdir + sleep 1 + rm $1/blubb1 + rm $1/blubb3 + sleep 5 +done