[ 
https://issues.apache.org/jira/browse/WHIRR-164?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971887#action_12971887
 ] 

Tom White commented on WHIRR-164:
---------------------------------

We should add a ClusterSpec(boolean loadDefaults) for testing, so unit tests 
can pass in false when they don't care about having a keypair.

For integration tests, it's probably OK to fall back to the default since the 
user can override by setting the config system property. However, we can remove 
the following from each service test, since it never happens:

{code}
if (clusterSpec.getPrivateKey() == null) {
  Map<String, String> pair = KeyPair.generate();
  clusterSpec.setPublicKey(pair.get("public"));
  clusterSpec.setPrivateKey(pair.get("private"));
}
{code}

HadoopProxy has some conditional code to get the identity file. The first 
branch is never taken now (since WHIRR-160), since files are never stored as 
FilePayloads (we should fix ClusterSpec to remedy this). The second branch 
fails because the permissions on the generated key are too open. The following 
code needs adding: 
{code}
// Set to 600
identity.setReadable(false, false);
identity.setReadable(true, true);
identity.setWritable(false, false);
identity.setWritable(true, true);
identity.setExecutable(false);
{code}


> Tests fail if there is no ~/.ssh/id_rsa keypair
> -----------------------------------------------
>
>                 Key: WHIRR-164
>                 URL: https://issues.apache.org/jira/browse/WHIRR-164
>             Project: Whirr
>          Issue Type: Bug
>          Components: core
>            Reporter: Tom White
>            Priority: Critical
>             Fix For: 0.3.0
>
>
> The unit and integration tests depend on there being a ~/.ssh/id_rsa keypair.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to