Released as 20240622 ('34 counts')
[parallel.git] / testsuite / tests-to-run / test23.sh
blob397099ccdacf7dd479bcb5f88f3aa4be2e40f188
1 #!/bin/bash
3 # SPDX-FileCopyrightText: 2021-2024 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
5 # SPDX-License-Identifier: GPL-3.0-or-later
7 SERVER1=parallel-server1
8 SERVER2=parallel-server2
9 SSHUSER1=vagrant
10 SSHUSER2=vagrant
11 SSHLOGIN1=$SSHUSER1@$SERVER1
12 SSHLOGIN2=$SSHUSER2@$SERVER2
14 cd /tmp
16 echo '### Test --basefile with no --sshlogin'
17 echo | stdout parallel --basefile foo echo
19 echo '### Test --basefile + --cleanup + permissions'
20 echo echo script1 run '"$@"' > script1
21 echo echo script2 run '"$@"' > script2
22 chmod 755 script1 script2
23 seq 1 5 | parallel -kS $SSHLOGIN1 --cleanup --bf script1 --basefile script2 "./script1 {};./script2 {}"
24 echo good if no file
25 stdout ssh $SSHLOGIN1 ls 'script1' || echo OK
26 stdout ssh $SSHLOGIN1 ls 'script2' || echo OK
28 echo '### Test --basefile + --sshlogin :'
29 echo cat '"$@"' > my_script
30 chmod 755 my_script
31 rm -f parallel_*.test parallel_*.out
32 seq 1 13 | parallel echo {} '>' parallel_{}.test
34 ls parallel_*.test | parallel -j+0 --trc {.}.out --bf my_script \
35 -S $SSHLOGIN1,$SSHLOGIN2,: "./my_script {} > {.}.out"
36 ls parallel_*.test parallel_*.out | LC_ALL=C sort | xargs cat
38 ## Broken since 2013-03-23
39 ## rm -rf tmp
40 ## echo "### Test combined -X --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
41 ## stdout parallel -j1 -k -Xv --cleanup --return tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file -S $SSHLOGIN2 \
42 ## mkdir -p tmp/{/}_{/.}_{2/.}_{2/}_{2.} \;touch tmp/{/}_{/.}_{2/.}_{2/}_{2.}/file \
43 ## ::: /a/number1.c a/number2.c number3.c /a/number4 a/number5 number6 'number 7' 'number <8|8>'
44 ## find tmp | sort
45 ## rm -rf tmp
47 echo "### Here we ought to test -m --return {/}_{/.}_{#/.}_{#/}_{#.} with files containing space"
48 echo "### But we will wait for a real world scenario"