From f4db50264af3ffee9b235b51b43b5ac63d68967d Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 28 Nov 2013 16:05:25 +0100 Subject: [PATCH] parallel: --filter-host with --delay and --retries. Incl test. --- src/parallel | 5 ++--- testsuite/tests-to-run/parallel-remote1.sh | 7 +++++++ testsuite/wanted-results/parallel-remote1 | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/parallel b/src/parallel index bbdce162..b785592a 100755 --- a/src/parallel +++ b/src/parallel @@ -119,8 +119,7 @@ if($opt::filter_hosts and (@opt::sshlogin or @opt::sshloginfile)) { my ($fh, $tmpfile) = ::tempfile(SUFFIX => ".ssh"); print $fh @cores, @cpus, @maxline, @echo; close $fh; -# my $cmd = "cat $tmpfile | $0 -j0 --timeout 5 -s 1000 --joblog - --plain --delay 0.1 --retries 3 --tag --tagstring {1} --colsep '\t' -k eval {2} 2>/dev/null"; - my $cmd = "cat $tmpfile | $0 -j0 --timeout 5 -s 1000 --joblog - --plain --tag --tagstring {1} --colsep '\t' -k eval {2} 2>/dev/null"; + my $cmd = "cat $tmpfile | $0 -j0 --timeout 5 -s 1000 --joblog - --plain --delay 0.1 --retries 3 --tag --tagstring {1} --colsep '\t' -k eval {2} 2>/dev/null"; ::debug($cmd."\n"); open(my $host_fh, "-|", $cmd) || ::die_bug("parallel host check: $cmd"); my (%ncores, %ncpus, %time_to_login, %maxlen, %echo); @@ -801,7 +800,7 @@ sub get_options_from_array { sub parse_options { # Returns: N/A # Defaults: - $Global::version = 20131122; + $Global::version = 20131129; $Global::progname = 'parallel'; $Global::infinity = 2**31; $Global::debug = 0; diff --git a/testsuite/tests-to-run/parallel-remote1.sh b/testsuite/tests-to-run/parallel-remote1.sh index 07525117..fc5df432 100644 --- a/testsuite/tests-to-run/parallel-remote1.sh +++ b/testsuite/tests-to-run/parallel-remote1.sh @@ -19,4 +19,11 @@ echo '### --filter-hosts - OK, non-such-user, connection refused, wrong host' echo '### test --workdir . in $HOME' cd && mkdir -p parallel-test && cd parallel-test && echo OK > testfile && parallel --workdir . --transfer -S $SSHLOGIN1 cat {} ::: testfile + +echo '### test --timeout --retries' + parallel -j0 --timeout 5 --retries 3 -k ssh {} echo {} ::: 192.168.1.197 8.8.8.8 n m o c f w + +echo '### test --filter-hosts with server w/o ssh, non-existing server, and 5 proxied through the same' + parallel -S 192.168.1.197,8.8.8.8,n,m,o,c,f,w --filter-hosts --nonall --tag echo | sort + EOF diff --git a/testsuite/wanted-results/parallel-remote1 b/testsuite/wanted-results/parallel-remote1 index 835348c6..a3e049a8 100644 --- a/testsuite/wanted-results/parallel-remote1 +++ b/testsuite/wanted-results/parallel-remote1 @@ -104,3 +104,17 @@ TODO test ssh with > 9 simultaneous aspire ### test --workdir . in $HOME OK +### test --timeout --retries +n +m +o +c +f +w +### test --filter-hosts with server w/o ssh, non-existing server, and 5 proxied through the same +c +f +m +n +o +w