selftest_script = ['#!/bin/bash\n',
'SZ=%s\n'
'TM=%d\n',
'BRW=%s\n',
'CKSUM=simple\n',
'LFROM=%s\n',
'LTO=%s\n',
'for CN in %d; do\n',
'        export LST_SESSION=$$\n',
'        echo LST_SESSION = ${LST_SESSION}\n',
'        lst new_session lst${BRW}\n',
'        lst add_group lfrom ${LFROM}\n',
'        lst add_group lto ${LTO}\n',
'        lst add_batch bulk_${BRW}\n',
'        lst add_test --batch bulk_${BRW} --from lfrom --to lto brw ${BRW} --concurrency=${CN} --distribute %d:%d check=${CKSUM} size=${SZ}\n',
'        lst run bulk_${BRW}\n',
'        lst stat --mbs lfrom lto 2>&1 | tee /dev/null &\n',
'        LSTPID=$!\n',
'        echo -n "Capturing statistics for ${TM} secs "\n',
'        lst stat --mbs lfrom lto 2>&1 | tee %s &\n',
'        i=1\n',
'        j=$((${TM}/5))\n',
'        if [ $((${TM}%s)) -ne 0 ]; then let j++; fi\n',
'        while [ $i -le $j ]; do\n',
'             echo -n "loop = ${i}"\n'
'             sleep 5\n',
'             let i++\n',
'        done\n',
'        echo\n',
'        kill ${LSTPID}\n',
'        lst show_error lfrom lto >> %s\n',
'        lst stop bulk_${BRW}\n',
'        lst end_session\n',
'done\n']
