Fix tests

This commit is contained in:
Duncan Ferguson 2013-04-16 09:23:03 +01:00
parent b93a99ef93
commit 5ea730aff9
2 changed files with 7 additions and 5 deletions

View file

@ -75,7 +75,7 @@ sub get_external_clusters {
croak(
App::ClusterSSH::Exception::Cluster->throw(
error => $self->loc(
"External command exited failed.\nCommand: [_1]\nReturn Code: [_2]",
"External command failure.\nCommand: [_1]\nReturn Code: [_2]",
$command,
$return_code,
),
@ -213,6 +213,10 @@ Create a new object. Object should be common across all invocations.
Read in /etc/clusters, $HOME/.clusterssh/clusters and any other given
file name and register the tags found.
=item @resolved_tags=get_external_clusters($path_to_binary, @tags)
Define and use an external script to resolve tags into hostnames.
=item $cluster->get_tag_entries($filename);
Read in /etc/tags, $HOME/.clusterssh/tags and any other given

View file

@ -125,8 +125,7 @@ trap {
@external_expected = $cluster1->get_external_clusters(
"$Bin/external_cluster_command -x $redirect");
};
is( $trap->die,
'External command exited with non-zero status: 5',
like( $trap->die, qr/External command failure.*external_cluster_command.*Return Code: 5/ms,
'External command: caught exception message'
);
is( $trap->stdout, '', 'External command: no stdout from perl code' );
@ -136,8 +135,7 @@ trap {
@external_expected = $cluster1->get_external_clusters(
"$Bin/external_cluster_command -q $redirect");
};
is( $trap->die,
'External command exited with non-zero status: 255',
like( $trap->die, qr/External command failure.*external_cluster_command.*Return Code: 255/ms,
'External command: caught exception message'
);
is( $trap->stdout, '', 'External command: no stdout from perl code' );