parallel: Partial Reuse licensing support.
[parallel.git] / testsuite / tests-to-run / parallel-local22.sh
blob35b3ccc9be674049aadb0356b07e606cfcdcc11b
1 #!/bin/bash
3 # SPDX-FileCopyrightText: 2021 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
5 # SPDX-License-Identifier: GPL-3.0-or-later
7 cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1 -r
8 echo '### Test of xargs -m command lines > 130k';
9 seq 1 60000 | parallel -m -j1 echo a{}b{}c | tee >(wc >/tmp/awc$$) >(sort | md5sum) >/tmp/a$$;
10 wait;
11 CHAR=$(cat /tmp/a$$ | wc -c);
12 LINES=$(cat /tmp/a$$ | wc -l);
13 echo "Chars per line:" $(echo "$CHAR/$LINES" | bc);
14 cat /tmp/awc$$;
15 rm /tmp/a$$ /tmp/awc$$
17 echo '### Test of xargs -X command lines > 130k';
18 seq 1 60000 | parallel -X -j1 echo a{}b{}c | tee >(wc >/tmp/bwc$$) >(sort | (sleep 1; md5sum)) >/tmp/b$$;
19 wait;
20 CHAR=$(cat /tmp/b$$ | wc -c);
21 LINES=$(cat /tmp/b$$ | wc -l);
22 echo "Chars per line:" $(echo "$CHAR/$LINES" | bc);
23 cat /tmp/bwc$$;
24 rm /tmp/b$$ /tmp/bwc$$
26 echo '### Test of xargs -m command lines > 130k';
27 seq 1 60000 | parallel -k -j1 -m echo | md5sum
29 echo '### This causes problems if we kill child processes';
30 # 2>/dev/null to avoid parallel: Warning: Starting 45 processes took > 2 sec.
31 seq 2 40 | parallel -j 0 seq 1 10 2>/dev/null | sort | md5sum
33 echo '### This causes problems if we kill child processes (II)';
34 # 2>/dev/null to avoid parallel: Warning: Starting 45 processes took > 2 sec.
35 seq 1 40 | parallel -j 0 seq 1 10 '| parallel -j 3 echo' 2>/dev/null | LC_ALL=C sort | md5sum
37 echo '### Test -m';
38 (echo foo;echo bar) | parallel -j1 -m echo 1{}2{}3 A{}B{}C
40 echo '### Test -X';
41 (echo foo;echo bar) | parallel -j1 -X echo 1{}2{}3 A{}B{}C
43 echo '### Bug before 2009-08-26 causing regexp compile error or infinite loop';
44 echo a | parallel -qX echo "'"{}"' "
46 echo '### Bug before 2009-08-26 causing regexp compile error or infinite loop (II)';
47 echo a | parallel -qX echo "'{}'"
49 echo '### bug #42041: Implement $PARALLEL_JOBSLOT'
50 parallel -k --slotreplace // -j2 sleep 1\;echo // ::: {1..4} | sort
51 parallel -k -j2 sleep 1\;echo {%} ::: {1..4} | sort
53 echo '### bug #42363: --pipepart and --fifo/--cat does not work'
54 seq 100 > /tmp/bug42363;
55 parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe 's:(/tmp\S+par).....:${1}XXXXX:';
56 parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe 's:(/tmp\S+par).....:${1}XXXXX:';
57 rm /tmp/bug42363
59 echo '### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile'
60 parallel --pipepart -a /etc/passwd -L 1 should not be run
61 parallel --pipepart -a /etc/passwd -N 1 should not be run
62 parallel --pipepart -a /etc/passwd -l 1 should not be run
64 echo '### bug #42893: --block should not cause decimals in cat_partial'
65 seq 100000 >/tmp/parallel-decimal;
66 parallel --dry-run -kvv --pipepart --block 0.12345M -a /tmp/parallel-decimal true;
67 rm /tmp/parallel-decimal
69 echo '### bug #42892: parallel -a nonexiting --pipepart'
70 parallel --pipepart -a nonexisting wc
72 echo '### added transfersize/returnsize to local jobs'
73 echo '### normal'
74 seq 100 111 | parallel --joblog /dev/stderr seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
75 echo '### --line-buffer'
76 seq 100 111 | parallel --joblog /dev/stderr --line-buffer seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
77 echo '### --tag'
78 seq 100 111 | parallel --tag --joblog /dev/stderr seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
79 echo '### --tag --line-buffer'
80 seq 100 111 | parallel --tag --line-buffer --joblog /dev/stderr seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
81 echo '### --files'
82 seq 100 111 | parallel --files --joblog /dev/stderr seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
83 echo '### --files --tag'
84 seq 100 111 | parallel --files --tag --joblog /dev/stderr seq {} '|' pv -qL100 2>&1 >/dev/null | cut -f 5-7 | sort
85 echo '### --pipe'
86 seq 1000 | parallel --joblog /dev/stderr --block 1111 --pipe pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
87 echo '### --pipe --line-buffer'
88 seq 1000 | parallel --joblog /dev/stderr --block 1111 --pipe --line-buffer pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
89 echo '### --pipe --tag'
90 seq 1000 | parallel --joblog /dev/stderr --block 1111 --pipe --tag pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
91 echo '### --pipe --tag --line-buffer'
92 seq 1000 | parallel --joblog /dev/stderr --block 1111 --pipe --tag --line-buffer pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
93 echo '### --files --pipe'
94 seq 1000 | parallel --joblog /dev/stderr --block 1111 --files --pipe pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
95 echo '### --files --pipe --tag'
96 seq 1000 | parallel --joblog /dev/stderr --block 1111 --files --pipe --tag pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort
97 echo '### --pipe --round-robin'
98 seq 1000 | parallel --joblog /dev/stderr --block 1111 -j2 --pipe --round-robin pv -qL300 2>&1 >/dev/null | cut -f 5-7 | sort