parallel/testsuite/tests-to-run/test60.sh

49 lines
1.9 KiB
Bash
Raw Normal View History

2011-05-28 14:33:22 +00:00
#!/bin/bash
SERVER1=parallel-server1
2011-05-28 14:33:22 +00:00
SERVER2=parallel-server2
SSHLOGIN1=parallel@$SERVER1
SSHLOGIN2=parallel@$SERVER2
2011-05-28 14:33:22 +00:00
# -L1 will join lines ending in ' '
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/\;s/\$SSHLOGIN1/$SSHLOGIN1/\;s/\$SSHLOGIN2/$SSHLOGIN2/ | parallel -vj10 -k --joblog /tmp/jl-`basename $0` -L1
echo '### Test --onall';
2014-07-14 16:25:45 +00:00
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2
echo '### Test | --onall';
2014-07-14 16:25:45 +00:00
seq 3 | parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c :::: -
echo '### Test --onall -u';
2014-07-14 16:25:45 +00:00
parallel --onall -S $SSHLOGIN1,$SSHLOGIN2 -u '(echo {1} {2}) | awk \{print\ \$2}' ::: a b c ::: 1 2 3 | sort
echo '### Test --nonall';
parallel --nonall -k -S $SSHLOGIN1,$SSHLOGIN2 'hostname' | sort
echo '### Test --nonall -u - should be interleaved x y x y';
2013-04-11 19:55:33 +00:00
parallel --nonall -S $SSHLOGIN1,$SSHLOGIN2 -u 'hostname|grep -q redhat9 && sleep 3; hostname;sleep 12;hostname;'
echo '### Test read sshloginfile from STDIN';
echo $SSHLOGIN1 | parallel -S - --nonall hostname;
echo $SSHLOGIN1 | parallel --sshloginfile - --nonall hostname
echo '### Test --nonall --basefile';
touch /tmp/nonall--basefile;
2015-02-01 15:57:31 +00:00
parallel --nonall --basefile /tmp/nonall--basefile -S $SSHLOGIN1,$SSHLOGIN2 ls /tmp/nonall--basefile\; rm /tmp/nonall--basefile;
2015-02-01 13:38:26 +00:00
rm /tmp/nonall--basefile
echo '### Test --onall --basefile';
touch /tmp/onall--basefile;
2015-02-01 15:57:31 +00:00
parallel --onall --basefile /tmp/onall--basefile -S $SSHLOGIN1,$SSHLOGIN2 ls {}\; rm {} ::: /tmp/onall--basefile;
2015-02-01 13:38:26 +00:00
rm /tmp/onall--basefile
echo '### Test --workdir .';
ssh $SSHLOGIN1 mkdir -p mydir;
mkdir -p $HOME/mydir; cd $HOME/mydir;
parallel --workdir . -S $SSHLOGIN1 ::: pwd
echo '### Test --wd .';
ssh $SSHLOGIN2 mkdir -p mydir;
mkdir -p $HOME/mydir; cd $HOME/mydir;
parallel --workdir . -S $SSHLOGIN2 ::: pwd
EOF