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=2e95bf4b3ed52e678ff6861aa8fe585db9f7ccea;hp=f7eae029ad6ece7ac30c601ef7fc1f8ea8ca0347;hb=HEAD;hpb=6af673c19d7b5d0f9e428b21edfc0e5ae4f77576 diff --git a/t/perl_execute.t b/t/perl_execute.t index f7eae02..2e95bf4 100644 --- a/t/perl_execute.t +++ b/t/perl_execute.t @@ -3,28 +3,24 @@ use Test::More; $ENV{OBJECT_REMOTE_TEST_LOGGER} = 1; -use Object::Remote::Connector::Local; -use Object::Remote::Connector::SSH; +use Object::Remote::Connector::Local; +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 => "-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 => "-v 913")->final_perl_command; -my $ssh = Object::Remote::Connector::SSH->new(nice => 494, ulimit => "-v 782", ssh_to => 'testhost')->final_perl_command; +my $ssh = Object::Remote::Connector::SSH->new(ssh_to => 'testhost')->final_perl_command; +my $with_env = do { + local $ENV{OBJECT_REMOTE_PERL_BIN} = 'perl_bin_test_value'; + Object::Remote::Connector::Local->new->final_perl_command; +}; 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, ['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"); +is_deeply($normal, ['perl', '-'], 'Default Perl interpreter arguments correct'); +is_deeply($ssh, [qw(ssh -A testhost), "perl -"], "Arguments using ssh are correct"); +is_deeply($with_env, ['perl_bin_test_value', '-'], "Respects OBJECT_REMOTE_PERL_BIN env value"); -done_testing; +done_testing;