parallel/testsuite/tests-to-run/test45.sh
2016-05-17 02:11:38 +02:00

35 lines
1.6 KiB
Bash

#!/bin/bash
SERVER1=parallel-server3
SERVER2=parallel-server1
# -L1 will join lines ending in ' '
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | parallel -vj10 -k --joblog /tmp/jl-`basename $0` -L1
echo '### bug #32191: Deep recursion on subroutine main::get_job_with_sshlogin'
seq 1 150 | stdout nice parallel -j9 --retries 2 -S localhost,: "/bin/non-existant 2>/dev/null"
echo '### Test --load locally - should take >10s'
echo '# This will run 10 processes in parallel for 10s';
seq 10 | parallel --nice 19 --timeout 13 -j0 -N0 "gzip < /dev/zero > /dev/null" &
sleep 2; stdout /usr/bin/time -f %e parallel --load 10 sleep ::: 1 | perl -ne '$_ > 10 and print "OK\n"'
echo '### Test --load read from a file - more than 3s'
echo '# This will run 10 processes in parallel for 10s';
seq 10 | parallel --nice 19 --timeout 10 -j0 -N0 "gzip < /dev/zero > /dev/null" &
( echo 8 > /tmp/parallel_load_file; sleep 10; echo 1000 > /tmp/parallel_load_file ) &
sleep 1;
stdout /usr/bin/time -f %e parallel --load /tmp/parallel_load_file sleep ::: 1 |
perl -ne '$_ > 9 and print "OK\n"';
rm /tmp/parallel_load_file
echo '### Test --load read from a file - less than 10s';
echo '# This will run 10 processes in parallel for 10s';
seq 10 | parallel --nice 19 --timeout 10 -j0 -N0 "gzip < /dev/zero > /dev/null" &
( echo 8 > /tmp/parallel_load_file2; sleep 10; echo 1000 > /tmp/parallel_load_file2 ) &
sleep 1;
stdout /usr/bin/time -f %e parallel --load /tmp/parallel_load_file2 sleep ::: 1 |
perl -ne '$_ < 20 and print "OK\n"';
rm /tmp/parallel_load_file2
EOF