2013-03-24 16:24:59 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-01-06 18:10:20 +00:00
|
|
|
SERVER1=parallel-server1
|
2013-03-24 16:24:59 +00:00
|
|
|
SERVER2=lo
|
2017-01-06 18:10:20 +00:00
|
|
|
SSHLOGIN1=parallel@parallel-server1
|
2013-03-24 16:24:59 +00:00
|
|
|
SSHLOGIN2=parallel@lo
|
2014-04-22 10:03:41 +00:00
|
|
|
SSHLOGIN3=parallel@parallel-server2
|
2013-03-24 16:24:59 +00:00
|
|
|
|
2013-11-22 17:24:09 +00:00
|
|
|
echo '### Test use special ssh'
|
|
|
|
echo 'TODO test ssh with > 9 simultaneous'
|
2013-03-24 16:24:59 +00:00
|
|
|
echo 'ssh "$@"; echo "$@" >>/tmp/myssh1-run' >/tmp/myssh1
|
|
|
|
echo 'ssh "$@"; echo "$@" >>/tmp/myssh2-run' >/tmp/myssh2
|
|
|
|
chmod 755 /tmp/myssh1 /tmp/myssh2
|
2015-02-01 20:46:06 +00:00
|
|
|
seq 1 100 | parallel --sshdelay 0.03 --retries 10 --sshlogin "/tmp/myssh1 $SSHLOGIN1,/tmp/myssh2 $SSHLOGIN2" -k echo
|
|
|
|
|
2018-09-20 22:15:14 +00:00
|
|
|
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/\;s/\$SSHLOGIN1/$SSHLOGIN1/\;s/\$SSHLOGIN2/$SSHLOGIN2/\;s/\$SSHLOGIN3/$SSHLOGIN3/ | parallel -vj3 -k -L1 -r
|
2015-02-01 20:46:06 +00:00
|
|
|
echo '### test --timeout --retries'
|
|
|
|
parallel -j0 --timeout 5 --retries 3 -k ssh {} echo {} ::: 192.168.1.197 8.8.8.8 $SSHLOGIN1 $SSHLOGIN2 $SSHLOGIN3
|
|
|
|
|
|
|
|
echo '### test --filter-hosts with server w/o ssh, non-existing server'
|
|
|
|
parallel -S 192.168.1.197,8.8.8.8,$SSHLOGIN1,$SSHLOGIN2,$SSHLOGIN3 --filter-hosts --nonall -k --tag echo
|
2013-08-16 11:11:35 +00:00
|
|
|
|
2014-11-14 00:00:56 +00:00
|
|
|
echo '### bug #41964: --controlmaster not seems to reuse OpenSSH connections to the same host'
|
|
|
|
(parallel -S redhat9.tange.dk true ::: {1..20}; echo No --controlmaster - finish last) &
|
|
|
|
(parallel -M -S redhat9.tange.dk true ::: {1..20}; echo With --controlmaster - finish first) &
|
|
|
|
wait
|
|
|
|
|
2013-08-16 11:11:35 +00:00
|
|
|
echo '### --filter-hosts - OK, non-such-user, connection refused, wrong host'
|
|
|
|
parallel --nonall --filter-hosts -S localhost,NoUser@localhost,154.54.72.206,"ssh 5.5.5.5" hostname
|
2013-08-17 16:24:51 +00:00
|
|
|
|
|
|
|
echo '### test --workdir . in $HOME'
|
2013-08-19 09:15:39 +00:00
|
|
|
cd && mkdir -p parallel-test && cd parallel-test &&
|
2013-08-17 16:24:51 +00:00
|
|
|
echo OK > testfile && parallel --workdir . --transfer -S $SSHLOGIN1 cat {} ::: testfile
|
2013-11-28 15:05:25 +00:00
|
|
|
|
2015-08-04 05:54:40 +00:00
|
|
|
echo '### TODO: test --filter-hosts proxied through the one host'
|
|
|
|
|
|
|
|
echo '### bug #43358: shellshock breaks exporting functions using --env'
|
|
|
|
echo shellshock-hardened to shellshock-hardened;
|
|
|
|
funky() { echo Function $1; };
|
|
|
|
export -f funky;
|
|
|
|
parallel --env funky -S parallel@localhost funky ::: shellshock-hardened
|
|
|
|
|
|
|
|
echo '2bug #43358: shellshock breaks exporting functions using --env'
|
|
|
|
echo shellshock-hardened to non-shellshock-hardened;
|
|
|
|
funky() { echo Function $1; };
|
|
|
|
export -f funky;
|
|
|
|
parallel --env funky -S centos3.tange.dk funky ::: non-shellshock-hardened
|
2013-11-28 15:05:25 +00:00
|
|
|
|
2013-08-19 09:15:39 +00:00
|
|
|
EOF
|
2015-02-01 20:46:06 +00:00
|
|
|
rm /tmp/myssh1 /tmp/myssh2 /tmp/myssh1-run /tmp/myssh2-run
|
|
|
|
|