Commit | Line | Data |
f129bfaf |
1 | use strictures 1; |
2 | use Test::More; |
3 | |
abef6e5b |
4 | $ENV{OBJECT_REMOTE_TEST_LOGGER} = 1; |
f129bfaf |
5 | |
6 | use Object::Remote::Connector::Local; |
7 | use Object::Remote::Connector::SSH; |
8 | |
9 | my $defaults = Object::Remote::Connector::Local->new; |
10 | |
11 | my $normal = $defaults->final_perl_command; |
466ee2c4 |
12 | my $ulimit = Object::Remote::Connector::Local->new(ulimit => "-v 536")->final_perl_command; |
f129bfaf |
13 | my $nice = Object::Remote::Connector::Local->new(nice => 834)->final_perl_command; |
466ee2c4 |
14 | my $both = Object::Remote::Connector::Local->new(nice => 612, ulimit => "-v 913")->final_perl_command; |
15 | my $ssh = Object::Remote::Connector::SSH->new(nice => 494, ulimit => "-v 782", ssh_to => 'testhost')->final_perl_command; |
f129bfaf |
16 | |
466ee2c4 |
17 | is($defaults->timeout, 10, 'Default connection timeout value is correct'); |
f129bfaf |
18 | is($defaults->watchdog_timeout, undef, 'Watchdog is not enabled by default'); |
19 | is($defaults->nice, undef, 'Nice is not enabled by default'); |
20 | is($defaults->ulimit, undef, 'Ulimit is not enabled by default'); |
21 | is($defaults->stderr, undef, 'Child process STDERR is clone of parent process STDERR by default'); |
22 | |
466ee2c4 |
23 | is_deeply($normal, ['bash', '-c', 'perl -'], 'Default Perl interpreter arguments correct'); |
24 | is_deeply($ulimit, ['bash', '-c', 'ulimit -v 536 || exit 1; perl -'], 'Arguments for ulimit are correct'); |
25 | is_deeply($nice, ['bash', '-c', 'nice -n 834 perl -'], 'Arguments for nice are correct'); |
26 | is_deeply($both, ['bash', '-c', 'ulimit -v 913 || exit 1; nice -n 612 perl -'], 'Arguments for nice and ulimit are correct'); |
27 | is_deeply($ssh, [qw(ssh -A testhost), "bash -c 'ulimit -v 782 || exit 1; nice -n 494 perl -'"], "Arguments using ssh are correct"); |
f129bfaf |
28 | |
29 | done_testing; |
30 | |