2014-03-03 10:42:04 +00:00
### These tests requires VirtualBox running with the following images
tange@freebsd7
2014-07-15 00:40:38 +00:00
echo 'bug #40136: FreeBSD: No more processes'
2014-03-03 10:42:04 +00:00
bug #40136: FreeBSD: No more processes
2014-07-15 00:40:38 +00:00
sem --jobs 3 --id my_id -u 'echo First started; sleep 5; echo The first finished' && sem --jobs 3 --id my_id -u 'echo Second started; sleep 6; echo The second finished' && sem --jobs 3 --id my_id -u 'echo Third started; sleep 7; echo The third finished' && sem --jobs 3 --id my_id -u 'echo Fourth started; sleep 8; echo The fourth finished' && sem --wait --id my_id
2014-03-03 10:42:04 +00:00
First started
Second started
Third started
The first finished
Fourth started
The second finished
The third finished
The fourth finished
2014-07-15 00:40:38 +00:00
echo 'Test --compress --pipe'
2014-03-03 10:42:04 +00:00
Test --compress --pipe
2014-07-15 00:40:38 +00:00
jot 1000 | parallel --compress --pipe cat | wc
2014-03-03 10:42:04 +00:00
1000 1000 3893
2015-01-03 17:57:37 +00:00
echo 'bug #41613: --compress --line-buffer no newline'; perl -e 'print "It worked"'| parallel --pipe --compress --line-buffer cat; echo
2014-03-03 10:42:04 +00:00
bug #41613: --compress --line-buffer no newline
It worked
2014-07-15 00:40:38 +00:00
echo 'bug #40135: FreeBSD: sem --fg does not finish under /bin/sh'
2014-03-03 10:42:04 +00:00
bug #40135: FreeBSD: sem --fg does not finish under /bin/sh
2014-09-20 19:36:02 +00:00
sem --fg 'sleep 1; echo The job finished'
2014-03-03 10:42:04 +00:00
The job finished
2014-07-15 00:40:38 +00:00
echo 'bug #40133: FreeBSD: --round-robin gives no output'
2014-03-03 10:42:04 +00:00
bug #40133: FreeBSD: --round-robin gives no output
2014-07-15 00:40:38 +00:00
jot 1000000 | parallel --round-robin --pipe -kj3 wc | sort
2014-03-03 10:42:04 +00:00
299592 299592 2097144
299594 299594 2097158
400814 400814 2694594
2014-07-15 00:40:38 +00:00
jot 1000000 | parallel --round-robin --pipe -kj4 wc | sort
2014-03-03 10:42:04 +00:00
149797 149797 1048579
235145 235145 1646016
299593 299593 2097151
315465 315465 2097150
2014-07-15 00:40:38 +00:00
echo 'bug #40134: FreeBSD: --shebang not working'
2014-06-23 00:04:37 +00:00
bug #40134: FreeBSD: --shebang not working
2014-09-20 19:36:02 +00:00
(echo '#!/usr/bin/env -S parallel --shebang -rk echo'; echo It; echo worked) > shebang; chmod 755 ./shebang; ./shebang
2014-06-23 00:04:37 +00:00
It
worked
2014-07-15 00:40:38 +00:00
echo 'bug #40134: FreeBSD: --shebang(-wrap) not working'
2014-06-23 00:04:37 +00:00
bug #40134: FreeBSD: --shebang(-wrap) not working
2014-09-20 19:36:02 +00:00
(echo '#!/usr/bin/env -S parallel --shebang-wrap /usr/bin/perl :::'; echo 'print @ARGV,"\n";') > shebang-wrap; chmod 755 ./shebang-wrap; ./shebang-wrap wrap works
2014-06-23 00:04:37 +00:00
wrap
works
2014-07-15 00:40:38 +00:00
echo 'bug #40134: FreeBSD: --shebang(-wrap) with options not working'
2014-06-23 00:04:37 +00:00
bug #40134: FreeBSD: --shebang(-wrap) with options not working
2014-09-20 19:36:02 +00:00
(echo '#!/usr/bin/env -S parallel --shebang-wrap -v -k -j 0 /usr/bin/perl -w :::'; echo 'print @ARGV,"\n";') > shebang-wrap-opt; chmod 755 ./shebang-wrap-opt; ./shebang-wrap-opt wrap works with options
/usr/bin/perl -w ./shebang-wrap-opt wrap
2014-06-23 00:04:37 +00:00
wrap
2014-09-20 19:36:02 +00:00
/usr/bin/perl -w ./shebang-wrap-opt works
2014-06-23 00:04:37 +00:00
works
2014-09-20 19:36:02 +00:00
/usr/bin/perl -w ./shebang-wrap-opt with
2014-06-23 00:04:37 +00:00
with
2014-09-20 19:36:02 +00:00
/usr/bin/perl -w ./shebang-wrap-opt options
2014-06-23 00:04:37 +00:00
options
2015-03-29 03:28:57 +00:00
bash -c 'echo bug \#43358: shellshock breaks exporting functions using --env _; echo Non-shellshock-hardened to non-shellshock-hardened; funky() { echo Function $1; }; export -f funky; PARALLEL_SHELL=bash parallel --env funky -S localhost funky ::: non-shellshock-hardened'
2014-10-15 22:37:02 +00:00
bug #43358: shellshock breaks exporting functions using --env _
Non-shellshock-hardened to non-shellshock-hardened
Function non-shellshock-hardened
2015-03-29 03:28:57 +00:00
parallel: Warning: Shell functions may not be supported in bash
2014-10-15 22:37:02 +00:00
bash -c 'echo bug \#43358: shellshock breaks exporting functions using --env _; echo Non-shellshock-hardened to shellshock-hardened; funky() { echo Function $1; }; export -f funky; parallel --env funky -S parallel@192.168.1.72 funky ::: shellshock-hardened'
bug #43358: shellshock breaks exporting functions using --env _
Non-shellshock-hardened to shellshock-hardened
Function shellshock-hardened
2015-03-29 03:28:57 +00:00
echo '### Test --load (must give 1=true)'
### Test --load (must give 1=true)
parallel -j0 -N0 --timeout 5 --nice 10 'bzip2 < /dev/zero >/dev/null' ::: 1 2 3 & parallel --argsep ,, --joblog - -N0 parallel --load 100% echo ::: 1 ,, 1 | parallel --colsep '\t' --header : echo '{=4 $_=$_>5=}'
1