2010-05-27 06:09:28 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2011-10-17 01:10:32 +00:00
|
|
|
SERVER1=parallel-server1
|
2010-05-27 06:09:28 +00:00
|
|
|
SERVER2=parallel-server2
|
2020-08-07 20:20:30 +00:00
|
|
|
SSHUSER1=vagrant
|
|
|
|
SSHUSER2=vagrant
|
|
|
|
SSHLOGIN1=$SSHUSER1@$SERVER1
|
|
|
|
SSHLOGIN2=$SSHUSER2@$SERVER2
|
|
|
|
#SSHLOGIN1=parallel@$SERVER1
|
|
|
|
#SSHLOGIN2=parallel@$SERVER2
|
2010-05-27 06:09:28 +00:00
|
|
|
|
2010-08-14 20:51:09 +00:00
|
|
|
echo '### Check -S .. and --serverloginfile ..'
|
2011-10-17 01:10:32 +00:00
|
|
|
echo $SSHLOGIN1 > ~/.parallel/sshloginfile
|
|
|
|
echo $SSHLOGIN2 >> ~/.parallel/sshloginfile
|
2010-08-14 20:51:09 +00:00
|
|
|
seq 1 20 | parallel -k -S .. echo
|
|
|
|
seq 1 20 | parallel -k --sshloginfile .. echo
|
|
|
|
|
2010-05-27 22:34:00 +00:00
|
|
|
echo '### Check warning if --transfer but file not found'
|
2011-10-17 01:10:32 +00:00
|
|
|
echo /tmp/noexistant/file | stdout parallel -k -S $SSHLOGIN1 --transfer echo
|
2010-05-27 22:34:00 +00:00
|
|
|
|
2010-06-14 22:05:47 +00:00
|
|
|
echo '### Transfer for file starting with :'
|
|
|
|
cd /tmp
|
|
|
|
(echo ':'; echo file:name; echo file:name.foo; echo file: name.foo; echo file : name.foo;) \
|
|
|
|
> /tmp/test18
|
|
|
|
cat /tmp/test18 | parallel echo content-{} ">" {}
|
2020-08-07 20:20:30 +00:00
|
|
|
cat /tmp/test18 | parallel -j1 --trc {}.{.} -S $SSHLOGIN1,$SSHLOGIN2,: \
|
2010-06-14 22:05:47 +00:00
|
|
|
'(echo remote-{}.{.};cat {}) > {}.{.}'
|
|
|
|
cat /tmp/test18 | parallel -j1 -k 'cat {}.{.}'
|
|
|
|
|
2010-05-27 22:34:00 +00:00
|
|
|
echo '### Check warning if --transfer but not --sshlogin'
|
2010-08-14 20:51:09 +00:00
|
|
|
echo | stdout parallel -k --transfer echo
|
2010-05-27 22:34:00 +00:00
|
|
|
|
|
|
|
echo '### Check warning if --return but not --sshlogin'
|
2010-08-14 20:51:09 +00:00
|
|
|
echo | stdout parallel -k --return {} echo
|
2010-05-27 22:34:00 +00:00
|
|
|
|
|
|
|
echo '### Check warning if --cleanup but not --sshlogin'
|
2010-08-14 20:51:09 +00:00
|
|
|
echo | stdout parallel -k --cleanup echo
|
2010-05-27 22:34:00 +00:00
|
|
|
|
2010-05-27 06:09:28 +00:00
|
|
|
echo '### Test --sshlogin -S --sshloginfile'
|
|
|
|
echo localhost >/tmp/parallel-sshlogin
|
2020-08-07 20:20:30 +00:00
|
|
|
seq 1 3 | parallel -k --sshlogin 8/$SSHLOGIN1 -S "7/ssh -l $SSHUSER2 $SERVER2",: --sshloginfile /tmp/parallel-sshlogin echo
|
2010-05-27 06:09:28 +00:00
|
|
|
|
|
|
|
echo '### Test --sshloginfile with extra content'
|
2020-08-07 20:20:30 +00:00
|
|
|
echo "2/ssh -l $SSHUSER2 $SERVER2" >>/tmp/parallel-sshlogin
|
2010-05-27 06:09:28 +00:00
|
|
|
echo ":" >>/tmp/parallel-sshlogin
|
|
|
|
echo "#2/ssh -l tange nothing" >>/tmp/parallel-sshlogin
|
2010-08-14 20:51:09 +00:00
|
|
|
seq 1 10 | parallel -k --sshloginfile /tmp/parallel-sshlogin echo
|
2010-05-27 06:09:28 +00:00
|
|
|
|
|
|
|
echo '### Check forced number of CPUs being respected'
|
2014-07-26 11:17:13 +00:00
|
|
|
seq 1 20 | stdout parallel -k -j+0 -S 1/:,7/$SSHLOGIN1 "hostname; echo {} >/dev/null" | sort
|
2010-05-27 06:09:28 +00:00
|
|
|
|
|
|
|
echo '### Check more than 9 simultaneous sshlogins'
|
2021-10-03 18:31:55 +00:00
|
|
|
seq 1 11 | parallel -k -j0 -S "ssh lo" echo
|
2010-05-27 06:09:28 +00:00
|
|
|
|
|
|
|
echo '### Check -S syntax'
|
2012-06-14 22:46:15 +00:00
|
|
|
seq 1 11 | parallel -k -j100% -S : echo
|