X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=t%2Fperl_execute.t;h=e92db59384074d5578c01661dbd20aa3cbabbf67;hp=c710ed3d3c3236d660cc923ebfff2735d9277763;hb=466ee2c442ee6958e077a02c3c250245f06ad819;hpb=eb49c7df7a88ac9114188e9eeb1480205bea97ee diff --git a/t/perl_execute.t b/t/perl_execute.t index c710ed3..e92db59 100644 --- a/t/perl_execute.t +++ b/t/perl_execute.t @@ -11,22 +11,22 @@ use Object::Remote::Connector::SSH; my $defaults = Object::Remote::Connector::Local->new; my $normal = $defaults->final_perl_command; -my $ulimit = Object::Remote::Connector::Local->new(ulimit => 536)->final_perl_command; +my $ulimit = Object::Remote::Connector::Local->new(ulimit => "-v 536")->final_perl_command; my $nice = Object::Remote::Connector::Local->new(nice => 834)->final_perl_command; -my $both = Object::Remote::Connector::Local->new(nice => 612, ulimit => 913)->final_perl_command; -my $ssh = Object::Remote::Connector::SSH->new(nice => 494, ulimit => 782, ssh_to => 'testhost')->final_perl_command; +my $both = Object::Remote::Connector::Local->new(nice => 612, ulimit => "-v 913")->final_perl_command; +my $ssh = Object::Remote::Connector::SSH->new(nice => 494, ulimit => "-v 782", ssh_to => 'testhost')->final_perl_command; -is($defaults->timeout->{after}, 10, 'Default connection timeout value is correct'); +is($defaults->timeout, 10, 'Default connection timeout value is correct'); is($defaults->watchdog_timeout, undef, 'Watchdog is not enabled by default'); is($defaults->nice, undef, 'Nice is not enabled by default'); is($defaults->ulimit, undef, 'Ulimit is not enabled by default'); is($defaults->stderr, undef, 'Child process STDERR is clone of parent process STDERR by default'); -is_deeply($normal, ['sh', '-c', 'perl -'], 'Default Perl interpreter arguments correct'); -is_deeply($ulimit, ['sh', '-c', 'ulimit -v 536; perl -'], 'Arguments for ulimit are correct'); -is_deeply($nice, ['sh', '-c', 'nice -n 834 perl -'], 'Arguments for nice are correct'); -is_deeply($both, ['sh', '-c', 'ulimit -v 913; nice -n 612 perl -'], 'Arguments for nice and ulimit are correct'); -is_deeply($ssh, [qw(ssh -A testhost), "sh -c 'ulimit -v 782; nice -n 494 perl -'"], "Arguments using ssh are correct"); +is_deeply($normal, ['bash', '-c', 'perl -'], 'Default Perl interpreter arguments correct'); +is_deeply($ulimit, ['bash', '-c', 'ulimit -v 536 || exit 1; perl -'], 'Arguments for ulimit are correct'); +is_deeply($nice, ['bash', '-c', 'nice -n 834 perl -'], 'Arguments for nice are correct'); +is_deeply($both, ['bash', '-c', 'ulimit -v 913 || exit 1; nice -n 612 perl -'], 'Arguments for nice and ulimit are correct'); +is_deeply($ssh, [qw(ssh -A testhost), "bash -c 'ulimit -v 782 || exit 1; nice -n 494 perl -'"], "Arguments using ssh are correct"); done_testing;