is( $homedir2, "/home/test", 'got $ENV{HOME} the smart way' );
$perlssh->eval( 'chomp(my @env = `ssh-agent`); foreach (@env) { /^(.*?)=(.*)/; $ENV{$1} = $2; }' );
-$perlssh->eval( 'system("ssh-add")' );
+my $test_ssh_add = $perlssh->eval( 'system("ssh-add")' );
my $test_ssh_env = $perlssh->eval( '$ENV{SSH_AUTH_SOCK}' );
ok( defined $test_ssh_env, "SSH_AUTH_SOCK = $test_ssh_env" );
+ok( defined $test_ssh_add, "ssh-add returned $test_ssh_add" );
my @test_hosts = ( 'stagetwo@localhost', 'stagethree@localhost' );
my ($cmd2, $pssh2) = $pipc->_open_perlssh(@test_hosts);