File: perl_execute.t

package info (click to toggle)
libobject-remote-perl 0.004000-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 488 kB
  • ctags: 248
  • sloc: perl: 2,408; makefile: 7
file content (26 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use strictures 1;
use Test::More;

$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1;

use Object::Remote::Connector::Local;
use Object::Remote::Connector::SSH;

my $defaults = Object::Remote::Connector::Local->new;
my $normal = $defaults->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->stderr, undef, 'Child process STDERR is clone of parent process STDERR by default');

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;