#!/bin/sh

# mountpoint, must be subvol

if [ "$1" = '' ]; then
	echo mount point please
	exit
fi

m=${1:-.}
here=$(dirname `readlink -f $0`)
cd "$m"
[ -f "$here/w-dstat" ] || { echo cannot find my scripts; exit; }

tmux new-session -d -s testsubvol
tmux new-window -t testsubvol:0 -k $here/w-dstat
tmux split-window -t testsubvol:0 -p 66 -v "$here/t1-gen-data \"$m\""
tmux split-window -t testsubvol:0 -h "sleep 10; $here/t2-snap-random \"$m\""
tmux split-window -t testsubvol:0.1 -v "sleep 15; $here/t3-snap-del-random \"$m\""
tmux split-window -t testsubvol:0.2 -v "echo wait 4 min; sleep 240; while :;do rm -rf $m/en; date;done"

tmux attach-session -t testsubvol
