2010-06-09 20:26:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PAR=parallel
|
|
|
|
SERVER1=parallel-server1
|
|
|
|
SERVER2=parallel-server2
|
|
|
|
|
|
|
|
(
|
|
|
|
echo '### Test exit val'
|
|
|
|
echo true | parallel
|
|
|
|
echo $?
|
|
|
|
echo false | parallel
|
|
|
|
echo $?
|
|
|
|
|
|
|
|
echo '### Test --halt-on-error'
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 0
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 1
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 2
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
|
|
|
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 -H0
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 -H1
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
2011-01-17 12:38:58 +00:00
|
|
|
(echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 -H2
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
|
|
|
|
|
|
|
echo '### Test last dying print --halt-on-error'
|
2011-01-17 12:38:58 +00:00
|
|
|
(seq 0 8;echo 0; echo 9) | parallel -j10 -kqH1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
2011-01-17 12:38:58 +00:00
|
|
|
(seq 0 8;echo 0; echo 9) | parallel -j10 -kqH2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'
|
2010-06-09 20:26:59 +00:00
|
|
|
echo $?
|
|
|
|
) 2>&1
|