#!/bin/bash

sendSleepCommand() {
${FUSE_HOME}/bin/client -u admin -p admin "shell:sleep -s 60"
}

numofprocess=`nproc`
echo "number of cpu core : ${numofprocess}"
limit=`expr \( $numofprocess + 1 \) \* 3 + 1`
echo "For this test, execute command ${limit} times"
echo "start"
printf "\r%.12s\n" `date +%T.%N`;
num=0
while [ $num -ne $limit ]
do
echo "${num} : exec command shell:sleep -s 60"
   sendSleepCommand &
   num=`expr $num + 1`
done
wait
echo "done"
printf "\r%.12s\n" `date +%T.%N`;
exit 0
